Overview
Build a test n8n workflow with an AI Agent node and a memory node, then check with scripted messages that the agent keeps earlier turns of a conversation with a lead.
Problem or Objective
- How do teams design the context, tools and memory of their own AI agents?
- Which agents write or run tests against an application?
More in Sales, Marketing and Support
AI Agents and Models
Tools and Integrations
- Tools
- n8n
- Prerequisites
- Memory behaviour depends on your n8n version and deployment mode (the memory page excludes queue mode in production); the email and CRM sides are your own and not verified here.
How It Works
Build a small n8n workflow that receives a test message, passes it to an AI Agent node with a chat model and at least one tool, and returns the agent's reply to you instead of sending it. Add a Simple Memory node and set its session key to a stable value per conversation, such as a test contact id. Send a scripted conversation of five or six messages in which the lead states a detail early (a budget or a date) and refers back to it later. Check whether the later replies use the earlier detail, and try a different session key to see that conversations stay apart. Fix the key or the context window length and repeat before you connect any real inbox or CRM.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up n8n.
- Connect the toolsConnect the tools this workflow relies on: n8n.
- Check the prerequisitesMemory behaviour depends on your n8n version and deployment mode (the memory page excludes queue mode in production); the email and CRM sides are your own and not verified here.
- Gather your detailsCollect what the prompt asks for: Company name, Turn that refers back, Test session key.
- Run the starter promptPaste the starter prompt below into n8n and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at docs.n8n.io before you rely on it.
Practical Starter Prompt: Run a scripted memory test
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
You are a sales assistant for [Company name] in a test workflow. Reply to each message as a draft only, never send anything, and wait for my review of each draft before the next message. Use the earlier turns of this conversation: after message [Turn that refers back], the lead will refer back to a detail from message 1, and your reply must use it correctly. After the last message, list every earlier detail you remembered and any you lost. Use session key [Test session key] and do not touch any CRM record.Keep the test on drafts and test contacts, check the memory node against your n8n deployment mode, and have a person review any reply before real use.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. The cited n8n pages document the AI Agent node and the Simple Memory node and their parameters, and they do not say how well an agent keeps a long sales conversation, so the scripted test is the evidence.
Limitations and Considerations
The n8n memory page says the Simple Memory node does not work in an active production workflow when your instance runs in queue mode, so check your deployment before you rely on it. The AI Agent node needs at least one connected tool. Test with a test mailbox and test records, keep outputs as drafts for a person to review, and check marketing consent rules before any real outreach. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Official Website
The official site of the main tool or project in this use case.
Related Videos
About n8n-io/n8n
Give Your Agent Tools (n8n Agents Course 5/7) (opens in a new tab)
Walkthrough of n8n by n8n: it is on the project’s own channel.
Watch on YouTube (opens in a new tab)About n8n-io/n8n
n8n AI Nodes: Connect OpenAI, Claude, and Local Models (opens in a new tab)
Walkthrough of n8n by AI Daily Lab: its description links the GitHub repository.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- AI Agent | Nodes | n8n Docs (opens in a new tab)
Project documentation · docs.n8n.io · Undated · Source checked 2 Dec 2026, 13:21 UTC
What this source supports
- The AI Agent node lets you build an AI agent in n8n.
- You must connect at least one tool sub-node to an AI Agent node.
- Simple Memory | Nodes | n8n Docs (opens in a new tab)
Project documentation · docs.n8n.io · Undated · Source checked 2 Dec 2026, 13:31 UTC
What this source supports
- Use the Simple Memory node to persist chat history in your workflow.
- Session Key : Enter the key to use to store the memory in the workflow data.
- Context Window Length : Enter the number of previous interactions to consider for context.
- If your n8n instance uses queue mode , this node doesn't work in an active production workflow.

