Desk Trials

GUIDE / Automation & agents

Prevent duplicate records before an automation goes live

A stable business key, an idempotency record, and a conflict path are safer than hoping repeated events never arrive.

Documentation-based practical guide

Documentation-based proposal; not a hands-on test

One intent, one recorded outcome
  1. Receive source event
  2. Reserve business-operation key
  3. Perform the side effect
  4. Record destination ID and result

An existing key returns the recorded result or waits for reconciliation. Different material fields under the same key require review.

Original editorial process diagram · proposed workflow, not a product screenshot

Treat delivery and business intent as different things

An automation may receive the same event more than once because a sender retries, a connection drops after the destination committed, or a person presses the button again. The transport event can be duplicated even when the business intent is singular: create one invoice, one task, or one welcome message.

Stripe's API documentation describes the core pattern: a client sends an idempotency key, and later requests with that key receive the saved result rather than performing the operation again. AWS Powertools documents a similar pattern with a persisted record whose status can be in progress, complete, or expired. Both sources also expose the limitation: the key and its retention window have to represent the business operation correctly.

Choose a key from the event's identity

Prefer an immutable source event ID supplied by the originating system. If none exists, construct a business key from fields that should uniquely identify the action, such as order_id + action_type. Do not use an email address or other sensitive value as a key when a random or opaque identifier will do. Do not use a timestamp alone; two deliveries of the same event will usually have different receipt times.

SituationPossible keyConflict check
Create task from formform submission ID + task typeSame key but changed assignee
Send invoiceinvoice ID + send operationSame key but changed recipient or amount
Sync contactsource system + source record IDRecord version newer than stored version

A content hash can help detect repeated payloads, but it is not always a business identity. Two legitimate orders can have identical fields. Conversely, a repeat delivery can contain a harmless metadata change. Make the rule explicit.

Reserve before the side effect

  1. Receive the event and validate required fields.
  2. Attempt to create an idempotency record with a uniqueness constraint.
  3. If the record is new, mark it in progress and perform the side effect.
  4. Store the destination record ID and final status.
  5. If the key already exists, return or reuse the recorded result instead of creating another output.

The reservation closes the race where two workers check, both see nothing, and both create a record. AWS's documentation describes locking concurrent identical requests while one invocation is in progress. If your no-code platform cannot reserve atomically, put the uniqueness constraint in the destination or route creates through a small service that can.

Do not silently merge conflicting intent

If the same key arrives with materially different fields, stop and flag it. Stripe says it compares incoming parameters with the original request to prevent accidental key reuse. For a business workflow, store a compact payload fingerprint or the important fields beside the key. A changed amount, recipient, project, or action type belongs in an exception queue, not under an old success result.

Set retention from the replay horizon and business risk. Expiring a key too soon permits an old event to create a new side effect; retaining every key forever adds storage and privacy burden. Document the window and test a replay just inside and just outside it. Pair this guide with bounded retries and an exception queue and a stop switch. Duplicate prevention is complete only when the destination record can be traced back to the source key.

Before you hand it over

Use this as a working check, not certification. Checks stay in this page only and reset on reload.

0 of 5 checked

Sources & verification

Product details are based on the linked documentation. The proposed workflow and worked examples are editorial guidance, not measured test results.

  1. Idempotent requestsSource date: not stated · Retrieved: 2026-09-19T19:39:00Z

    Idempotency keys allow safe retries, return a saved result, and should reject reuse with changed parameters.

  2. Idempotency - Powertools for AWS Lambda (Python)Source date: not stated · Retrieved: 2026-09-19T19:39:00Z

    Persisted idempotency records, in-progress locking, expiry, payload validation, and repeated-result behavior.

Continue the workflow

  1. Separate retryable failures from work that needs a person

    Keep an automation from hammering a failing service or losing records that cannot complete automatically.

  2. Design approval gates that reviewers can actually use

    Add human review to a consequential workflow without creating blind approvals or permanently stuck runs.

  3. Release an automation change like a small software change

    Change a live automation without discovering mapping or logic errors across the entire workload at once.

  4. Design the stop switch before the automation

    A workflow that can fail quietly needs a recovery plan on the same page as the trigger.