I’m working with two separate Zapier workflows. The first one ends with a Code by Zapier step where I process data from earlier steps and create an array like this:
var items = [{recordId: 45, processedData: 28},{recordId: 67, processedData: 'blue'}]
I loop through this array to build request configurations:
var baseConfig = {
"url": "https://hooks.zapier.com/hooks/catch/yyyyyy/yyyyyy/",
"method": "POST"
},
apiCalls = items.map(buildRequestConfig);
function buildRequestConfig(item) {
var config = Object.assign({}, baseConfig);
config.data = JSON.stringify(item);
return config;
};
The code runs without errors and shows successful responses in the output. However, my webhook (second Zap) never gets triggered by these POST requests. The webhook URL is definitely correct because I tested it manually.
Why might the webhook not be receiving these requests? What changes do I need to make to ensure the webhook gets activated properly?
zapier webhooks can be tricky with timing issues sometimes. ive seen cases where rapid fire requests from promise.all get throttled or dropped. try adding a small delay between requests using settimeout - maybe 100-200ms between each call. also worth checking if your webhook zap has any built-in filters that might be rejecting the payloads silently.
Content-Type header is likely the culprit here. I ran into this exact issue about six months ago when sending JSON data to Zapier webhooks from custom code. The problem is that you’re stringifying your data but not telling Zapier what format it’s in. Add the Content-Type header to your base configuration: javascript var baseConfig = { "url": "https://hooks.zapier.com/hooks/catch/yyyyyy/yyyyyy/", "method": "POST", "headers": { "Content-Type": "application/json" } }; Without this header, Zapier might not parse your JSON payload correctly and could silently ignore the webhook trigger. I spent hours debugging the same issue until I realized the webhook was receiving the requests but couldn’t process them properly due to the missing content type declaration. Also double-check that your webhook zap is published and active - caught myself with a draft zap more than once.
Check if you’re sending the data in the request body correctly. I had a similar problem last year where my webhook wasn’t triggering despite getting successful responses. The issue was with how I was passing the data property in the fetch configuration. Try modifying your base config to use ‘body’ instead of ‘data’ since that’s what the Fetch API expects:
function buildRequestConfig(item) {
var config = Object.assign({}, baseConfig);
config.body = JSON.stringify(item);
return config;
};
The Fetch API uses ‘body’ for the request payload, not ‘data’. When you use ‘data’, the payload might not be sent properly even though the request appears successful. I discovered this by checking the actual request in browser dev tools and noticed the body was empty. Once I switched to using ‘body’, my Zapier webhook started receiving the data immediately. Also verify that your second zap isn’t filtering out the incoming data somehow - check the webhook history in your Zapier dashboard to see if requests are actually arriving.