n8n Xata nodeConfigure Xata in n8n.
Chat history has to live somewhere outside a single workflow run. The n8n Xata node keeps it in a Xata database, so an agent still knows what was said an hour ago. Two parameters to set, one Memory port to plug into, one API key credential. For anyone running chat agents past the demo stage.
Verified Trustpilot reviews · AI, automation & growth agency
What does the n8n Xata node actually do?
The Xata node is a sub-node, meaning a small node you attach to a bigger one instead of running it on its own. It answers the Memory port of a root node such as the AI Agent, and stores past interactions in a Xata database. Without it, every message reaching your agent arrives with no past: same question twice, same blank slate twice.
Three situations where this node earns its place. A support assistant on a chat widget: the visitor asks a follow-up question two messages later, and the agent needs the earlier answer to make sense of it. An internal assistant that people come back to across the day, where the conversation has to survive the browser being closed. A multi-agent setup where the same conversation is picked up by more than one node, and the memory has to be shared rather than duplicated.
The last case is where the node behaves in a way worth knowing before you ship. Add more than one Xata node to a workflow and they all read the same memory instance by default. That is convenient until a destructive action, such as the override all messages operation in the Chat Memory Manager node, wipes a conversation another branch was still using. Different conversations mean different session IDs, set explicitly.
When to reach for something else: the Memory port only exists on root nodes that support it, and n8n AI chains cannot use memory at all. If your flow is a one-shot chain that summarizes or classifies a single input, there is nothing to remember and nothing to plug in. Memory belongs to agent-style flows, the ones you build with the AI Agent node or expose to another agent through AI Agent Tool.
The limits are worth stating plainly. The node stores and replays conversation context, nothing more: no search over your records, no vector retrieval, no document ingestion. It carries two parameters and no operations to pick from, so everything else about the conversation is decided by the root node and by the chat model you connect to it, whether that is OpenAI or Anthropic. The provider bills its own API calls under its own terms, and n8n adds nothing on top of that.
One last thing to check before building: the node ships inside the n8n AI package, so it is already in your instance, and the same workflow behaves the same way on n8n Cloud and on a self-hosted install. If you want a wider read on the platform before committing a production agent to it, the n8n review covers the trade-offs, and n8n training goes through agent building step by step.
How do you connect Xata to n8n?
- 01
Create the database and the key
Start on the Xata side: you need a database, or an account on a database someone else already created. Then generate the key the credential will use. Go to Account Settings in the Xata app and select + Add a key. Copy the value straight away and keep it somewhere safe, because the credential form is the only place n8n will ask for it. This is the value that goes into the API Key field.
- 02
Build the database endpoint
The Database Endpoint is how the Workspace API knows which database you are talking to. It follows the format
https://{workspace-display-name}-{workspace-id}.{region}.xata.sh/db/{dbname}. The workspace ID is the unique identifier of the workspace, 6 alphanumeric characters. The region is the hosting region of the database. The display name at the front is optional: the API ignores it, but it helps you tell saved credentials apart. - 03
Save the credential and pick it on the node
In n8n, open the Credentials menu and create the Xata credential with the three values: the endpoint you just assembled, the Branch, which is the name of the GitHub branch for your database, and the API Key. Save it once and every Xata node in every workflow can select it from the dropdown. On the node itself, the credential is the only thing to choose before the two parameters below.
Where does this node plug in?
n8n AI workflows are built from a root node that receives the items, plus sub-nodes clipped onto its ports, one type of sub-node per port. Xata is a sub-node: it has no main input and never runs by itself.
Output (what it plugs into)
- Memory
ai_memory
01Memory
Xata answers the Memory port, the socket a root node exposes when it can carry a conversation from one execution to the next. Drag the connector from the port down to the Xata node and the root node starts reading and writing its history in your database instead of forgetting it.
Key parameters
- Optional: a root node runs without memory, it simply treats every incoming message as the first one.
- AI Agent: the usual host, and AI Agent Tool when that agent is itself called by another one.
- Chat Trigger: where the conversation enters the workflow.
- Chat Memory Manager: to read or overwrite the stored messages yourself.
Which parameters do you set on the node?
The Xata node has 2 parameters. For each one: the node as you configure it in n8n, what the parameter changes, and our field notes.
Parameters index
Session ID
sessionIdTypeWhat you see in n8n
Notes & use cases
This tells the node which conversation it is looking at. One session ID is one thread of history, so the value decides whether two visitors share a memory or each get their own.
Key parameters
- Connected Chat Trigger Node (
fromInput): looks for an input field calledsessionIdcoming from a directly connected Chat Trigger. - Define below (
customKey): an expression pointing at data from previous nodes, or static text. The Key field that appears stores the session ID in the memory, often{{ $json.email }}.
Context Window Length
contextWindowLengthWhat you see in n8n
Notes & use cases
Stored history and replayed history are two different things. This number decides how many past interactions the model receives as context on each call, out of everything the database holds.
Key parameters
- Context Window Length: a number. Raise it and the model sees further back, which helps on long troubleshooting conversations. Lower it and each call carries less text, which is what you want on a short, high-volume assistant.
Need help automating Xata with n8n?
A person reads every message.
Xata and n8n, questions people ask
01Is the Xata node free in n8n?
02What do you need for the n8n Xata node to work?
03What are the limits of the Xata memory node?
04What do you plug in at minimum, and where do you start?
05n8n or Make for an AI memory like this?
Get our weekly integration tips.
No spam. Unsubscribe anytime.

