You will need to use waitUntil (https://developers.cloudflare.com/workers/runtime-apis/context/#wait

You will need to use waitUntil (https://developers.cloudflare.com/workers/runtime-apis/context/#waituntil) to make sure Worker A waits for Worker B to do its work before terminating, allowing you to return the response and then do whatever work you need in the waitUntil (could also use Queues or Workflows if you need retries / more reliability)
Cloudflare Docs
The Context API in Cloudflare Workers, including waitUntil and passThroughOnException.
Was this page helpful?