Hi everyone,
I’m using PostgreSQL with n8n, and I’m trying to understand the best way to handle multiple workflows updating the same record at the same time.
For example, two webhook executions could try to update the same row simultaneously:UPDATE orders
SET status = ‘processed’
WHERE order_id = 1001;
My concern is avoiding issues like:
Lost updates
Race conditions
Duplicate processing
Inconsistent data
I’ve been reading about row-level locking (FOR UPDATE), optimistic locking, and transactions, but I’m not sure which approach works best in a production n8n environment.
For those running PostgreSQL with high-concurrency workflows:
• Do you rely on transactions alone, or do you also use row-level locks?
• When would you choose optimistic locking over pessimistic locking?
• Have you experienced deadlocks, and how did you handle them?
• Any production tips for keeping data consistent without hurting performance?
I’d love to hear what has worked well for others in real-world n8n deployments.
Describe the problem/error/question
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
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: