Templates / Run a multi-session chat agent with OpenAI and data table memory

Run a multi-session chat agent with OpenAI and data table memory

Ready for 3.0

by Ted Chan · 127 views · created 2026-06-01 · Support Chatbot, AI Chatbot

Ready 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.

  1. Search session_id (Data table): get
  2. Found session_id (If): checks a condition and branches into true / false
  3. Load past session data (Edit Fields (Set)): sets 18 fields: user_id, session_id, execution_time…
  4. New session record (Data table): uses Data table
  5. 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

OpenAI Chat ModelData table

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)

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…

Excerpt from Ted Chan's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.