Documentation Index
Fetch the complete documentation index at: https://docs.auction-rise.com/llms.txt
Use this file to discover all available pages before exploring further.
Background Jobs
The template provides a lightweight job tracking layer backed by ajob_runs table. It handles status/progress persistence so you can integrate any job runner (Trigger.dev, Inngest, a custom API route, etc.) without vendor lock-in.
Job Status Lifecycle
| Status | Meaning |
|---|---|
pending | Job has been queued but not started |
running | Job runner has picked it up |
completed | Finished successfully |
failed | Finished with an error |
canceled | Canceled before completion |
Creating a Job
CallenqueueJob() to create a tracking record and get back a job ID:
payload field accepts any JSON-serializable object.
Updating Job Status
From your job runner (API route, webhook handler, etc.), update the job as it progresses:started_at is set automatically when status transitions to running. completed_at is set on completed or failed.
Polling Job Status
Poll from a client component or API route:Canceling a Job
Canceling sets the database status to
canceled but does not stop a running job runner process. Your job runner should poll for canceled status and bail out gracefully.JobRun Type
Long-running API Routes
For long-running operations in Next.js, setmaxDuration in the route file to avoid the default 10s timeout: