web dev//API//event-driven API
An event-driven API is the pattern in which the app fires an event and the actual processing happens outside the request: the Vercel Function returns immediately, and the heavy work runs asynchronously in a job queue.
An event-driven API is the pattern in which the app fires an event and the actual processing happens outside the request: the Vercel Function returns immediately, and the heavy work runs asynchronously in a job queue.
1The app sends an eventemails.sync_requested, report.generate2Inngest or Trigger.dev picks it up3It runs in background stepseach within the timeout
The user's request does not hang waiting for the work to finish. The frontend can poll for status or receive a webhook when the work is done.
Each step is its own function invocation (step 1 fetches emails, step 2 parses them, step 3 saves them to the database), so when step 2 fails, only step 2 retries.
It solves the timeout problem: one 10-minute function that gets killed becomes 100 six-second functions that each complete within budget.
The external API calls still happen, inside the Inngest or Trigger.dev steps rather than inside the user-facing request handler.
It suits batch processing (Gmail sync, data migration), multi-step workflows and anything that exceeds a single function's timeout.