Dynamic Data Table creation via JSON schema input with "Create Column If Not Exists"

The idea is:

Allow users to programmatically create and populate Data Tables on the fly by passing a JSON schema defining columns (name, type, default value). Additionally, include a “Create Column If Not Exists” logic during insert or update operations, so that if a workflow pushes a field that doesn’t match any existing column, the column is automatically created with the specified type and default value. This would enable fully dynamic, self-evolving data structures within n8n workflows.


My use case:

In complex automation scenarios — especially with AI agents — we need to create context-specific data structures during workflow execution. Today, Data Tables must be created manually in the UI, which breaks automation logic when the schema depends on dynamic inputs (API responses, user forms, AI agent outputs).

Concrete example: An AI agent analyzes incoming data and needs to store structured results. The schema varies depending on the source and evolves over time as the agent enriches its outputs with new attributes. Currently, there’s no way to let the workflow itself define, instantiate, or extend a table dynamically.

A JSON input like this would solve it:

[
  { "name": "company_name", "type": "string", "default": "" },
  { "name": "score", "type": "number", "default": 0 },
  { "name": "is_active", "type": "boolean", "default": true },
  { "name": "created_at", "type": "date", "default": "now" }
]


I think it would be beneficial to add this because:

  • Scalability: Workflows that adapt their data structure without manual intervention

  • AI Agent workflows: Agents could self-organize their output storage and evolve the schema as needed

  • Multi-tenant scenarios: One workflow, multiple clients, each with specific data schemas

  • Reduced maintenance: No more manual table or column creation when requirements evolve

  • Schema evolution: With “Create Column If Not Exists”, tables grow organically with your data instead of requiring constant manual updates

Currently, the only workaround is using external databases (Postgres, SQLite) with raw SQL for CREATE TABLE and ALTER TABLE ADD COLUMN. It works, but completely defeats the purpose of having native Data Tables in n8n.


Any resources to support this?

Similar patterns exist in other platforms: Airtable’s API allows dynamic field creation, Notion databases support property creation via API, and most ORMs implement auto-migration features. The CREATE TABLE + ALTER TABLE ADD COLUMN IF NOT EXISTS pattern is a well-established standard in SQL databases that could inspire the implementation for n8n’s native Data Tables.


Are you willing to work on this?

I’d be happy to contribute to the specification and help define the expected behavior, edge cases, and JSON schema format. I work extensively with n8n in production environments with AI agent workflows and multi-client setups, so I can provide real-world feedback throughout the process.

Hey,

I’m also looking for a way to dynamically create datatable structures.

My use case: through a webhook fed by Budibase, I retrieve a list of fields (and other information). The number and names of the fields vary from one execution to another. Then n8n queries a REST API to collect the data and then writes the results to a CSV file. My idea is to create a datatable with a random name, build the structure using the information coming from Budibase, write the query results from the API into the datatable, read the datatable to write it into a CSV file, and then delete the datatable.

Is this planned as a future feature?"

hello @Ocade_Fusion & @flipflip I gave a similar response for some similar request, you can check my response here : N8n DataTables API for Columns Management (Add, Delete, Rename column) - #2 by Adam_Abdelmoumni

I’ve built a workflow template, where I do create n8n table on the go using API specifying the schema : Back up n8n workflows to google drive while preserving folder structure | n8n workflow template

You can specifically look into that part :

1 Like