Resources · n8n integration

n8n Redis Chat Memory nodeConfigure Redis Chat Memory in n8n.

Chat history that survives a restart lives outside n8n, in Redis. The n8n Redis Chat Memory node is a sub-node, a small node you attach to a bigger one instead of running it on its own. It plugs into the memory port of an agent, carries 3 parameters and runs at version 2.

Verified Trustpilot reviews · AI, automation & growth agency

Why automate

What does the n8n Redis Chat Memory node actually do?

It stores the chat history of an AI conversation in Redis instead of keeping it inside the workflow. A root node, meaning the node that receives the workflow items and drives the model, reads that history back on every run, so the model sees what was said earlier without you resending the whole conversation each time.

Picture a support assistant that answers on a chat widget. Without memory, every message starts from nothing: the customer gives an order number, then asks a follow up question, and the model has no idea what order they mean. Attach this node to the AI Agent, point Session ID at the chat session, and the thread holds together across messages.

Second case: a team runs several chat surfaces off one workflow. Because every Redis Chat Memory node in a workflow reaches the same memory instance by default, two surfaces would read each other's history. Giving each memory node its own session ID keeps the conversations apart, which is exactly what Session ID set to customKey is for.

Third case: a long running assistant where history keeps growing. Context Window Length caps how many past interactions the model receives, and Session Time To Live decides how long the session stays in Redis at all. Those two settings are the difference between a conversation that stays cheap and one that drags a full transcript into every call, billed by whoever provides the model, whether that is OpenAI, Anthropic or another provider.

When would you pick something else? If a conversation only needs to hold together inside a single execution, a memory server is overhead you do not need. Redis earns its place when the history has to outlive the run, be shared between workflows, or expire on a schedule you control. And if the root node is a chain rather than an agent, memory is not an option there at all.

The limits are worth knowing up front. The node exposes 3 parameters and nothing else: no eviction policy, no message trimming beyond the context window, no read or write of individual messages. Destructive operations on the stored history belong to other nodes, so a node such as Chat Memory Manager can overwrite what this one saved when both point at the same session. The n8n review covers where the platform sits more broadly, and AI Agent Tool accepts the same memory port when an agent is called as a tool.

Connect

What do you connect before the node runs?

  1. 01

    Create the Redis credential

    Open the Credentials menu in n8n and add a Redis credential. It asks for a Password, a Host (localhost by default), a Port (6379 by default), a Database Number (0 by default) and an SSL toggle. n8n stores it once and every workflow on the instance can reuse it, so a second memory node later needs no new setup.

  2. 02

    Select it on the node

    Drop the Redis Chat Memory node on the canvas and pick that credential in the node panel. There is no authentication selector to choose from on this node: one credential type, one choice. Everything else on the panel is the 3 parameters covered further down.

  3. 03

    Attach it to a root node

    Drag from the memory port of an AI Agent, AI Agent Tool, Chat Memory Manager or Chat Trigger to the node. A sub-node never executes on its own, so the only way to test the credential is to run the root node and watch the execution. Nothing happens if the node sits unattached on the canvas.

Connections

Where does the node plug in?

n8n splits AI work between a root node, which takes the workflow items, and sub-nodes attached to its ports: one type of sub-node per port. This node fills the memory port and only that port.

Output (what it plugs into)

  • Memoryai_memory
01MemoryThe memory port is where a root node picks up the conversation history it should carry into the next model call. Redis Chat Memory connects here, and nowhere else: the node has no main input, so it never receives workflow items directly.

The memory port is where a root node picks up the conversation history it should carry into the next model call. Redis Chat Memory connects here, and nowhere else: the node has no main input, so it never receives workflow items directly.

Key parameters

  • Optional: an agent answers without memory, it simply forgets everything between messages.
  • AI Agent: the usual root node for a chat assistant that has to remember an order number or a name.
  • Chat Trigger: the entry point of a chat workflow, which also exposes a memory port.
  • Chat Memory Manager: the node that reads and rewrites stored history, pointed at the same Redis session.
Use cases
a chat assistant that keeps its thread across a browser refresh, because the history lives in Redis rather than in the execution.
Parameters

How do you set the 3 parameters?

The Redis Chat Memory node has 3 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 decides which conversation the node reads and writes. Every stored history hangs off a session, and two runs that share a session share a thread.

Key parameters

  • Session ID: fromInput (Connected Chat Trigger Node) looks for an input field called sessionId coming from a directly connected Chat Trigger, while customKey (Define below) lets you use an expression to reference data in previous nodes or enter static text.
  • Session Key From Previous Node: the field that carries the key when you define it yourself, typically {{ $json.sessionId }}.
Use cases
one session per customer on a support chat, so two customers writing at the same minute never read each other's history.
02

Session Time To Live

sessionTTL

What you see in n8n

Notes & use cases

Here you decide how long Redis keeps the session before dropping it. It is the only parameter that acts after the workflow has finished running.

Key parameters

  • Session Time To Live: a number of seconds, for how long the session should be stored. Set to 0 it will not expire, so the history stays until something else removes it.
Use cases
a sales bot where a thread should reset if the visitor comes back the next day, and an internal assistant where the history is meant to stick around indefinitely. The same node covers both, one number apart.
03

Context Window Length

contextWindowLength

What you see in n8n

Notes & use cases

Stored history and sent history are two different things. This number sets how many past interactions the model actually receives as context on each call.

Key parameters

  • Context Window Length: a number of previous interactions to consider for context, independent of how much Redis holds.
Use cases
a long troubleshooting conversation where only the last few exchanges matter to the answer. Keep the window tight and the model stays focused, since each extra interaction is more text sent to the provider on every single message.
Need help

Need help automating Redis Chat Memory with n8n?

A person reads every message.

FAQ

Questions people ask next

01Is the n8n Redis Chat Memory node free to use?
Yes on the n8n side. The node ships in the n8n AI package, so it is there on n8n Cloud, the hosted offer run by n8n, and on a self-hosted instance under the Community Edition and its Sustainable Use licence. Nothing to install, nothing extra to pay to n8n. What can cost money sits elsewhere: the Redis server you connect to, and the provider of the chat model attached to the same root node, which bills its own API calls under its own terms. The memory node itself never calls a model.
02What do you need for it to work?
Two things. A Redis credential, created once in the Credentials menu of n8n and reusable in every workflow on that instance, and a root node to attach to. This node is a sub-node: it has no main input and never runs on its own, so it only does something once it hangs off the memory port of an AI Agent, an AI Agent Tool, a Chat Memory Manager or a Chat Trigger. There is no authentication selector on the node, so nothing to choose beyond the credential itself.
03What are the limits of the node?
It does one job and exposes 3 parameters at version 2: the session key, how long the session lives, and how many past interactions reach the model. There is no way to read, edit or delete an individual message from the panel. One behaviour surprises people: add more than one Redis Chat Memory node to a workflow and they all reach the same memory instance by default, so a destructive action from another node can wipe what this one stored. Set different session IDs when you want separate memories.
04What do you attach at a minimum, and where do you start?
At a minimum a root node plus a chat model, since memory alone answers nothing. The usual starting shape is an AI Agent with a chat model on its model port and this node on its memory port. Start with Session ID on the Connected Chat Trigger Node option if a Chat Trigger feeds the agent directly, because the session key then comes across on its own. Move to Define below once the conversation starts somewhere else, a ticket or a phone number for instance, and you need to name the key yourself.
05n8n or Make for this kind of AI workflow?
It depends on where you want the data and how you want to pay. n8n can be self-hosted with Docker or npm, which keeps the chat history and the Redis connection on infrastructure you control, and the same workflow also runs on n8n Cloud. Make is hosted only, with no self-hosting option, and bills per operation, which is predictable but grows with volume. Both build visually. If the conversation content is sensitive or the volume is high, the self-hosting question usually settles it.
Hack'celeration Lab

Get our weekly integration tips.

No spam. Unsubscribe anytime.