Two events can arrive carrying the same request. If both checks run before either row is written, both can see a blank result and create duplicates. Assign the logical request a stable ID. Use one protected operation to look up that ID and write the row.
If Google Forms writes to a linked spreadsheet, treat that response destination as raw intake. A separate processed sheet can track one task per request even when you deliberately replay a response. Some systems give each event a stable ID. Stripe's webhook documentation uses stored event IDs to recognize repeat deliveries and notes that some business duplicates require tracking the underlying object and event type.
Define which duplicates are equivalent
A duplicate delivery is the same event arriving again. A duplicate submission can be two different events representing one person's attempt to file the same request. For deliveries, store the source event ID. For submissions, define what one business record means. A request number assigned before sending is often useful. A person's email or name alone can match distinct valid requests.
In Apps Script, use LockService when all writes to the processed table go through cooperating executions of the same script. Acquire the appropriate lock, look for the stable key, write or update the row, and release the lock even if the write fails. If the lock cannot be acquired in time, leave the event marked for follow-up. A user lock can permit two different users to run side by side. It is suitable only if that separation matches the shared resource. An unrelated script or manual writer would require a shared protocol of its own.
Run a test on a copy
Send a request twice with the same ID, then send two distinct requests with the same sender. The processed table should hold one row for the first ID and separate rows for the other two requests. Try overlapping submissions and record request IDs and row counts. Test what happens if the processed row is present and a later email fails.
Write the event ID in the same row as the result, or use a stored key your processor checks on every attempt. A separate success step can fail after the append has already happened. Reconcile the row by key before adding a new one.
Give every copied record a stable key
Try a ticket numbered R-104 in a test folder. Its webhook or form response can be delivered more than once. Store the delivery ID if one is available, and separately keep R-104 as the logical request key. A replay can carry the same delivery ID. A second delivery about the same request may carry a new one. Decide whether that second event contains a valid update, a second attempt to create the same record or a different action about the same request. A single column marked “seen” cannot explain all three outcomes.
Use separate columns for the raw source key, the processed request key and any external record ID. Keep the original request key when you correct a typo in the date or destination name. If the actual business process uses revisions, write the revision next to the request key and have the update check which version already exists. This prevents an older retry from overwriting a later correction. When the notification changes the business state, record its own reference as well.
| Test delivery | Expected processed result |
|---|---|
| Original R-104 arrives and creates a row | One row with the request key and accepted source ID |
| Same delivery ID arrives again | Existing row stays intact and prior processing can be identified |
| New event updates the due date on R-104 | The intended existing row changes under the chosen revision rule |
| Same person opens R-105 | A separate row with its own request key |
Put the lookup and the write under the same control
Two executions can both look for R-104 and see no row. In a log, the entries may look normal individually because each wrote successfully. Hold the lock while you read and write the protected table. Prepare values that do not depend on the table before acquiring it so you can keep the protected section short. Release it promptly, including after an exception. Check that all executions and ingress paths that write that table obey the same choice of lock. A manual edit or separate integration can bypass the script's control.
When the row is written but the script stops before it marks the event complete, recover by looking for R-104 in the processed table. Write the key alongside the content so the next attempt has something to match. If the recipient lets you send an idempotency key, use the same key for that action on retries under its documented conditions. A spreadsheet row and an external email usually involve separate systems. Hold the outbound state separately and make a deliberate decision if the recipient's outcome is unknown. The partial failure example shows a drill for that distinction.
Reconcile with both destinations
Try the overlapping-event test against a copied sheet with two requests that represent the same business submission. Check the result once the executions have finished, then inspect the history to confirm they actually overlapped. If they ran one after the other, rerun the concurrency check in a test setup or record that it remains untested. Allow a locked or rejected action to leave evidence the owner can find. For a held event, decide where it will wait and how to retry it without losing its original key.
Finally, compare raw responses, processed rows and any destination tasks for the test batch. If each system has the expected key but a task was sent twice, focus on the outbound step. If a raw response is present but the processed row is missing, wait for the retry or reconcile that event manually under the same write rule. Keep the acceptance counts and one known failing example so another maintainer can repeat the checks after changing the workflow.
Give the processed table an owner who can recognise an exception. If two legitimate submissions arrive with the same business key and genuinely different data, record the conflict for that person. An automatic choice of whichever arrived last may overwrite a valid record, especially when the events reached the queue out of order.



