Skip to main content
Trigger.dev is purpose-built for long-running AI agent workflows. Tasks can wait for minutes, hours, or days without consuming resources — making it ideal for agentic loops, human-in-the-loop flows, and parallel fan-out patterns. The patterns below are inspired by Anthropic’s research on building effective agents.

Agent fundamentals

Prompt chaining

Chain prompts together to generate and translate marketing copy automatically

Routing

Send questions to different AI models based on complexity analysis

Parallelization

Simultaneously check for inappropriate content while responding to customer inquiries

Orchestrator-workers

Coordinate multiple AI workers to verify news article accuracy

Evaluator-optimizer

Translate text and automatically improve quality through feedback loops

Core patterns

Prompt chaining

Break a complex task into a sequence of smaller LLM calls where each step feeds its output into the next. This trades latency for accuracy and lets you apply validation gates between steps.
trigger/generate-translate.ts

Parallel fan-out

Use batch.triggerAndWait to run multiple child tasks simultaneously and collect all results before continuing. This is ideal for independent checks or enrichment steps that don’t depend on each other.
trigger/parallel-checks.ts

Agentic loop (orchestrator-workers)

An orchestrator task breaks work into sub-tasks and dispatches them to worker tasks. The orchestrator waits for each worker before deciding next steps — enabling dynamic, multi-step workflows that adapt based on intermediate results.
trigger/orchestrator.ts

Human-in-the-loop

Use waitpoint tokens to pause a task indefinitely and resume it when a human provides approval or additional input. The task sleeps without consuming any resources.
trigger/review-workflow.ts
To complete the token from a server action or API route:
app/actions.ts

Evaluator-optimizer loop

Generate output with one model, evaluate the quality with a second, and feed the feedback back in until the result meets a quality threshold.
trigger/translate-and-refine.ts

Example projects using AI agents

Claude changelog generator

Automatically generate professional changelogs from git commits using the Claude Agent SDK.

Human-in-the-loop workflow

Create audio summaries of newspaper articles with a ReactFlow UI and waitpoint token approval step.

Vercel AI SDK deep research agent

Autonomous multi-layered web research that generates comprehensive PDF reports.

Claude changelog generator

Automatically generate professional changelogs from git commits using Claude.

Human-in-the-loop workflow

Audio summaries with a human review step using ReactFlow and waitpoint tokens.