A structured lesson workspace with readable content, hands-on examples, and a clean path to completion.
Open a new n8n workflow and name it 'Presales AI Agent'. We start by adding a Chat Trigger. This is the primary interface for user interaction. Next, drop in the AI Agent node. This is the heart of the operation. It binds the model, the memory, and the tools into a single execution loop.
Creating the basic agent workflow in n8n
This video requires an access code. Enter your code below to unlock it instantly.
Don't have a code? Contact us to get access.
We need an LLM. Connect the agent to a Google Gemini model. We use Gemini 2.5 Flash here because it offers a generous free tier via Google AI Studio and performs exceptionally well for agentic routing. Generate your API key in AI Studio, paste it into the n8n credential store, and select the model.
With the model connected, we add a Simple Memory component. This allows the agent to retain the last 20 messages in the current session. Without this buffer, every user prompt is treated as an isolated event.
{"systemMessage": "You are a pre-sales assistant for Tech Innovate 2026...","memory": {"type": "buffer","k": 20}}
Paste your system prompt into the agent options. If you test the chat now and ask what the agent can do, it will likely claim it can send emails or generate quotes. It is lying. It has no tools connected yet, so it is hallucinating capabilities. We fix that next.
Finish the lesson once you have worked through the material. This awards ★ 30 XP.