Resources · n8n integration

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

Why automate

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.

Connect

How do you connect Xata to n8n?

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

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

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

Connections

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)

  • Memoryai_memory
01MemoryXata 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.

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.
Use cases
an agent behind a chat widget that answers a follow-up question correctly because the previous exchange is still in context.
Parameters

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.

01

Session ID

sessionIdType

What 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 called sessionId coming 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 }}.
Use cases
a chat widget where the customer address becomes the key, so each customer keeps a private thread.
02

Context Window Length

contextWindowLength

What 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.
Use cases
a support assistant that keeps the last few exchanges in view so the visitor never has to repeat the order number typed three messages ago.
Need help

Need help automating Xata with n8n?

A person reads every message.

FAQ

Xata and n8n, questions people ask

01Is the Xata node free in n8n?
Yes on the n8n side. The node belongs to the n8n AI package, which ships with n8n, so there is nothing to install and no extra charge whether you run n8n Cloud or self-host the Community Edition under the Sustainable Use licence. A workflow behaves identically in both. What sits outside that answer is your Xata database, which follows Xata's own terms, and the model provider you connect to the root node: OpenAI, Anthropic, Google or Mistral bill their API calls under their own conditions, and n8n adds nothing on top.
02What do you need for the n8n Xata node to work?
Two things. A credential, and a root node to plug into. The credential authenticates with an API key and holds three values: the Database Endpoint identifying your database for the Workspace API, the Branch, which is the name of the GitHub branch for the database, and the API Key generated from Account Settings in Xata. You also need a Xata database, or an account on an existing one, before any of this. On the n8n side, the node has no main input and never runs alone, so it only does something once it answers the Memory port of a root node.
03What are the limits of the Xata memory node?
It does one job: persisting conversation context so an agent can keep talking across interactions. There are no operations to choose from and only two parameters, Session ID and Context Window Length, so nothing else about the exchange is configurable here. AI chains in n8n cannot use memory at all, which rules out chain-shaped workflows. One behaviour catches people out: several Xata nodes in the same workflow share a single memory instance by default, so a destructive action like the override all messages operation in the Chat Memory Manager node can clear history another branch depends on. Different session IDs keep them apart. This page describes node version 2.
04What do you plug in at minimum, and where do you start?
At minimum, a root node and a chat model. Memory is optional: an AI Agent runs without it, it just treats every message as a fresh start. So build the agent first, connect a chat model with its provider credential, confirm it answers, then clip Xata onto the Memory port and watch the follow-up questions start landing. Begin with Session ID set to the connected Chat Trigger, since the session identifier arrives on its own and there is nothing to write. Move to Define below once real users need one thread each.
05n8n or Make for an AI memory like this?
It comes down to four criteria, and neither tool wins them all. Hosting: n8n can be self-hosted with Docker or npm, or used on n8n Cloud, while Make is hosted only. Data control follows from that, which matters when conversation history holds customer messages. Cost model: Make bills per operation, and a chat agent generates a lot of small operations. Visual logic: both are visual builders, and the sub-node model shown here, ports and small nodes clipped onto a root node, is specific to n8n. Pick on those, not on a feature list.
Hack'celeration Lab

Get our weekly integration tips.

No spam. Unsubscribe anytime.