By Orch8 Engineering · Editorial policy
Google Sheets Automation Concurrent Updates
Route updates to the same spreadsheet record through one writer or a serialization mechanism keyed by record ID. Sending several operations in a Sheets batch can make one request atomic. It does not coordinate two writers that made decisions from the same earlier read.
What is the practical answer?
Route updates to the same spreadsheet record through one writer or a serialization mechanism keyed by record ID. Sending several operations in a Sheets batch can make one request atomic. It does not coordinate two writers that made decisions from the same earlier read. Give two workflows a row containing status=new and touch_count=2. A reply handler reads the row and prepares status=replied. A reminder handler reads the same original row and prepares touch_count=3. If each sends a full row snapshot, the last write may restore the old status or counter. Both API calls can report success while one business change disappears. Writing just the column a handler owns reduces accidental overwrites when fields are independent. It does not fix two updates to an overlapping field or a calculation that depends on the earlier state.
Evidence: Google Sheets batch request behavior · Reddit spreadsheet concurrency discussion
- Two writers read one rowInput
- Serialize by record IDDecision
- Merge owned fieldsProcess
- Write updated rowExternal action
Reproduce the race on one contact#
Writing just the column a handler owns reduces accidental overwrites when fields are independent. It does not fix two updates to an overlapping field or a calculation that depends on the earlier state. Avoid using row number as an immutable customer ID because sorting or inserting rows changes the position. Resolve the row using a durable identifier and decide whose value wins before dispatch.
| What you find | What to do |
|---|---|
| Independent fields and stable row routing | make each write narrow. |
| Two updates derive from the same earlier value | serialize the read-modify-write sequence. |
| Many independent writers need history | make the database authoritative and project to Sheets. |
Choose where to coordinate writes#
For a small integration, a single writer queue is easy to understand. A per-record queue lets different contacts progress independently, at the cost of more coordination. If several services require independent writes and audit history, keep the authoritative row in a database and publish Sheets as a projection. Protect the spreadsheet from edits that would bypass the ownership rules.
Choose a writer based on contention#
On a small sheet with one reply reader and one reminder job, send both updates through a shared writer keyed by contact_id. If workers only touch independent columns, narrow writes reduce contention and preserve edits. For a retryable counter, send a unique increment intent instead of a freshly computed absolute value based on stale state.
With a database as source of truth, update the operational row transactionally and emit a projection task containing the record ID and version. Make the Sheets writer skip a projection older than the version already written. Spreadsheet users can still edit explicitly owned columns, but those edits need an input path with validation so they do not silently bypass authority and version rules.
Verify it with a failure drill#
Pause two staging writers after they read the same row, then release both writes.
- Run the test again with serialized writes and verify both the replied status and incremented counter survive. Repeat after sorting the sheet to confirm ID lookup beats row position.
Sources and further reading
Official references support technical claims; community discussions are used only as problem signals.