trigger-agents
Production AI agent patterns using Trigger.dev's durable execution for orchestration, parallelization, routing, and self-refinement workflows.
- Five core patterns: prompt chaining with validation gates, routing to appropriate models, parallel LLM execution, orchestrator-worker fan-out/fan-in, and evaluator-optimizer self-refining loops
- Includes typed batch execution across multiple tasks, recursive self-calls with feedback, and error handling with per-task result inspection
- Integrates with Trigger.dev waitpoints for human approval gates, realtime streams for frontend progress updates, and ai.tool for LLM task invocation
- Code examples demonstrate each pattern with TypeScript, covering sequential validation, cost-optimized classification, parallel analysis, claim verification workflows, and iterative refinement until quality thresholds
AI Agent Patterns with Trigger.dev
Build production-ready AI agents using Trigger.dev's durable execution.
Pattern Selection
Need to... → Use
─────────────────────────────────────────────────────
Process items in parallel → Parallelization
Route to different models/handlers → Routing
Chain steps with validation gates → Prompt Chaining
Coordinate multiple specialized tasks → Orchestrator-Workers
Self-improve until quality threshold → Evaluator-Optimizer
Pause for human approval → Human-in-the-Loop (waitpoints.md)
Stream progress to frontend → Realtime Streams (streaming.md)
Let LLM call your tasks as tools → ai.tool (ai-tool.md)
More from triggerdotdev/skills
trigger-tasks
Build AI agents, workflows and durable background tasks with Trigger.dev. Use when creating tasks, triggering jobs, handling retries, scheduling cron jobs, or implementing queues and concurrency control.
1.6Ktrigger-config
Configure Trigger.dev projects with trigger.config.ts. Use when setting up build extensions for Prisma, Playwright, FFmpeg, Python, or customizing deployment settings.
1.4Ktrigger-setup
Set up Trigger.dev in your project. Use when adding Trigger.dev for the first time, creating trigger.config.ts, or initializing the trigger directory.
1.4Ktrigger-realtime
Subscribe to Trigger.dev task runs in real-time from frontend and backend. Use when building progress indicators, live dashboards, streaming AI/LLM responses, or React components that display task status.
1.4Ktrigger-cost-savings
Analyze Trigger.dev tasks, schedules, and runs for cost optimization opportunities. Use when asked to reduce spend, optimize costs, audit usage, right-size machines, or review task efficiency. Requires Trigger.dev MCP tools for run analysis.
941tasks
Build AI agents, workflows and durable background tasks with Trigger.dev. Use when creating tasks, triggering jobs, handling retries, scheduling cron jobs, or implementing queues and concurrency control.
3