In high-volume automation workflows, handling webhooks safely requires solving one critical engineering challenge: At-Least-Once Delivery Semantics. When payment gateways (Stripe, PayPal) or e-commerce platforms (Shopify) experience temporary network latency, they retry webhook dispatches automatically. Without an atomic idempotency guard, Make.com (Integromat) will process the same order twice, double-charging credit cards or generating duplicate CRM records.
In this production tutorial, we architect an unbreakable, sub-millisecond idempotency layer for Make.com using Redis SET NX locks to eliminate race conditions, duplicate executions, and financial discrepancies.
1. The Check-Then-Act Race Condition Trap
The most common mistake automation developers make is using Make.com’s native Data Store with a traditional Check-Then-Act flow:
- The Flaw: If two identical webhook retries arrive within 50 milliseconds of each other, Make.com launches two parallel scenario executions. Both executions query the Data Store simultaneously: both see that the event ID has not been processed yet, and both proceed to execute the downstream payment action.
- The Atomic Solution: Redis solves this using the
SET NX(Set if Not Exists) primitive. Redis is single-threaded and executes the check-and-lock in a single atomic memory operation. The first request acquires the lock; the second request is immediately rejected in less than 2 milliseconds.
2. Redis Atomic Lock Architecture Blueprint
| Scenario Step | Make.com Module | Execution Mechanics |
|---|---|---|
| 1. Webhook Ingestion | Webhooks > Custom Webhook | Extracts unique event ID (e.g. evt_3Nx1... from Stripe or X-Shopify-Webhook-Id). |
| 2. Atomic Lock Acquisition | HTTP > Make a Request | Calls Upstash / Redis REST API: SET lock:webhook:{id} "processing" NX EX 86400. |
| 3. Idempotency Filter | Router / Filter Rule | If Redis returns OK, continue to business logic; if null, terminate execution immediately. |
| 4. Early 200 Response | Webhooks > Webhook Response | Always returns HTTP 200 OK on rejected duplicates so the sender stops retrying. |
3. Configuring the Redis HTTP Module in Make.com
Using Upstash Serverless Redis allows you to execute atomic locks over HTTPS without managing TCP socket connections:
POST https://global-redis.upstash.io/set/webhook:lock:{1.event_id}/acquired?NX&EX=86400
Headers:
Authorization: Bearer YOUR_UPSTASH_REST_TOKEN
Response Evaluation in Make.com Filter:
- First Execution: Redis returns
{"result": "OK"}. The Make.com filter passes, proceeding to charge Stripe, create invoices, or provision SaaS licenses. - Duplicate Retry: Redis returns
{"result": null}because the key already exists. The Make.com filter halts the scenario immediately, consuming only 1 operation credit and avoiding duplicate billing.
Frequently Asked Questions (FAQs)
Why set the Redis TTL to 86,400 seconds (24 hours)?
Major webhook senders (like Stripe and Shopify) retry failed webhooks using exponential backoff over a period of 24 to 72 hours. Setting the lock TTL to at least 24 hours guarantees that delayed network retries cannot slip through the idempotency gate.
Can I use Make.com’s built-in Data Store instead of Redis?
For low-volume scenarios (<50 webhooks/day), a Data Store with a unique key constraint and an error handler is acceptable. However, for high-concurrency production workflows, Make.com's Data Store lacks sub-millisecond atomic isolation, making Redis SET NX the only 100% reliable standard.
Editorial Disclosure: Zelobiz publishes independent engineering benchmarks and architectural evaluations. We may receive affiliate compensation when you subscribe to partner hosting services through our links at no additional cost to you.