Hi everyone,
I’m building an n8n workflow where a Shopify product update webhook triggers an OpenAI API call to auto-categorize products.
Current Architecture
Workflow A (single workflow):
Shopify Webhook (products/update)
→ Code node (clean product data)
→ HTTP Request (OpenAI Chat Completions API)
The OpenAI call works correctly in isolation.
However, in production, I’m consistently hitting:
AxiosError: Request failed with status code 429
OpenAI returns:
Try spacing your requests out using the batching settings under ‘Options’
What I’ve Observed
Even when I update a single product once, Shopify appears to fire multiple webhooks.
This results in:
-
Multiple parallel executions of the workflow
-
Multiple HTTP calls to OpenAI
-
Burst traffic → 429 rate limit
Batching inside the HTTP node does not help because:
Adding a Wait node (time delay) also does not prevent parallel executions.
What I’ve Already Tried
Inside the HTTP Request node:
Despite this, I still get 429 errors.
How do I avoid getting the 429 errors?
Hey @chaitanya_maheshwari , welcome to the community.
So yeah, this is a super common issue with Shopify webhooks — you’re not doing anything wrong. Here’s what’s actually happening:
When you update a single product, Shopify doesn’t just fire one webhook. It fires like 3-5 of them because internally it saves the product, then the inventory, then variants, etc. Each save triggers another products/update event. Annoying, I know.
And since each webhook creates its own execution in n8n, your OpenAI calls all hit at the same time and boom — 429 rate limit.
Here’s the easy fix — three small changes:
1. Add a Code node right after your webhook to kill the duplicates
Just paste this in:
JavaScript
const productId = $input.first().json.body.id;
const updatedAt = $input.first().json.body.updated_at;
const key = `${productId}_${updatedAt}`;
const staticData = $getWorkflowStaticData('global');
if (!staticData.seen) staticData.seen = {};
const now = Date.now();
for (const k in staticData.seen) {
if (now - staticData.seen[k] > 60000) delete staticData.seen[k];
}
if (staticData.seen[key]) return [];
staticData.seen[key] = now;
return $input.all();
What this does is — if Shopify sends the same update 5 times, only the first one actually goes through. The rest just stop right there. Simple.
2. Add a Wait node (3 seconds) before your OpenAI call
Just gives it a little breathing room. Nothing fancy.
3. Set your workflow concurrency to 1
Click the gear icon in your workflow → set concurrency to 1. This makes sure even if multiple webhooks come in, they line up and run one at a time instead of all at once.
1 Like