Secure credential and API key management in n8n: a production checklist
Store, authorize, rotate, and monitor n8n credentials without exposing API keys in workflows, logs, exports, or Git.

Never place API keys directly in Code nodes, HTTP Request headers, workflow variables, exported JSON, or Git. In production, store authentication data in n8n credentials or an external secret manager; protect n8n's encryption key separately from its database; apply least privilege; isolate development, staging, and production; and maintain tested rotation and revocation procedures.
n8n encrypts credentials before storing them in its database, but that does not eliminate every risk. If an attacker obtains both the database and encryption key, or an over-privileged user sends a secret into execution logs, that protection can be bypassed. Credential security must therefore cover the entire lifecycle, not merely the form used to enter an API key.
Risk
Where do credentials usually leak?
Most incidents arise from how secrets are copied, shared, and logged around a workflow.
Four leak paths
Look beyond the Credentials page
A secret may be encrypted in the database and still leak elsewhere.




