GTM Engineering term, automation and APIs

Idempotency

Idempotency is the property of an operation that produces the same result whether it runs once or many times, so repeats and retries cause no extra side effects.

Also called: idempotent, idempotency key, idempotent operation

Idempotency sits under every stage: it's part of the data and systems the whole funnel runs on, near related terms like Retry logic, Webhook and Deduplication (the blue squares).

Idempotency means an operation has the same effect whether it runs once or ten times. Updating a contact's title to "VP Sales" is idempotent. Creating a new deal is not, since each run makes another one. In GTM automation, idempotency is what keeps retries and duplicate webhooks from filling your CRM with copies and inflating pipeline.

How it works

Repeats are normal, not rare. Webhook senders deliver at least once, so a timeout on your side means they send again. Retry logic re-runs failed steps. People double-click submit buttons. If any of those paths create records, you get duplicates.

Four patterns make operations safe to repeat:

  1. Upsert on a unique key. Instead of "create contact," use "create or update by email." The second run updates the record the first one made.
  2. Store processed event IDs. Keep a table of event IDs you've handled. On arrival, check the table and skip anything already there.
  3. Idempotency keys. Some APIs, Stripe being the best-known, accept a key header on create requests. Send the same key twice and the second request returns the original result instead of acting again.
  4. Check before you act. Before creating a deal, search for an open deal on that account from the same source in the last 24 hours.

HTTP builds part of this in: GET, PUT and DELETE are idempotent by definition, POST isn't.

Example

Say your closed-won webhook creates an onboarding deal and a kickoff task, and 2% of 5,000 monthly deliveries arrive twice (assumption). That's 100 duplicate deals a month. If each takes 3 minutes to find and merge, cleanup costs 300 minutes, 5 hours a month.

The worse cost is reporting. Picture the same bug in a workflow that creates opportunities from inbound demo requests. If those 100 duplicates averaged $20,000 each, that's $2,000,000 of phantom pipeline in the forecast. Switching create steps to upserts keyed on an external event ID drops duplicates to zero and needs no ongoing cleanup.

Idempotency vs deduplication

Deduplication cleans up duplicates after they exist. Idempotency stops them from being created. You want both: idempotent workflows for new data, and dedupe rules for what slips in from imports and manual entry. Together they protect your golden record.

Idempotency matters most in bidirectional sync, where an update bouncing between two systems can otherwise loop or multiply.

Common mistakes

  • Using "create" actions in workflows that can retry or receive duplicate events.
  • Picking an unstable unique key, like name, instead of email, domain or an external ID.
  • Generating a fresh idempotency key on every retry, which defeats the point.
  • Assuming the iPaaS deduplicates triggers for you without checking.
  • Making side effects like Slack alerts or emails non-idempotent, so reps get pinged twice.

FAQ

What does idempotent mean in an API?

An idempotent API call can be repeated safely. In HTTP, GET, PUT and DELETE are defined as idempotent, while POST is not, which is why some APIs accept an idempotency key header so a repeated POST is recognized and ignored.

Why does idempotency matter for webhooks?

Most webhook senders guarantee at-least-once delivery, so the same event can arrive more than once, especially after timeouts. If your handler isn't idempotent, each duplicate delivery can create another contact, deal or task.

How do you make an automation idempotent?

Use upserts on a stable unique key such as email, domain or an external ID, store the IDs of events you've already processed and skip repeats, and send idempotency keys on create calls where the API supports them.

See all automation and APIs terms ↳

Used in these articles