There’s a similar (unresolved) conversation here.
You would normally use row level locking for this kind of thing, but n8n doesn’t (afaik) support that in the postgres or supabase nodes.
You could try to coordinate/serialize updates to the same row using some external mechanism (e.g. $getWorkflowStaticData
), but I think you might still have the concurrency issue with that.
It might be possible to reject or revert conflicting updates within the database using a trigger function.
In a similar situation, on a previous project, because of a similar column-by-column single/separate update behavior from a vendor’s billing software (i.e. no way to fix it), we had to accumulate updates in a separate location (serialized Kafka messages), and only apply them, one by one, in a separate process after a “quiet period” elapsed.
Good luck. It’s a challenging problem. Hope this gave you some ideas.