n8n Data Tables: Storage for Workflows and AI Agents
How n8n data tables work: built-in storage for workflow state, deduplication, lookups and AI agent tools, plus their limits and when to use a database.
Executive Summary: n8n data tables give workflows a small, built-in place to keep state without running a separate database. They are ideal for deduplication markers, lookup tables, prompt libraries, evaluation datasets and simple memory for AI agents. They are not a replacement for PostgreSQL: storage is capped per instance, tables are scoped to a project and the Code node cannot query them directly. I explain where data tables fit, how to design them and when to graduate to a real database.
Sooner or later, every automation needs to remember something. Which orders were already processed? Which prompt version is live? Which customer has opted out? For years, the answer in n8n was “use a spreadsheet or spin up a database”, and both answers added friction.
However, data tables, introduced in the second half of 2025, changed that. They give you a structured table inside n8n itself, managed from a Data tables tab and read or written by the Data Table node. For a large share of workflow state problems, that is enough.
This article is a practical guide for teams deciding how much to rely on them. It covers what n8n data tables are good at, the design rules I follow and the limits that should push you to a real database.
What n8n Data Tables Are
In short, an n8n data table is a named table with typed columns that lives inside your n8n instance. You create it in a project’s Data tables tab, either from scratch or by importing a CSV. Workflows then use the Data Table node to insert, read, update, upsert and delete rows.
Meanwhile, the node has two resources. The Table resource creates, lists, updates and deletes tables. The Row resource works with data, and it includes two operations that are especially useful for automation: “If Row Exists” and “If Row Does Not Exist”. These split incoming items based on whether a matching row is already stored, which turns deduplication into a single node. The official data tables guide lists every operation and limitation, and the Data Table node reference details each parameter.
Five Jobs Data Tables Do Well
In my experience, n8n data tables earn their place in five recurring patterns. Each one replaces something that used to need an external tool.
1. Deduplication markers
Webhooks and polling triggers deliver duplicates. Store each processed event ID in a table, check it with “If Row Does Not Exist” before doing any work and insert it afterwards. This is the simplest reliable idempotency pattern available inside n8n, and it fits neatly with the webhook rules I described in the n8n Webhook node guide.
2. Lookup and routing tables
Mappings change more often than workflows should. For example, a table that maps a product line to a Slack channel, or a region to an owner, lets operations staff update routing without editing the workflow. The workflow reads the table, and the logic stays stable.
3. Prompt and message libraries
Prompts deserve versioning. So keep them in a table with a name, a version and the prompt text, and have workflows fetch the active version at run time. As a result, you can change a prompt, compare results and roll back without republishing several workflows.
4. Evaluation datasets
Similarly, AI workflows need test cases: inputs and expected outputs. Storing them in n8n data tables gives you one dataset to rerun after every prompt or model change, which the documentation lists as a core use case.
5. Lightweight agent memory and tools
Finally, AI agents often need facts that outlive a single conversation, such as a customer’s preferences or the status of a task. A Data Table node attached as a tool lets an agent look up or record those facts in a controlled way. This is one reason data tables appear so often in AI agent examples: they give an agent structured, inspectable memory without a vector store or an external database.
Designing a Data Table That Ages Well
Because n8n data tables are easy to create, they are also easy to create badly. A few rules keep them useful months later.
- One purpose per table. A table called “processed_events” stays clean. A table called “misc” becomes a junk drawer.
- A natural key. Decide which column identifies a row, such as an event ID or an email, and use it consistently in upserts and existence checks.
- Explicit types. Store dates as dates and numbers as numbers. Mixed types break filters in subtle ways.
- Timestamps. Add created and updated columns, so you can prune old rows and debug when something changed.
- Retention. Decide how long rows live. Deduplication markers rarely need to be kept forever.
That last point matters because of the storage limit, which I cover below. A deduplication table that grows forever will eventually hit it.
Data Tables vs Variables vs a Real Database
n8n gives you more than one way to store values, and picking the wrong one causes friction later.
| Need | Best fit | Why |
|---|---|---|
| A single config value shared by many workflows | Variables | Readable in expressions, available across projects |
| Rows of structured state for one project | n8n data tables | Built in, typed, easy to inspect and edit |
| Large volumes, joins or reporting | PostgreSQL or another database | Indexes, SQL and proper backups |
| Data shared with other applications | A database or API you own | Other systems should not depend on n8n’s internals |
| Semantic search over documents | A vector store | Similarity search is a different problem |
The last two rows deserve emphasis, though. If another application needs the data, put it in a system that application can own. Data tables are workflow state, not a system of record.
Limits You Should Know Before You Commit
Fortunately, the official documentation is clear about the boundaries. Read them before a table becomes critical.
- Instance-wide storage cap. The total size of all n8n data tables in an instance is limited. On self-hosted instances, you can adjust it with
N8N_DATA_TABLES_MAX_SIZE_BYTES. Near the limit, n8n warns you, and at the limit inserts and updates fail. - Project scope. Each table belongs to one project, and the Data Table node only uses tables from the workflow’s own project. You cannot share a single table across projects.
- No direct Code node access. A Code node cannot query a data table. Read the rows with the Data Table node first, then process them.
- Light to moderate workloads. Data tables are built for workflow state, not analytics or heavy write traffic.
In short, none of these are surprising for a built-in feature. Still, each one is a reason to keep data tables small, purposeful and pruned.
Who Owns a Data Table
Ownership is the question teams forget. A workflow has an owner, but a table often outlives the workflow that created it, and then nobody knows whether it is safe to delete.
For that reason, I treat each table like a tiny service. It gets an owner, a short description of its purpose and a note on which workflows read or write it. n8n does not enforce this, so a naming convention helps. For example, prefix tables with the team or domain, such as billing_processed_events or editorial_prompts.
Access matters as well. By default, every member of a project can see and edit its data tables, and instance owners and admins can see all of them. So do not store secrets or sensitive personal data in a table just because it is convenient. Credentials belong in the credential store, and regulated personal data belongs in a system with proper access control and audit trails. The principles in my guide to secrets management for backend systems apply here too.
Finally, remember that rows can be edited by hand in the Data tables tab. That is a strength for lookup tables that operations staff maintain. However, it is a risk for tables that workflows depend on for correctness, such as deduplication markers. Agree as a team which tables are hand-editable and which are machine-only.
When to Graduate to PostgreSQL
I move state out of n8n data tables when any of the following becomes true:
- The table grows steadily and pruning would lose data people need.
- Someone wants reports, joins or ad hoc SQL queries over it.
- Another service needs to read or write the same data.
- The data is regulated, and you need database-level access control, encryption policies and audit logs.
After that decision, moving is straightforward. Create the table in PostgreSQL, swap the Data Table nodes for Postgres nodes and backfill the rows. If you are designing that schema, my guide to PostgreSQL schema design covers keys, types and partitioning choices that apply here as well.
A Simple Pattern to Start With
If your team has not used n8n data tables yet, start with deduplication. It delivers value on day one and teaches the node’s behaviour.
- Create a table named
processed_eventswith columnsevent_id(string),source(string) andprocessed_at(date). - After your trigger, add a Data Table node with “If Row Does Not Exist”, matching
event_idto{{ $json.eventId }}. - Continue only from the “does not exist” branch.
- At the end of a successful run, insert the event ID with the current timestamp.
- Run a weekly workflow that deletes rows older than your replay window.
Notice that the insert happens at the end, because order matters here. If the run fails halfway, the event is not marked, so a retry can process it. By contrast, if you mark at the start, a failure would silently drop the event.
Frequently Asked Questions
Are n8n data tables available on self-hosted n8n?
Yes. Data tables work on n8n Cloud and self-hosted instances. On self-hosted instances, you can change the storage limit with an environment variable.
Can AI agents use n8n data tables?
Yes. Attach a Data Table node to an AI Agent as a tool, and the agent can look up or store rows. Limit the operations you expose, and prefer read access unless writes are truly needed.
Should I use data tables instead of Google Sheets?
For workflow state, usually yes. Data tables avoid external API calls, rate limits and credential management. Keep Sheets when non-technical colleagues need to collaborate on the data outside n8n.
Small State, Kept Close
n8n data tables solve a narrow problem very well: small, structured state that belongs to a workflow. Use them for markers, lookups, prompts, test cases and agent facts. Keep them pruned and purposeful, and move anything larger or shared into a database you own.
Last updated on 29 November 2026