Run a multi-session chat agent with OpenAI and data table memory
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
What this workflow does
This AI workflow has 11 nodes and runs when a chat message arrives. Along the way it connects OpenAI Chat Model and Data table.
How it runs
Trigger: When a chat message arrives.
- Search session_id (Data table): get
- Found session_id (If): checks a condition and branches into true / false
- Load past session data (Edit Fields (Set)): sets 18 fields: user_id, session_id, execution_time…
- New session record (Data table): uses Data table
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; 3 tools (update_chat_session_record, lookup_past_session_by_name, lookup_past_session_by_email); memory: Simple Memory
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (8)
- AI Agent
@n8n/n8n-nodes-langchain.agent - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Data table
n8n-nodes-base.dataTable - If
n8n-nodes-base.if - Edit Fields (Set)
n8n-nodes-base.set - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Data Table Tool
n8n-nodes-base.dataTableTool
From the author
Quick overview This workflow powers an OpenAI-based chat agent in n8n that persists long-term conversation memory in an n8n Data Table by session ID, optionally recalling past context via name/email lookups while enforcing an identity-verification flow. How…