I’m trying to export / import workflows through several environments (dev to prod°),
Actually, I’m clicking on the
Download button in the UI to commit this file in my git repository.
Then, I deploy these files and use the CLI to import these files through a
n8n import:workflow --separate --input my-directory-of-workflows.
After a first successful deployment, I have an error related to an index :
Importing workflows... An error occurred while exporting workflows. See log messages for details. duplicate key value violates unique constraint "IDX_a252c527c4c89237221fe2c0ab"
I understand there is unicity constraint on the
name workflow column.
I try to remove this index to see if it could help me. (this is not a good idea, but that was for testing purpose)
The import works, but now, it seems that ids are not kept during import.
This is bad for me as I’m losing relations between workflows, like the error workflow, or when I start some workflows from other workflows.
This also make duplicates each time I try to deploy workflow updates. Instead of updating workflows.
I try to update json files by making the id a number instead of a string, but this doesn’t help.
As the json workflow have an id, I would expect the import override the previous workflow with the same id, am I wrong ? Even if there is the same
name, I think this is “normal” as the workflow could keep, or update its name ?
If I read CLI commands for n8n | Docs, I understand there is a worfklow override, and that’s what I am expecting ? Is this correct ?
I find also a mistake (I think) in the table
webhook_entity, the column
workflowId is not related with a foreign key to the
workflow_entity table, maybe this could be useful ?
This should protect deletion from the
workflow_entity table if there is a
Thanks for replies