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.