Requests are not always the right place for work

If an operation sends email, generates reports, syncs analytics, or calls a slow third-party API, it probably does not belong in the user's request path.

await queue.publish("invoice.created", { invoiceId })

A queue gives you retries, backpressure, and room to recover.

  1. Accept the request
  2. Store the durable intent
  3. Process async
  4. Report status clearly

That structure keeps users from waiting on work they do not need immediately.