Persistence
On Start here, your executions were read from a SQLite file. This page explains where n8n keeps its data, and the rules for your code when you add a table or persist data.
Database
n8n supports SQLite and PostgreSQL. SQLite is the default, and all small n8n Cloud instances run on it. Queue mode and large self-hosted setups use PostgreSQL.
Write a database migration shows how to change the schema. The schema docs list every table.
Repositories
Business logic must not import TypeORM. A service must call a repository method with a name that says what the method does, e.g. markFirstAuthenticated. For several writes in one transaction, the service uses TransactionRunner. The root AGENTS.md gives the rules and an example.
Execution data
n8n stores each execution in two tables:
execution_entityholds the metadata that the editor filters on, e.g. the status and the times.execution_dataholds the output of every node. The output is often much larger than the metadata.
n8n can store the output of new executions on the file system, S3, or Azure instead of execution_data.
Pruning deletes old executions in two steps. A system task first marks the executions as deleted, and a later pass removes their rows and output.
Binary data
Files in items (e.g. a PDF that a node downloads) are binary data. An item holds only an ID, and the file goes to the file system, the database, S3, or Azure. In queue mode, the default is the database, because a worker and a main do not share a disk.
Data tables
For questions on this topic, ask Daria
Users can create small tables in a project, called data tables. n8n creates each data table at runtime as a real table in the n8n database, outside the migrations. Only data table nodes can reach these tables.
Quiz
- A service needs a query with
InandIsNull. Where does the query go?Business logic must not import TypeORM. A service must call a named repository method.
- Where does binary data go by default in queue mode?
A worker and a main do not share a disk.