---
description: Understand the n8n database structure
contentType: explanation
---

# Database structure

This page describes the purpose of each table in the n8n database.

## Database and query technology

By default, n8n uses SQLite as the database. If you are using another database the structure will be similar, but the data-types may be different depending on the database.

n8n uses [TypeORM](https://github.com/typeorm/typeorm) for queries and migrations.

To inspect the n8n database, you can use [DBeaver](https://dbeaver.io), which is an open-source universal database tool.

## Tables

These are the tables n8n creates during setup.
<!-- vale off -->
### auth_identity

Stores details of external authentication providers when using [SAML](/user-management/saml/index.md).

### auth_provider_sync_history

Stores the history of a SAML connection.

### credentials_entity

Stores the [credentials](/glossary.md#credential-n8n) used to authenticate with integrations.

### event_destinations

Contains the destination configurations for [Log streaming](/log-streaming.md).

### execution_data

Contains the workflow at time of running, and the execution data.

### execution_entity

Stores all saved workflow executions. Workflow settings can affect which executions n8n saves.

### execution_metadata

Stores [Custom executions data](/workflows/executions/custom-executions-data.md).

### installed_nodes

Lists the [community nodes](/integrations/community-nodes/installation/index.md) installed in your n8n instance.

### installed_packages

Details of npm community nodes packages installed in your n8n instance. [installed_nodes](#installed_nodes) lists each individual node. `installed_packages` lists npm packages, which may contain more than one node.

### migrations

A log of all database migrations. Read more about [Migrations](https://typeorm.io/docs/advanced-topics/migrations/) in TypeORM's documentation.

### project

Lists the [projects](/user-management/rbac/projects.md) in your instance.

### project_relation

Describes the relationship between a user and a [project](/user-management/rbac/projects.md), including the user's [role type](/user-management/rbac/role-types.md).

### role

Not currently used. For use in future work on custom roles. 

### settings

Records custom instance settings. These are settings that you can't control using environment variables. They include:

* Whether the instance owner is set up
* Whether the user chose to skip owner and user management setup
* Whether certain types of authentication, including SAML and LDAP, are on
* License key

### shared_credentials

Maps credentials to users.

### shared_workflow

Maps workflows to users.

### tag_entity

All workflow tags created in the n8n instance. This table lists the tags. [workflows_tags](#workflows_tags) records which workflows have which tags.

### user

Contains user data.

### variables

Store [variables](/code/variables.md).

### webhook_entity

Records the active webhooks in your n8n instance's workflows. This isn't just webhooks uses in the Webhook node. It includes all active webhooks used by any trigger node.

### workflow_entity

Your n8n instance's saved workflows.

### workflow_history

Store previous versions of workflows.

### workflow_statistics

Counts workflow IDs and their status.

### workflows_tags

Maps tags to workflows. [tag_entity](#tag_entity) contains tag details.

## Entity Relationship Diagram (ERD)

!["n8n ERD"](/_images/hosting/architecture/n8n-database-diagram.png)

<!-- vale on -->
