Modules / AI and operations
AI and background jobs
From an authorized request to a durable result.
Follow the task lifecycle
The production task API validates the authenticated workspace and entitlement before persisting a task and dispatching the ai.generate Trigger.dev workflow. The router applies capability requirements and configured model policy.
POST /api/ai/tasks
→ authenticated workspace + entitlement
→ durable task record
→ Trigger.dev ai.generate
→ model routing + generation
→ usage record + result
→ transactional completion deliveryConfigure aliases and budgets
The user selects an enabled alias: cheap, fast, or smart. The server controls the underlying model IDs, provider credentials, workspace policy, and budget enforcement. Encrypted bring-your-own-key support must preserve the same server-only boundary.
Keep workflow semantics explicit
JobRunner promises enqueue, status, and cancel only. Trigger.dev workflow semantics are explicit, including durable execution behavior. Do not infer retries or scheduling guarantees from the generic contract.
The production submission path uses idempotency and saved task recovery to handle ambiguous dispatch. Completion of generation is separate from completion-email delivery.