How are you preventing duplicate actions on workflow retries and 429 Rate Limit errors in production?

Hey everyone,

I’ve been running into two recurring headaches when moving n8n workflows and AI agents into production, and I’m curious how the rest of you are solving them cleanly:

  1. Duplicate side-effects on retries: When a workflow fails mid-execution or a webhook times out and retries, previous steps re-run—leading to duplicate emails via Resend/SendGrid, duplicate invoices in Stripe, or duplicate rows in CRMs.

  2. HTTP 429 Too Many Requests on batch runs: Whenever a workflow processes a batch of items hitting strict APIs like Airtable (5 req/sec) or Notion (3 req/sec), chaining Split In Batches + arbitrary Wait nodes slows down the whole execution and still occasionally fails when parallel webhooks trigger at the same time.

Instead of setting up a dedicated Redis instance and building custom lock/queue logic inside every workflow, I built a lightweight gateway called Flowyl to handle both problems automatically before the request hits the destination API.

What it does:

  • Strict Idempotency (Deduplication): You pass an idempotency key (e.g., invoice:{{ $json.customer_id }}:{{ $today }}). If a retry or agent loop attempts the exact same action within your TTL window (e.g., 24 hours), Flowyl blocks the duplicate execution and immediately returns the cached response from the first successful run.

  • Smart Rate-Limit Pacing: Instead of failing with a 429 or forcing you to hardcode Wait nodes, it paces outbound requests using pre-configured rate limits (Airtable, Notion, HubSpot, Slack, WhatsApp, or custom rules) across all concurrent workflow executions.

  • Privacy-First Lock Mode: If you don’t want to pass raw request payloads through a proxy, you can use the /v1/lock endpoint to simply check the idempotency lock and rate-limit slot before your standard HTTP Request node runs.

How to test it in n8n (takes 30 seconds):

You can test it right now with a standard HTTP Request node (or grab the community node [insert npm package name if published, e.g., n8n-nodes-flowyl]):

JSON

{
  "method": "POST",
  "url": "https://api.flowyl.dev/v1/lock",
  "headers": {
    "Authorization": "Bearer YOUR_API_KEY",
    "X-Flowyl-Key": "welcome_email:{{ $json.user_id }}",
    "X-Flowyl-TTL": "86400",
    "X-Flowyl-Preset": "airtable"
  }
}

  • If status === "proceed", your workflow continues normally.

  • If status === "duplicate", the item has already been processed and you can safely stop that branch.

I put up a free tier for individual builders and self-hosters to test out : Flowyl — Idempotency & Rate Limit Gateway for AI Agents

How are you currently handling idempotency and rate-limiting across concurrent executions in your n8n setups? And if you try Flowyl on one of your fragile workflows, let me know what presets or features would make it more useful for your stack!

For retries, I dedupe before the side effect instead of after. Store a unique key (invoice id, or user id plus date) in a Data Table or a Postgres table with a unique constraint, check it first, and only send the email or create the invoice if the key is new. Stripe also accepts an Idempotency-Key header on POST requests, so you can set one in the HTTP Request node and a retry just returns the original result.

For 429s, the HTTP Request node has Options > Batching, where you set items per batch and a batch interval in ms. That is cleaner than Split In Batches plus Wait nodes. Pair it with Retry On Fail and a few seconds between tries for the occasional spike.

Great discussion. I’ve tested a similar reliability pattern in my n8n + FastAPI + PostgreSQL demo.

With 100 concurrent requests using the same event ID, the test resulted in 1 processed event and 99 duplicate responses. I also verified that reusing the same event ID with a different payload returns HTTP 409.

I agree that database-level uniqueness is important. One additional consideration is handling the failure window where the destination API succeeds but the workflow fails before saving the success result. For external APIs, native idempotency keys can help; otherwise, reconciliation may be needed.

For rate limits, batching and retry-on-failure are useful, but concurrent workflow executions may still need shared rate-limit coordination across workers.

Curious whether Flowyl handles the case where the destination action succeeds but the client times out before receiving the response.

1 Like

A timeout after sending the request leaves things in a gray area — the provider might have completed the action even though the workflow never got a response. I’d leave the attempt in an unknown state and check the provider’s record before retrying with the same idempotency key. That helps avoid duplicates while making sure the invoice or email doesn’t get left unresolved.