I’m trying to respond to incoming webhooks with a proper HTTP 200 status and an ‘OK’ message body using Zapier code. My current approach involves creating a server instance but it’s not working as expected.
Error: You did not define `output`! Try `output = {id: 1, hello: "world"};`
The webhook response isn’t functioning correctly. Is there a way to properly handle HTTP responses in Zapier code, or do I need a different approach for sending status codes and response bodies back to the webhook caller?
yeah, zapier code is diffrent, you can’t run express like usual. just make sure you’re returning the correct output object - that’s the way to go for the webhook responses.
Everyone’s right - Zapier doesn’t support Express servers. You’re fighting a losing battle with their limitations.
I hit this same wall a few months ago with complex webhook processing. Zapier’s environment is way too restrictive. No persistent servers, clunky response handling, and it only works for basic stuff.
I switched to Latenode instead. You get actual control over HTTP responses and can handle webhooks properly. No more weird output format requirements that Zapier forces on you.
Latenode lets you build real webhook endpoints that respond however you need. I’ve moved all my automation there and it’s been huge.
The main problem is that Zapier Code steps run as functions, not persistent servers. I ran into this same webhook issue before - Zapier handles the HTTP response for you automatically. Just focus on processing the webhook data and setting the output variable Zapier needs. For webhook responses, end your code with something like output = {status: 200, message: 'OK'}; and Zapier converts that into proper HTTP responses. The Express server thing won’t work because Zapier kills everything once your function finishes - you can’t keep listeners running. You’re writing a response handler, not building a whole server.
Zapier’s serverless setup doesn’t support persistent servers - that’s your main problem. I made the exact same mistake when I started, trying to use regular Node.js server patterns. You need to write your code as a function that returns the right response format. Use something like return {status: 200, body: 'OK'}; instead of building an Express app. Zapier handles all the HTTP stuff for you. Your code just processes the webhook data and returns a response object. The platform converts whatever you return into proper HTTP responses automatically.
Zapier doesn’t let you run actual HTTP servers like Express in their environment. That error happens because Zapier expects a specific output format from your code. You can’t create server instances - instead, define your logic and return responses using Zapier’s built-in mechanisms. For webhook responses, use the callback function with proper status codes and body content, or return structured data Zapier can process. The platform handles HTTP server stuff automatically, so just focus on your business logic instead of server setup.
nah you can’t do server stuff in zapier - it’s not that kind of environment. just set output = {status: 200, message: 'OK'}; at the end of your code and zapier will handle the webhook response properly. no need for express or anything complex