n8n webhook triggering twice: prove cause, stop repeats
Diagnose an n8n webhook triggering twice by tracing requests, executions, retries, and side effects, then add idempotency checks to stop duplicate actions safely.
An n8n webhook that seems to trigger twice can involve two HTTP requests, two n8n executions, or one execution that repeats a side effect. Compare requests, execution IDs, payloads, headers, timestamps, and logs before changing anything. Then fix the source and add an idempotency check before any irreversible action.
What you are seeing
First, determine whether the duplicate involves requests, executions, or actions. One business event can produce two visible executions, two emails or records, or two actions inside one execution. These cases differ, so each needs a different fix.
A browser can submit twice after a refresh, double-click, repeated form submission, or client-side code that calls the submit handler twice. An OPTIONS request is usually a CORS preflight, not another business event. Compare its method and payload with the POST request before counting it as a duplicate. A sender may also retry when the first response is slow or unsuccessful, while the original n8n execution continues.
Before changing the workflow, check one controlled event. Count n8n executions, then count downstream actions separately. Two executions with different execution IDs mean two deliveries reached n8n, or infrastructure exposed the request twice. One execution with multiple items may come from a split, loop, merge, or branch. One execution with one incoming item but duplicate emails or records usually means a later node ran twice, branch or merge logic is wrong, or a downstream retry occurred.
Before you start
First, stop tests that could create real effects. Pause production tests that might send another email, charge a customer, create a booking, or write another record. Use a test destination or diagnostic table until you understand the duplicate path.
Save the current workflow and relevant endpoint or proxy settings. This lets you roll back a change. Redact secrets from screenshots and logs. If both test and production endpoints might be configured, identify them before sending another request.
The Webhook node’s response options and interface depend on your n8n version and deployment. Check the current official n8n documentation for your installation before changing response mode, status codes, queue behavior, or proxy settings.
Correlate the request, execution, and side effect
Start by linking one request to one execution and one downstream action. Open the workflow’s Executions view and compare suspicious runs. Record each execution ID, start time, status, item count, and data visible at the Webhook node. Don’t rely on the editor alone; headers, raw payloads, and timestamps help more.
Use this order:
- Choose one business event and count its n8n executions.
- Compare the execution IDs, start times, and incoming item counts.
- Compare the raw payload, event ID, idempotency key, HTTP method, and relevant request headers.
- Check the sender’s delivery or request log for the same time window.
- Check the reverse-proxy or gateway access log, if one is in the request path.
- Count downstream actions separately and inspect the provider’s request log.
For each request, retain the timestamp with timezone, HTTP method, path, response status, response time, request ID, event ID, relevant headers, and a redacted payload. A gateway may add its own request ID. That does not show how many requests the original sender made, so compare every available log.
| Evidence | Likely direction | Next check |
|---|---|---|
| Two requests with different event or request IDs | Sender, browser, or client behavior | Inspect delivery logs and submit behavior |
| Same event ID at close times, with a slow first response | Upstream retry | Check the sender’s response window and response log |
| OPTIONS followed by one POST | Preflight plus one business request | Compare methods and process only the business request |
| Test and Production URLs both receive traffic | Two configured endpoint paths | Check the caller and Webhook node URLs |
| One request in sender and proxy logs, two n8n executions | Infrastructure, registration, platform, or deployment issue | Preserve logs and check current n8n support guidance |
| One execution and two actions | Workflow logic or downstream retry | Inspect branches, loops, merges, and provider logs |
Two n8n executions alone don’t prove an n8n bug. If the sender and proxy each show one request but n8n shows two executions milliseconds apart, stop editing the workflow repeatedly. Preserve the evidence. Similar cases have been reported as possible load-balancer or webhook-registration problems. Check current n8n service information and deployment-specific support channels before applying that explanation to your instance.
Check the Test and Production webhook URLs
First, confirm which endpoint received the event. Check the caller configuration, browser network log, proxy access log, and n8n executions for both paths. The Test URL is for listening while you test. The Production URL is for an active workflow. Labels and exact behavior can vary by n8n version and deployment, so verify the current official documentation for your installation.
If the same event reached both paths, n8n didn’t duplicate one request. Two configured endpoints received traffic. Keep only the intended URL in the caller. Stop the test listener when testing ends. Send one controlled event to Production only after the workflow is ready.
If every log shows one URL but n8n creates two executions, return to the request, proxy, deployment, and platform evidence. Don’t add a delay.
Fix the source, then protect the side effect
Fix the cause shown by the evidence, then protect the action. Make the smallest reversible change. A delay changes timing but doesn’t deduplicate requests. Concurrent executions can still create the same record or send the same message.
- If the sender retried, make the receiver acknowledge within the sender’s documented response window. Check the sender’s current retry rules instead of assuming providers behave alike. Keep processing behind an idempotency check.
- If a browser or form submitted twice, prevent repeat submission while the request is pending and make the server-side event key unique. Disabling a button alone isn’t enough because the server must still reject the same event.
- If both webhook URLs were configured, remove the unintended URL from the caller and test one endpoint at a time.
- If a proxy or gateway is involved, compare its route, retry, and timeout settings with the sender’s request log. Change one setting at a time and keep the previous configuration for rollback.
- If one execution performs the action twice, inspect loops, branches, merges, retries, and child-workflow calls. Add temporary diagnostic data before the action node. Remove or reduce that logging after you know the cause.
Put the idempotency gate before the irreversible action. Use a stable event identifier, such as the provider’s event ID. Store it in a database table with a uniqueness constraint, or another durable store suited to the deployment. Claim the key atomically when the event arrives. If it already exists, return success and stop before creating the record, charging the customer, booking the slot, or sending the notification. This makes repeated delivery harmless.
A payload hash can help when the provider supplies no event ID. It is weaker when two legitimate events can have identical payloads. Prefer a documented event identifier. Include the event type or account scope when the same ID could occur in more than one context. A Google Sheet may suit a small, low-risk build. A transactional database is better for concurrent production requests because the claim must be atomic.
Acknowledge quickly without losing the event
Acknowledge quickly, but don’t rely on acknowledgement alone. For an important event, validate enough to identify it, record or enqueue it durably, acknowledge the request, and process it behind the idempotency gate. This reduces avoidable retries while keeping the event recoverable.
The exact n8n response setup depends on the Webhook node, the Respond to Webhook node, your n8n version, and whether a queue or external worker is in front of the workflow. Check the current documentation for your deployment before changing it. The practical requirement is a quick intended response and a recoverable event before you claim successful receipt.
Don’t return success before durable storage if losing the event would be unacceptable. Also avoid keeping the HTTP request open while a payment API, email provider, or other slow service works. The sender may retry while the original execution continues.
Design acknowledgement and idempotency state together. If you acknowledge first and crash before storing the event, it can be lost. If you mark it processed before the action and crash during that action, a retry can be suppressed even though the action failed. For high-value actions, use durable states such as received, processing, and completed, with a recovery policy for interrupted work. Database and provider documentation for your stack should define the transaction and recovery details.
Test the fix without causing another duplicate
Test with a harmless action before restoring real effects. The expected result is one incoming request, one n8n execution, one idempotency record, and one controlled output. Replaying the same event shouldn’t create another action. A new event ID should process once, so you can distinguish deduplication from rejecting every event.
- Disable or replace real email, payment, booking, ticket, and record-creation nodes with a test destination or diagnostic table.
- Save the current workflow and endpoint or proxy configuration so you can roll back.
- Create one synthetic payload with a clearly marked event ID such as diagnostic-event-001. Don’t reuse a production event ID unless the provider specifically supports safe replay.
- Send it once to the intended Test URL or Production URL, not both. Capture the sender log, proxy log, webhook response, and n8n execution ID.
- Confirm that the response arrives within the sender’s documented window and that the event is durably recorded.
- Replay the exact same payload and headers once. Confirm that a second delivery doesn’t create another action.
- Send a new event ID and confirm that it is processed once. This distinguishes deduplication from rejecting every event.
- Restore the real downstream nodes only after both checks pass. Monitor request counts, execution counts, idempotency conflicts, response times, and downstream results.
If one test request still creates two executions, stop production testing. Compare sender, proxy, and n8n counts again. If the counts are correct but the action is still doubled, trace the node path and the provider’s request log. Keep the test destination in place until both duplicate-delivery and duplicate-action cases are explained.
Conclusion
Start with the logs, not a delay. Identify whether the sender, URL, infrastructure, n8n execution, or workflow path produced the duplicate. Then make the smallest reversible fix and keep an atomic idempotency check before every irreversible action.
Frequently Asked Questions
Can a slow n8n webhook response cause the sender to send the request twice?
Yes. A sender may retry when acknowledgement is slow or unsuccessful, even while the first n8n execution continues. Check the provider’s current retry rules and response logs. Then acknowledge after durable receipt and use the event ID to prevent repeated processing.
Should I add a delay node to stop an n8n webhook duplicate?
No. A delay changes timing but doesn’t deduplicate. Two requests can still pass through, and concurrent executions can race before either finishes. Store a stable idempotency key with an atomic uniqueness check before the irreversible action. Then investigate the sender, URL, proxy, or workflow path.
How do I know whether Test and Production webhook URLs caused the duplicate?
Check the caller configuration, browser network log, proxy access log, and n8n executions for both paths. If one event reached both URLs, two configured endpoints received traffic. Keep only the intended URL, then repeat a controlled test.