One of the challenges with webhooks is sending a response within the required timeframe. e.g. Shopif

One of the challenges with webhooks is sending a response within the required timeframe. e.g. Shopify and Xero will only wait 5 seconds. Assuming your application processing could take longer that 5 seconds, two options are: 1) Respond early and continue execution using 'waitUntil'. see https://developers.cloudflare.com/workers/runtime-apis/context/#waituntil or 2) Grab the request data (optionally store it) and send it into a queue for later processing by another worker, then respond. Personally I use the second pattern as it provides more visibility and the opportunity to replay the webhook event if needed.
Was this page helpful?