This page documents the example projects and tasks that form a key part of the Trigger.dev documentation system. These examples serve as practical, working demonstrations of how to use Trigger.dev features and integrate with external services. The examples are divided into two categories: Example Tasks (copyable code snippets) and Example Projects (full applications with GitHub repositories).
For information about the overall documentation structure and navigation, see Documentation Structure. For details about integration patterns with AI agents and external services, see Integration Patterns.
The examples are organized within the Mintlify documentation system through the docs/docs.json configuration file. The navigation structure includes:
Guides & examples dropdown
├── Introduction (guides/introduction.mdx)
├── Frameworks/
├── Guides/
│ └── AI Agents/
├── Use cases/
├── Example projects/
├── Python guides/
├── Example tasks/
└── Migration guides/
Example projects navigation (docs/docs.json349-366):
Example tasks navigation (docs/docs.json379-404):
Sources: docs/docs.json269-420 docs/guides/introduction.mdx1-104
Example Tasks are lightweight, focused demonstrations:
Example Projects are comprehensive applications:
Sources: docs/guides/introduction.mdx47-98 docs/guides/examples/fal-ai-image-to-cartoon.mdx1-112 docs/guides/example-projects/realtime-fal-ai.mdx1-44
Each example task follows a consistent structure:
| Section | Purpose | File Reference |
|---|---|---|
| Title & Description | Explains what the task does | docs/guides/examples/scrape-hacker-news.mdx1-5 |
| Video Walkthrough | YouTube embed showing implementation | docs/guides/examples/scrape-hacker-news.mdx10-18 |
| Overview | Lists features and tools used | docs/guides/examples/scrape-hacker-news.mdx20-37 |
| Prerequisites | Required accounts and setup | docs/guides/examples/scrape-hacker-news.mdx40-46 |
| Build Configuration | trigger.config.ts setup | docs/guides/examples/scrape-hacker-news.mdx50-64 |
| Environment Variables | Required API keys | docs/guides/examples/scrape-hacker-news.mdx68-76 |
| Task Code | Complete implementation | docs/guides/examples/scrape-hacker-news.mdx80-211 |
| Testing Instructions | How to run and test | docs/guides/examples/scrape-hacker-news.mdx250-253 |
Sources: docs/guides/examples/scrape-hacker-news.mdx1-253 docs/guides/examples/fal-ai-image-to-cartoon.mdx1-112
Scraping and Data Collection (docs/guides/examples/scrape-hacker-news.mdx):
schedules.task()batchTriggerAndWait()AI Image Generation (docs/guides/examples/fal-ai-image-to-cartoon.mdx):
onQueueUpdateScheduled Workflows (docs/guides/examples/scrape-hacker-news.mdx92-148):
Sources: docs/guides/examples/scrape-hacker-news.mdx80-211 docs/guides/examples/fal-ai-image-to-cartoon.mdx28-112 packages/trigger-sdk/src/v3/schedules/index.ts64-91
Example projects include comprehensive documentation with:
GitHub Repository Links - All projects link to triggerdotdev/examples repository:
Relevant Code Table - Maps features to specific files (docs/guides/example-projects/claude-github-wiki.mdx58-63):
| File | Description |
|---|---|
trigger/analyze-repo.ts | Main task that clones repo, runs Claude agent |
trigger/agent-stream.ts | Typed stream definition for real-time |
app/api/analyze-repo/route.ts | API endpoint that triggers task |
app/response/[runId]/page.tsx | Real-time streaming display |
Configuration Highlights - Special setup requirements (docs/guides/example-projects/claude-github-wiki.mdx67-82):
Sources: docs/guides/example-projects/realtime-fal-ai.mdx1-44 docs/guides/example-projects/claude-github-wiki.mdx1-94 docs/guides/example-projects/mastra-agents-with-memory.mdx1-93
The documentation organizes AI agent examples into two categories:
Agent Fundamentals (docs/guides/ai-agents/overview.mdx64-100) - Basic patterns from Anthropic's "building effective agents" research:
SDK Integrations (docs/guides/ai-agents/overview.mdx7-62) - Production agent frameworks:
Sources: docs/guides/ai-agents/overview.mdx1-101 docs/guides/introduction.mdx24-43
claude-changelog-generator (docs/guides/example-projects/claude-changelog-generator.mdx):
list_commits, get_commit_diffclaude-github-wiki (docs/guides/example-projects/claude-github-wiki.mdx):
Grep and Read for codebase explorationBoth require special configuration (docs/guides/ai-agents/claude-code-trigger.mdx28-46):
Sources: docs/guides/example-projects/claude-changelog-generator.mdx1-96 docs/guides/example-projects/claude-github-wiki.mdx1-94 docs/guides/ai-agents/claude-code-trigger.mdx1-211
TypeScript Playground (docs/guides/example-projects/openai-agents-sdk-typescript-playground.mdx) - 7 production patterns:
| Pattern | File | Key Feature |
|---|---|---|
| Basic Chat | basicAgentChat.ts | Strategic model selection (GPT-4, o1-preview, o1-mini) |
| With Tools | agentWithTools.ts | Weather data with Zod validation |
| Streaming | streamingAgent.ts | Real-time progress tracking |
| Handoffs | agentHandoff.ts | Multi-agent delegation |
| Parallel | parallelAgents.ts | batch.triggerByTaskAndWait for concurrent execution |
| Scheduled | scheduledAgent.ts | Cron-based monitoring every 6 hours |
| Guardrails | agentWithGuardrails.ts | Input classification and validation |
Python Guardrails (docs/guides/example-projects/openai-agent-sdk-guardrails.mdx) - Three guardrail types:
Input Guardrails (input-guardrails.py):
@input_guardrail decorator validates user inputOutput Guardrails (output-guardrails.py):
@output_guardrail decorator validates generated responsesStreaming Guardrails (streaming-guardrails.py):
ResponseTextDeltaEvent streamsSources: docs/guides/example-projects/openai-agents-sdk-typescript-playground.mdx1-65 docs/guides/example-projects/openai-agent-sdk-guardrails.mdx1-61
mastra-agents-with-memory (docs/guides/example-projects/mastra-agents-with-memory.mdx) demonstrates multi-agent memory sharing:
Architecture Pattern:
Key Features (docs/guides/example-projects/mastra-agents-with-memory.mdx36-44):
triggerAndWaitProject Structure (docs/guides/example-projects/mastra-agents-with-memory.mdx45-60):
src/
├── mastra/
│ ├── agents/
│ │ ├── weather-analyst.ts
│ │ ├── clothing-advisor.ts
│ ├── tools/weather-tool.ts
│ ├── schemas/weather-data.ts
│ └── index.ts
├── trigger/weather-task.ts
Sources: docs/guides/example-projects/mastra-agents-with-memory.mdx1-93
realtime-fal-ai (docs/guides/example-projects/realtime-fal-ai.mdx) demonstrates frontend streaming:
Components:
Task Implementation (docs/guides/examples/fal-ai-realtime.mdx42-78):
The frontend uses React hooks to display progress, handle errors, and show completion status in real-time.
Sources: docs/guides/example-projects/realtime-fal-ai.mdx1-44 docs/guides/examples/fal-ai-realtime.mdx1-90
Python examples use the pythonExtension() build configuration to execute Python scripts from tasks:
Configuration (docs/guides/example-projects/openai-agent-sdk-guardrails.mdx54):
Task Pattern (docs/guides/example-projects/openai-agent-sdk-guardrails.mdx42-44):
InputGuardrailTripwireTriggeredExample Projects:
Sources: docs/guides/example-projects/openai-agent-sdk-guardrails.mdx1-61 docs/introduction.mdx92-106
AI Service Integrations - Common patterns:
onQueueUpdate callbacksMedia Processing - Requires build extensions:
puppeteer() extension (docs/guides/examples/scrape-hacker-news.mdx50-64)ffmpeg() extensionpythonExtension() for Pillow, PyMuPDFStorage Integration - Cloudflare R2 via S3 SDK:
Sources: docs/guides/examples/scrape-hacker-news.mdx1-253 docs/guides/examples/fal-ai-image-to-cartoon.mdx28-102 docs/introduction.mdx108-178
The examples follow a strict file naming and organization convention:
Example Tasks Location:
docs/guides/examples/
├── dall-e3-generate-image.mdx
├── fal-ai-image-to-cartoon.mdx
├── fal-ai-realtime.mdx
├── ffmpeg-video-processing.mdx
├── puppeteer.mdx
├── scrape-hacker-news.mdx
└── [service-name-action].mdx
Example Projects Location:
docs/guides/example-projects/
├── anchor-browser-web-scraper.mdx
├── claude-changelog-generator.mdx
├── claude-github-wiki.mdx
├── mastra-agents-with-memory.mdx
├── openai-agents-sdk-typescript-playground.mdx
└── [project-description].mdx
Navigation Registration (docs/docs.json349-404):
"group": "Example projects""group": "Example tasks"docs.json navigation arraySources: docs/docs.json349-404 docs/guides/introduction.mdx47-98
Video Walkthroughs - Embedded YouTube iframes:
Test Instructions - Consistent pattern:
Warning Notices - Special cases like web scraping (docs/snippets/web-scraping-warning.mdx):
Sources: docs/guides/examples/scrape-hacker-news.mdx10-18 docs/guides/examples/fal-ai-realtime.mdx22-30 docs/snippets/web-scraping-warning.mdx1-3
| Category | Example | Key Features | Build Extension |
|---|---|---|---|
| AI Image | DALL·E 3 | GPT-4o + DALL·E 3 | None |
| AI Image | Fal.ai cartoon | Image-to-image, R2 upload | None |
| Media | FFmpeg | Video processing, R2 storage | ffmpeg() |
| Media | PDF to image | MuPDF conversion | None |
| Scraping | Hacker News | BrowserBase, batch triggers | puppeteer() |
| Scraping | Puppeteer | PDF generation, scraping | puppeteer() |
| Resend sequence | Multi-day email workflow | None | |
| React Email | Template rendering | None |
| Project | Framework | Key Technologies | Patterns |
|---|---|---|---|
| realtime-fal-ai | Next.js | Fal.ai, React hooks | Realtime streaming |
| claude-github-wiki | Next.js | Claude Agent SDK | Tool usage, cancellation |
| claude-changelog-generator | Next.js | Claude, Octokit | Custom MCP tools |
| mastra-agents-with-memory | Node.js | Mastra, PostgreSQL | Memory sharing |
| openai-agents-sdk-typescript-playground | Node.js | OpenAI Agents SDK | 7 agent patterns |
| openai-agent-sdk-guardrails | Node.js | Python, OpenAI | Guardrails system |
Sources: docs/guides/introduction.mdx47-98 docs/docs.json349-404
Refresh this wiki