Skip to content

Find your next step.

Explore the studio

    Let’s talk
    Automation & CRM

    How should you prevent duplicate records or payments when automation retries?

    Specify durable transaction identities, safe retry boundaries and reconciliation checks before approving an integration that creates records or collects payments.

    Three blue and cyan paths carry matching diamond-marked tokens into a central gate. One output leads to a circular disc, while a coral loop passes through a small checkmarked checkpoint below.
    Illustrative visual created for this guide.

    Start with one business action, not one workflow run

    To prevent duplicate automation actions, give each intended business action one durable identity, preserve it during retries and reconcile uncertain outcomes before creating replacements. Require your supplier to demonstrate this after failures, not just during successful runs. Otherwise, a lost response can become a second charge, CRM record or customer message.

    Idempotency means repeating an operation has the same intended effect as doing it once. Waiting longer between retries controls traffic; it does not establish whether the first request succeeded. The controls below are recommended design requirements, not a promise of whole-workflow exactly-once execution. Provider protections apply only within their documented boundaries.

    Specify four identifiers and define a duplicate

    Four identities your supplier should distinguish
    IdentifierPurposeRecovery requirement
    Business action IDIdentifies one authorised effect, such as collecting invoice 1042, revision 3Survives restarts and manual replay
    Provider idempotency keyProtects one supported provider operationPersist before sending; reuse for that operation
    Provider object or transaction IDIdentifies the downstream payment or recordStore when known; use for retrieval
    Delivery or attempt IDIdentifies an event delivery or execution attemptRetain for audit, not as business identity

    Include the business or tenant, live/test environment, action type and source-record revision in the identity rules. A revised invoice or new instalment needs explicit authorisation, not an automatically refreshed key. Store a request fingerprint—a comparison value representing the original inputs—and reject changed inputs under the same identity. Names and email addresses alone are unsuitable duplicate keys.

    Overhead illustration on a textured navy surface: a large blue folder with an embossed diamond-in-circle seal and a small coral tab sits beside a cyan metal key-shaped tag and a punched blue card. Fine branching lines connect the folder to three cream slips bearing matching seals and different edge
    Illustrative visual created for this guide. One business action can have several attempts without becoming several authorised actions.

    Require a durable action ledger, not search then create

    Two workers can both search, find nothing and create duplicates. Require an atomic uniqueness rule: only one worker can reserve an action identity. Yet local locking cannot solve every failure. A provider may complete the operation before your worker crashes without saving the result. That gap requires provider-supported idempotency and reconciliation.

    • Persist authorised inputs, source revision and operation keys before sending.
    • Record provider IDs, timestamps, attempts, errors and recovery evidence.
    • Distinguish pending, in progress, succeeded, unknown outcome and manual review.
    • Where feasible, save the outgoing job with the local business decision.
    • Keep separate completion states for payment, CRM updates and reporting.

    For webhooks, verify signatures, durably record or queue valid events, then acknowledge promptly. Stripe documents repeated deliveries and unordered events. Deduplicate event IDs, but also protect the business action: distinct events can concern the same object and event type. An older notification must not overwrite newer state blindly; retrieve current provider state when necessary. [3]

    Agree when to retry, reconcile or stop

    Recovery decisions to agree before development
    SituationRequired response
    Timeout or lost connectionMark uncertain; reuse the persisted key and unchanged request within the supported window.
    Validation errorStop repeated attempts; approve corrected inputs deliberately.
    Authentication or permission failureRepair access without creating a replacement business action.
    Rate limitUse bounded backoff with random delay; preserve identity.
    Server errorFollow provider-specific rules; do not assume nothing happened.
    Retry window expiresStop automatic mutation and reconcile the original outcome.
    Reporting fails after paymentRetry reporting alone, not payment.

    Stripe API v1 retains executed responses against an idempotency key, including 500 errors. Reusing a retained key with changed parameters produces an error. Keys may be removed after at least 24 hours. Its network-error guidance supports same-key, unchanged-request retries within the first 24 hours, then reconciliation if unresolved. A fresh key is not a safe workaround for uncertainty. [1][2]

    Name one owner of the overall retry budget. Queue, workflow and software-library retries must not multiply unnoticed. Bounded retries may delay completion or require operator review, but that is preferable to silently commissioning another financial action. A cached server error needs investigation because it can accompany downstream side effects. [2]

    Work through a payment timeout and failed report update

    1. Reserve the invoice collection identity. Save the original inputs and PaymentIntent create key before sending.
    2. Lose the create response after Stripe commits. Retry the identical request with its saved key within the supported window; recover the saved response. [1]
    3. Store the PaymentIntent ID. If confirmation times out, retrieve that object and inspect its actual state. Keep a separate persisted key for any authorised confirmation operation. [5][6]
    4. Accept verified payment notifications durably. Suppress duplicate deliveries and prevent repeated notifications from scheduling another collection. [3]
    5. Allocate one stable reporting row. If its fixed-range update times out, resend the same values to that range. Never restart payment to repair reporting.

    Creating a PaymentIntent does not establish payment success. Confirmation can require customer action, fail, succeed or await capture. Recovery must follow that state, not a browser error or successful create response. Reporting remains a separate action, so its failure cannot reopen the collection step. [4][5]

    A blue disc with a white check mark sits in a navy tray with a cyan front tab. A blue arrow points toward a separate navy board with five recessed horizontal slots. One cyan tile occupies the top slot, while another floats above it between coral arrows pointing up and down.
    Illustrative visual created for this guide. Repair the report independently; a reporting failure must not restart the payment.

    Check provider limits and migration behaviour

    Sheets v4 append documents neither an idempotency-key parameter nor business-key uniqueness. Fixed-range updates can make repeated writes predictable, but require stable row allocation, suitable permissions and a business-ID check before overwriting. Protect the reporting tab against row movement; use a separate view for sorting. This costs flexibility compared with an openly editable sheet. Sheets v3 was retired in 2021. [9][10][11][14]

    During webhook migrations, old and new destinations can overlap. Share business-action deduplication across both handlers rather than giving each a separate memory of completed work. Stripe’s migration guidance treats event versions separately from server-library versions, so test delivery and recovery behaviour throughout the overlap. [12]

    Reconcile payments, local actions and reporting separately

    • Missing: a successful provider payment has no completed local action.
    • Unexpected: a payment has no authorised business action.
    • Repeated: multiple successful objects map to one intended collection.
    • Mismatched: amount, currency, revision or provider identity differs.
    • Stuck: an uncertain action exceeds its agreed review deadline.
    • Reporting drift: the report disagrees with the action ledger.

    Agree a review cadence, named exception owner and evidence trail covering findings and decisions. High-risk unknown payments may need immediate attention rather than waiting for a daily report. PaymentIntent-state reconciliation establishes payment-object status; it is not a complete payout or bank-settlement reconciliation process. Those checks need their own scope. [6]

    Make failure demonstrations part of supplier sign-off

    • Send concurrent duplicates; show one authorised effect.
    • Lose a response after commitment, then crash before saving the provider ID; recover the original object.
    • Deliver duplicate and out-of-order webhooks; preserve correct current state.
    • Return a cached 500; show investigation rather than a fresh-key replacement.
    • Replay beyond the safe window; stop mutation and open reconciliation.
    • Change parameters under an existing identity; reject or escalate the conflict.
    • Fail reporting after payment; repair only the report.
    • Exercise manual replay and overlapping migration handlers; retain shared deduplication.
    Does clicking “run again” create a new action?

    It should normally replay the existing action. Require explicit authorisation to commission a genuinely new collection or record.

    Is searching before creating enough?

    No. Concurrent workers can both find nothing. Require atomic uniqueness plus provider-supported recovery for failures after downstream success.

    What evidence should the supplier provide?

    Ask for action IDs, attempt histories, provider-object references, final states and reconciliation decisions for every failure demonstration.

    Before approving the build, attach these identity rules, retry decisions and tests to your brief. Use API and system integration planning to agree recovery boundaries, alongside business workflow automation planning for responsibilities and handover. Approve demonstrated recovery—not a general assurance that retries are enabled.

    Sources & further reading

    Use the original guidance when checking details or planning implementation.

    1. Stripe: Idempotent requests ↗
    2. Stripe: Advanced error handling ↗
    3. Stripe: Webhooks ↗
    4. Stripe: Create a PaymentIntent ↗
    5. Stripe: Confirm a PaymentIntent ↗
    6. Stripe: Retrieve a PaymentIntent ↗
    7. Stripe: API versioning ↗
    8. Stripe: PaymentIntents integration guidance ↗
    9. Google Sheets v4: Append values ↗
    10. Google Sheets v4: Get values ↗
    11. Google Sheets: Migration from retired v3 ↗
    12. Stripe: API and event-version upgrades ↗
    13. Stripe: Restricted API keys ↗
    14. Google Sheets API v4 reference ↗

    This research-assisted guide uses the primary sources linked above. Examples are illustrative unless explicitly identified otherwise. Check original documentation when implementing changes.

    ABOUT THE AUTHOR

    Softglimmer Editorial

    Practical guides from Softglimmer Services on websites, software and connected customer journeys. Research-assisted articles explain their sources and include useful examples.

    KEEP THE IDEAS MOVING

    More on Automation & CRM.

    IDEAS INTO ACTION

    Discuss your website or workflow.

    Tell us what you want to improve and what you already use. We’ll reply within one business day to discuss the next step.

    Discuss your project