Hi n8n community,
I’m working on a GitOps setup for n8n, where workflows are managed in a Git repository and automatically loaded into n8n. Currently, n8n loads workflows based on their IDs, but I’d like to configure it so workflows are loaded by their names instead. This would make version control and collaboration easier, as names are more descriptive and stable than IDs.
Could you please provide guidance or best practices for:
-
Configuring n8n to read workflows from Git by name (not ID)
-
Any required settings, plugins, or scripts
-
How to handle workflow updates and synchronization
-
Potential pitfalls or limitations
Here’s some context about my environment:
-
n8n is deployed via Helm with GitOps (see values-dev.yaml for config)
-
Workflows are stored in a folder in the Git repo (e.g., n8n-workflows)
-
Using n8n’s source control features
Any advice, examples, or documentation links would be greatly appreciated!
Hi @akshika.sharma have you tried using the CLI command n8n import:workflow --separate --input=n8n-workflows/ to import workflows while preserving their IDs across environments.
not really , How will that help me using the pull and push GitOps operation between multiple n8n instances?
@akshika.sharma because n8n git based source control already syncs workflows between instances via push/pull, you rely on n8n built in push/pull between branches/instances for gitOps not on name based resolution.
Read these again:
I don’t see any input in the docs which tells how to automate the syncing of the sub workflow exceution while moving between envs.
@akshika.sharma you can try to link each n8n instance to a git branch and use the native push/pull mechanism, as current n8n does not support name based workflow resolution.
classic IDs-vs-names problem with n8n gitops. the most reliable approach i found: use workflow names as single source of truth and resolve the ID dynamically via an API call (GET /api/v1/workflows?name=MyWorkflow). then pull the ID from the response into the Execute Workflow node instead of hardcoding it. side benefit: your git diffs become way more readable because no IDs are changing between environments.