Web Dev//API//event-driven API

Pattern where your app fires an event and the actual processing happens outside your request. Your Vercel Function returns immediately; the heavy work runs asynchronously in a job queue.


Pattern where your app fires an event and the actual processing happens outside your request. Your Vercel Function returns immediately; the heavy work runs asynchronously in a job queue.

Your app sends an event ("emails.sync_requested", "report.generate") → Inngest or Trigger.dev picks it up → processes it in background steps, each within the timeout

The user's request doesn't hang waiting for the work to finish. The frontend can poll for status or receive a webhook when done.

Each step is its own function invocation: step 1 fetches emails, step 2 parses them, step 3 saves to DB. If step 2 fails, only step 2 retries.

Solves the timeout problem: instead of one 10-minute function that gets killed, you have 100 six-second functions that each complete within budget.

The external API calls still happen — but inside Inngest/Trigger.dev steps, not inside your user-facing request handler.

Use when: batch processing (Gmail sync, data migration), multi-step workflows, anything that exceeds a single function's timeout