Overview
Triggers define how ensembles are invoked. Conductor supports nine trigger types, all configured using the unifiedtrigger: array in your ensemble YAML:
- HTTP - Full web routing with path params, CORS, rate limiting, HTML/JSON responses
- Webhook - Simple HTTP endpoints for external integrations
- MCP - Model Context Protocol tool exposure
- Email - Email routing and processing
- Queue - Cloudflare Queues message processing
- Cron - Scheduled execution with cron expressions
- Build - Static generation at build time
- CLI - Custom developer commands
- Startup - Execute on Worker cold start (initialization)
HTTP Triggers
Full web routing with path parameters, CORS, rate limiting, authentication, and HTML or JSON responses. Use HTTP triggers for building APIs, web pages, and complex web applications.Basic JSON API
GET /api/users/123 → Returns JSON
Server-Rendered HTML Page
GET /blog/my-post → Returns HTML page
HTTP with Authentication & Rate Limiting
HTTP Request Context
HTTP triggers automatically parse request data and make it available to your ensemble:
Cookie Access:
HTTP vs Webhook
Rule of thumb: Use
http for web routing and pages. Use webhook for receiving webhooks from external services.
Multi-Path HTTP Triggers
Handle multiple related endpoints in a single ensemble using thepaths array. This allows one ensemble to serve multiple routes with different HTTP methods and path parameters.
- Organize related endpoints in one ensemble
- Share authentication and middleware across paths
- Reduce configuration duplication
- Keep related business logic together
- Support RESTful API patterns naturally
- Use
:paramsyntax for dynamic segments (e.g.,/users/:id,/posts/:slug) - Access via
${input.params.id},${input.params.slug}, etc. - Works with any HTTP method
GET /blog- List all postsGET /blog/:slug- View single postGET /blog/:slug/comments- List commentsPOST /blog/:slug/comments- Add comment
Complex Website Structure
For full-blown websites with sitemaps, robots.txt, dynamic pages, etc., organize ensembles by route:trigger: {type: http}:
Example: ensembles/static/robots.yaml
ensembles/static/sitemap.yaml
- ✅ Full control over every route
- ✅ Each route is testable independently
- ✅ Easy to add auth, rate limiting per route
- ✅ Auto-discovery finds all ensembles
- ✅ SEO-friendly (sitemaps, robots.txt)
- ✅ Dynamic content from database
- ✅ AI-powered pages via think agents
Webhook Triggers
Expose ensembles as HTTP endpoints for external services.You own your webhook paths. You can define any path you want. We recommend using
/webhooks/* paths for clarity (e.g., /webhooks/github, /webhooks/stripe).Basic Webhook
Authenticated Webhook
Webhook Authentication Types
Bearer Token:Async Webhook Execution
For long-running ensembles, return immediately and process in background:MCP Triggers
Expose ensembles as Model Context Protocol tools for AI assistants. Conductor automatically generates MCP tool schemas from your ensemble’sinputs definition.
Basic MCP Tool
GET /mcp/tools- List all ensembles exposed as MCP tools (with auto-generated input schemas)POST /mcp/tools/{name}- Invoke an ensemble via MCP protocol
Input Schema Generation
Conductor automatically converts yourinputs block to MCP’s JSON Schema format:
Authentication Options
Bearer Token (simple or JWT):JWT_SECRET is configured in your environment, bearer tokens are validated as JWTs.
OAuth (coming soon):
Public MCP Tool
Email Triggers
Trigger ensembles via Cloudflare Email Routing. Conductor fully parses RFC822 emails including MIME multipart content and attachments.Basic Email Trigger
Email Input Fields (RFC822 Parsed)
Conductor parses RFC822 emails and provides structured data to your ensemble:
Attachment format:
Reply with Output
Whenreply_with_output: true, ensemble outputs are sent back via email:
Queue Triggers
Process Cloudflare Queue messages in batches.Basic Queue Consumer
Queue Configuration
queue- Cloudflare Queue binding name (must match wrangler.toml)batch_size- Maximum messages per batch (default: 10)max_retries- Retry failed messages (default: 3)max_wait_time- Max seconds to wait for batch to fill
queue operation - see Queue Operation documentation.
Cron Triggers
Schedule ensemble execution with cron expressions.Basic Cron Trigger
Cron Expression Format
Standard cron syntax (5 or 6 fields):"0 0 * * *"- Daily at midnight UTC"0 */4 * * *"- Every 4 hours"0 9 * * 1-5"- Weekdays at 9 AM"0 0 1 * *"- First day of month"0 0 * * 0"- Every Sunday
Cron with Custom Input
Pass data to scheduled executions:Multiple Cron Triggers
Ensembles can have multiple schedules:Disable Cron Trigger
Temporarily disable without removing:Schedule Metadata
Access schedule information in ensemble:Build Triggers
Run ensembles at build time to generate static content. Build triggers execute during theensemble conductor build command and are useful for generating documentation, static pages, or pre-computing data.
Basic Build Trigger
ensemble conductor build
Build with Custom Input
Pass data to build-time executions:Multiple Build Triggers
Generate different static assets:Conditional Build
Useenabled to skip builds conditionally:
CLI Triggers
Create custom CLI commands that execute ensembles. CLI triggers are invoked viaensemble conductor run <command> and support options with defaults and validation.
Basic CLI Trigger
ensemble conductor run generate-docs
CLI with Options
Define command-line options with types and defaults:CLI Options Types
Supported option types:Access Options in Flow
CLI options are available via${trigger.options.*}:
Startup Triggers
Run ensembles on Worker cold start, before HTTP routes are registered. Startup triggers are ideal for cache warming, health checks, and initialization tasks.Cold start semantics: Cloudflare Workers naturally cold start after a few minutes of inactivity. Startup triggers run once per cold start - not on every request.
Basic Startup Trigger
Health Check on Startup
Verify dependencies are available before serving requests:Startup with Custom Input
Pass static input data to startup ensembles:Disable Startup Trigger
Temporarily disable without removing:Performance Considerations
Good use cases:- Cache warming (KV reads/writes)
- Health checks (database ping)
- Configuration loading
- Metrics initialization
- Heavy data processing
- Long-running API calls
- Complex AI inference
- Large file operations
Startup vs Cron
If you need predictable timing, use cron. If you need “run once when Worker starts”, use startup.
Multiple Triggers
Ensembles can have multiple triggers of different types:- POST to
/webhooks/process - MCP tool call
data-processor - Email to
process@example.com - Queue message to
PROCESS_QUEUE - Cron schedule every 6 hours
Trigger Security
Default-Deny Policy
All triggers (except queue and cron) require either:- Authentication (
authconfiguration), OR - Explicit public access (
public: true)
Best Practices
-
Use environment variables for secrets:
-
Verify webhook signatures:
Use
signatureauth type for external webhooks -
Limit email senders:
-
Use async for long operations:
Configuration Reference
HTTP Trigger
Webhook Trigger
MCP Trigger
Email Trigger
Queue Trigger
Cron Trigger
Build Trigger
CLI Trigger
Startup Trigger
Response Formats
Theformat field in the output block controls response serialization and Content-Type headers. Use this for non-JSON responses like CSV, XML, YAML, etc.
Format Types
CSV Export Example
YAML Config Example
iCalendar Event
The
extract option specifies which field from the body should be serialized. If not specified, the entire body is serialized.Triggers vs API Routes
Conductor provides two ways to execute ensembles:Triggers (This Page)
Triggers are defined in ensemble YAML and provide:- Path-based routing with parameters (
/users/:id) - Per-trigger authentication configuration
- Rate limiting and CORS settings
- Auto-discovery from ensemble definitions
API Execute Routes
The/api/v1/execute/* routes provide programmatic access:
-
Project-level policy in
conductor.config.ts: -
Per-ensemble control via
apiExecutable:
See Security & Authentication for complete auth documentation.
Next Steps
Security & Auth
API keys, permissions, and authentication
MCP Integration
Expose ensembles as MCP tools
Queue Operation
Queue message processing
Event-Driven
Event-driven patterns

