The gap between a demo and production
Most n8n workflows are built and tested on the happy path: the API answers, the data is clean, the run takes two seconds. Production is where an API times out, a field is empty or the same webhook fires twice. A workflow is production-ready when it behaves sensibly in those cases and tells a person when it cannot.
1. Add an error workflow
n8n lets you set an error workflow, a separate workflow that starts with an Error Trigger node whenever another workflow fails. Use it to send a message to a channel your team actually watches, including the workflow name, the failed node and a link to the execution. Set it on every production workflow. This single step turns silent failures into visible ones.
2. Retry what is transient, and only that
Individual nodes have settings for retrying on failure, with a number of tries and a wait between them. Turn them on for calls to external services that fail occasionally, such as timeouts and rate limits. Do not retry blindly on errors that will never succeed, like a validation failure or a bad credential, or you will just repeat the failure. For rate-limited APIs, add a wait or batch the items.
3. Make steps idempotent
If a step can run twice, it will. A retry, a duplicate webhook delivery or a manual re-run can all repeat work. Protect against double-processing by checking before you write: look up the record by a unique key before creating it, use upsert operations where the target supports them, and store a processed-id marker for events. The goal is that running the same item twice has the same result as running it once.
4. Treat webhooks as a public door
A webhook node has a test URL and a production URL, and the production one only works when the workflow is active. Protect production webhooks with authentication, such as a header secret or basic auth, and validate the payload before acting on it. Respond quickly and do slow work afterwards, so the sender does not time out and retry.
5. Know when to scale and how
A single n8n instance handles a lot, but long or heavy executions can starve everything else. For higher volume, n8n supports a queue mode with a main instance, a Redis queue and separate worker processes, so executions run on workers. Keep execution data pruning on so the database does not grow without limit, and set sensible timeouts on workflows.
6. Monitor and back up
Review failed executions regularly, alert on the error workflow, and keep an eye on instance health if you self-host. Export workflows to version control and back up the database and the encryption key: without the key, stored credentials cannot be decrypted after a restore. These are the unglamorous steps that decide whether an automation survives its first year.