Hi all, looking for guidance on two recurring issues when we promote workflows from our Dev n8n to Prod:
- Credentials and environment variables not picked up in Prod
-
After importing a workflow from Dev to Prod, nodes often show missing credentials or resolve env vars to null until we manually intervene.
-
We do have the corresponding credentials and env variables configured in Prod (names/keys are the same), but the workflow still doesn’t bind automatically.
-
It looks like credential IDs differ between environments and the imported workflow may be referencing IDs from Dev.
-
Question: What’s the recommended way to promote workflows so credentials are matched by name/type (not ID), and env vars are resolved immediately without manual edits? Any best practices or tooling to strip credential IDs on export/import?
- Folders get misplaced in Prod
-
Some workflows land in the wrong folders (or root) after import to Prod, even though we didn’t change folder structure explicitly in the workflow export.
-
I suspect folder IDs differ between Dev and Prod, so the import falls back or creates duplicates.
-
Question: Is there a supported approach to map/migrate folder placement by folder name/path rather than folderId? Any recommended pipeline or API pattern to ensure the target folder exists and the workflow is moved there on import?
Environment and process
-
We export workflows from Dev and import into Prod (no shared DB).
-
Credentials and env vars exist in both environments (but IDs obviously differ).
-
We’d like a zero-manual-intervention promotion (CI-friendly) that:
-
Ensures required credentials exist in Prod (by name/type) and binds automatically
-
Resolves env vars immediately
-
Places workflows into the intended folder path reliably
What we’ve tried/considering
-
Stripping credential IDs from workflow JSON and leaving only name/type (so Prod can bind to the existing credential by name)
-
Using env vars in node parameters instead of credentials where possible
-
Pre-creating folders in Prod and mapping by name before import
-
A bootstrap script that upserts credentials/folders by name before importing workflows
Questions to the community
-
Is there an official or recommended way to:
-
Promote workflows with name-based credential mapping (not ID)?
-
Map folders by name/path during import (or move after import) using the API?
-
Validate that required credentials and env vars exist in Prod before import, and fail early if they don’t?
-
If you have a working Dev → Prod pipeline, could you share your steps or scripts (n8n API endpoints, CLI usage, do’s/don’ts)?
-
Any common pitfalls (e.g., OAuth tokens per environment, required restarts to load env changes) we should account for?
Thanks in advance!