The Workflow That Sent It Twice: Reconciling Side Effects After a Retry in n8n
说明与用途
在 n8n 中,超时导致重复发送通知。解决方案是生成稳定的对账键,写入待处理账本,重试前检查账本和提供商,并使用幂等键确保单次交付。
问题
A retry timeout caused a provider to accept a second identical notification, sending the same message twice to a customer.
结果
The workflow now guarantees a single notification per business event by reconciling side effects before retrying, preventing duplicate sends caused by provider timeouts.
工作流
- Read row from sheet
- Build message
- Generate stable reconciliation key
- Write pending ledger entry
- Send notification with idempotency key
- If timeout, retry: check ledger for confirmed key
- If not confirmed, query provider by key
- If provider has record, mark ledger confirmed and skip send
- If provider has no record, send notification and record provider ID in ledger
- Assert provider count equals one after send or skip
证据
The workflow reads a row, builds a message, and calls the provider's send endpoint. The provider accepts the message, queues it, and then the connection stalls before the response comes back.
A timeout lives in the gap between accepted and confirmed. Treating a timeout as failure is the mistake.
Derive one stable key from the business event, not from the attempt.
- 记录日期: 2026-11-03T14:28:51.335Z