💬 Power your website chat with OpenAI GPT-4o-mini and session memory
⚡ 36 views · 💬 Support Chatbots
Description
Quick Overview
This workflow exposes an n8n chat webhook that powers a website chatbot using an OpenAI chat model, with short-term session memory to keep recent conversation context.
How it works
- Receives a visitor message via the public n8n chat webhook trigger.
- Uses an AI agent with a custom system prompt to interpret the user’s message and decide on a response.
- Provides recent chat history from buffer memory (last 10 messages) to keep the conversation coherent within the session.
- Calls the OpenAI Chat Model (gpt-4o-mini) to generate the chatbot’s reply.
- Returns the generated response back to the chat widget.
Setup
- Add an OpenAI API credential and select it in the OpenAI Chat Model node.
- Update the AI agent system prompt to match your website, tone, and support boundaries.
- Activate the workflow and embed the n8n chat widget on your site using the workflow’s public chat URL.
🔗 Nodes Used
AI Agent, OpenAI Chat Model, Simple Memory, Chat Trigger
📥 Import
Download workflow.json and import into n8n:
Workflow menu → Import from File