Hi everyone,
I’m running production workflows in n8n where reliability matters more than throughput, and I’m struggling with exactly-once execution guarantees.
Problem Scenario
The workflow:
Consumes data from an API (or webhook)
Transforms it
Triggers side effects (DB writes, webhooks, emails, 3rd-party updates)
Constraints:
Queue mode with multiple workers
Automatic retries on failure
External APIs occasionally timeout or return 5xx
n8n restarts or worker crashes can happen mid-execution
Observed Issues
A node times out, workflow retries
Side effects from the previous attempt already happened
Downstream systems receive duplicate updates
Continue On Fail avoids crashes but not duplicate effects
There’s no built-in exactly-once semantic
Describe the problem/error/question
How do you design workflows that guarantee exactly-once side effects?
Where do you place idempotency keys in workflow?
Do you rely on DB constraints, external state, or orchestration patterns?
Are sub-workflows or external queues the only safe solution?
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
return items.map(item => ({
json: {
userId: item.json.id,
payloadHash: createHash(item.json)
}
}));INSERT INTO audit_log(user_id, payload_hash)
VALUES (:userId, :payloadHash);
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system: