Scaffold a background-task pair: api/jobs/<job_name>.js (the worker, runs async with platform-managed retries) + api/<enqueue_route>.js (the enqueuer, returns immediately with the task id).
Use this when the user shouldn't wait for the work — sending a batch of emails, processing an upload, fanning out webhooks. The platform handles backoff and dead-lettering.
Difference from add_scheduled_job: scheduled jobs fire on a recurring cron; background tasks are fire-and-forget triggered by a request.
Example:
add_background_task({ job_name: 'send_welcome', enqueue_route: 'signup-complete', retries: 3 })
→ POST /api/signup-complete enqueues; /api/jobs/send_welcome runs async
Connector