Skip to main content
Define workflows in YAML. Deploy to Cloudflare Workers. State management, caching, parallelization built-in.

What Conductor Does

Conductor is a production-ready orchestration framework for building AI workflows that execute at the edge. You define ensembles (workflows) in YAML that coordinate agents (workers) using operations (execution primitives) to accomplish complex tasks. No DAG builders. No UI-driven workflows. No central orchestrator bottleneck. Just YAML files in Git that deploy to Cloudflare Workers.

Why Edge-Native Matters

Traditional Orchestrators (Airflow, Temporal, Prefect):
  • Centralized servers (single region)
  • Slow cold starts (2-5 seconds)
  • Infrastructure management required
  • Geographic latency
Conductor (Edge-Native):
  • Distributed compute (200+ regions)
  • Fast cold starts (<50ms)
  • Zero infrastructure management
  • Near-zero latency globally

Quick Example

Create ensembles/company-intel.yaml:
name: company-intel
description: Fetch and analyze company data

flow:
  # Fetch company data
  - name: fetch
    operation: http
    config:
      url: https://api.company-data.com/lookup?domain=${input.domain}
      cache_ttl: 3600  # Cache for 1 hour

  # Analyze with AI
  - name: analyze
    operation: think
    component: [email protected]  # Versioned prompt via Edgit
    config:
      model: claude-3-5-sonnet-20241022
    input:
      company_data: ${fetch.output}

  # Validate quality
  - name: score
    agent: validator  # Pre-built agent
    input:
      content: ${analyze.output}

output:
  domain: ${input.domain}
  analysis: ${analyze.output}
  quality_score: ${score.output.score}
  cached: ${fetch.cached}
Deploy it:
ensemble conductor deploy
Test it via the API:
# Execute via API (requires authentication)
curl https://your-worker.workers.dev/api/v1/execute/ensemble/company-intel \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"input": {"domain": "stripe.com"}}'

# Or define an HTTP trigger for public access
# See triggers documentation for auth options
You’re running AI workflows at the edge in <5 minutes.

Core Components

1. Operations (Execution Primitives)

Operations define HOW agents execute. They’re the “verbs” of what agents do: View all operations

2. Agents (Workers)

Agents are executable units that use operations to perform tasks: Custom Agents (you define):
flow:
  - name: analyzer
    operation: think
    component: [email protected]
    config:
      model: claude-3-5-sonnet-20241022
Starter Kit (ship with Conductor):
flow:
  - name: scraper
    agent: scraper  # Use pre-built
    config:
      url: https://example.com
Available pre-built agents:
  • scraper - Web scraping with 3-tier fallback
  • validator - Quality scoring with multiple evaluators
  • rag - RAG pipeline with R2 storage
  • hitl - Human-in-the-loop approval workflows
  • fetcher - HTTP with retry logic
  • transformer - Data transformation utilities
  • scheduler - Delayed/scheduled execution
View all agents

3. Ensembles (Orchestration)

Ensembles are YAML files that coordinate agents into workflows:
name: my-workflow

flow:
  # Sequential by default
  - name: fetch
    operation: http

  - name: analyze
    operation: think

  # Parallel execution
  - parallel:
      - name: financial-analysis
        operation: think
      - name: legal-analysis
        operation: think

  # Conditional execution
  - name: manual-review
    agent: hitl
    condition: ${analyze.score < 0.8}

output:
  result: ${analyze.output}
  required_review: ${manual-review.completed}
Learn more about ensembles

Key Features

State Management

Share data across agents with immutable state:
state:
  schema:
    company_data: object
    analyses: array

flow:
  - name: fetch
    operation: http
    state:
      set: [company_data]  # Write to state

  - name: analyze
    operation: think
    state:
      use: [company_data]  # Read from state
      set: [analyses]       # Append to array

Caching

Three cache layers for optimal performance:
flow:
  - name: fetch
    operation: http
    config:
      cache_ttl: 3600  # KV cache for 1 hour

  - name: analyze
    operation: think
    config:
      model: claude-3-5-sonnet-20241022
      # AI Gateway caches automatically
First request: ~200ms Cached request: <10ms

Flow Control

Sequential (default), parallel, conditional, loops, retry:
flow:
  # Sequential
  - name: step1
    operation: http

  - name: step2
    operation: think

  # Parallel
  - parallel:
      - name: task-a
        operation: think
      - name: task-b
        operation: think

  # Conditional
  - name: fallback
    operation: think
    condition: ${step2.failed}

  # Loop
  - name: process-batch
    operation: code
    loop:
      items: ${input.items}

  # Retry
  - name: api-call
    operation: http
    retry:
      max_attempts: 3
      backoff: exponential
Learn about flow control

A/B Testing

Test multiple variants simultaneously:
name: ab-test

flow:
  # Variant A: GPT-4 with conservative prompt
  - name: variant-a
    operation: think
    component: [email protected]
    config:
      model: gpt-4

  # Variant B: Claude with aggressive prompt
  - name: variant-b
    operation: think
    component: [email protected]
    config:
      model: claude-3-5-sonnet-20241022

output:
  variant_a_result: ${variant-a.output}
  variant_b_result: ${variant-b.output}
  # Compare and pick winner
Learn about A/B testing

Beyond Workflows: Build Web Applications

Conductor isn’t just for backend workflows. Using ensembles with HTTP triggers, you can build server-rendered web applications: Features:
  • HTTP triggers - Define routes with path parameters and rate limiting
  • Template rendering - Handlebars, Liquid, or raw HTML templates
  • Dynamic routes - URL parameters like /blog/:slug
  • Content negotiation - HTML or JSON based on Accept header
  • Full flow control - Use any agent operation to fetch data before rendering
Example:
# ensembles/blog-post.yaml
name: blog-post
description: Render a blog post page

trigger:
  - type: http
    path: /blog/:slug
    methods: [GET]
    public: true
    rateLimit:
      requests: 100
      window: 60

flow:
  # Fetch post data
  - name: fetch-post
    operation: http
    config:
      url: https://api.cms.com/posts/${params.slug}

  # Render the page
  - name: render
    operation: html
    config:
      templateEngine: handlebars
      template: |
        <h1>{{fetch-post.output.title}}</h1>
        <div class="content">
          {{fetch-post.output.content}}
        </div>

output:
  _raw: ${render.output}
Learn more about Ensembles

Versioning (Optional)

Conductor supports component versioning through Edgit integration: Basic approach: Version control with git (standard) Advanced approach: Edgit integration for component-level versioning
Note: Edgit is optional. You can use Conductor with standard git workflows.
If using Edgit, you get:
  • Versioned components (prompts, configs, queries, scripts)
  • Versioned agent implementations
  • Mix optimal versions from different points in history
  • Rollback one component without touching anything else
Example with Edgit:
name: versioned-workflow

flow:
  - name: scraper
    agent: [email protected]          # Versioned agent via Edgit

  - name: analyzer
    operation: think
    component: [email protected]  # Versioned component via Edgit
    config:
      model: claude-3-5-sonnet-20241022
Learn more about Edgit

Platform Integration

Cloudflare Workers

Conductor runs on Cloudflare Workers with access to the full platform:
  • KV - Key-value storage for caching
  • D1 - SQL database for structured data
  • R2 - Object storage for documents
  • Vectorize - Vector database for embeddings
  • Durable Objects - Strongly consistent state for HITL
  • AI Gateway - Caching and observability for AI providers
  • Workers AI - On-platform AI models

Configuration

Simple wrangler.toml configuration:
name = "my-ai-workflow"
main = "src/index.ts"
compatibility_date = "2024-11-01"

# KV for caching
[[kv_namespaces]]
binding = "CACHE"
id = "your_kv_namespace_id"

# D1 for structured data
[[d1_databases]]
binding = "DB"
database_name = "analytics"
database_id = "your_d1_database_id"

# AI Gateway
[ai]
binding = "AI_GATEWAY"
gateway_id = "your_gateway_id"

Production-Ready

812 Tests Passing

Comprehensive test coverage with Vitest

v1.8.0 Released

Production-ready and published to npm

Type-Safe

Full TypeScript support with strict types

Observable

Structured logs and metrics for every execution

Testing Your Workflows

Conductor includes Vitest for testing. The template includes working examples:
import { describe, it, expect } from 'vitest';
import { Executor, MemberLoader } from '@ensemble-edge/conductor';
import { stringify } from 'yaml';

describe('My Ensemble', () => {
  it('should execute successfully', async () => {
    // Setup with proper ExecutionContext mock
    const env = {} as Env;
    const ctx = {
      waitUntil: (promise: Promise<any>) => promise,
      passThroughOnException: () => {}
    } as ExecutionContext;

    const executor = new Executor({ env, ctx });
    const loader = new MemberLoader({ env, ctx });

    // Register your agents
    const agent = loader.registerAgent(agentConfig, agentFunction);
    executor.registerAgent(agent);

    // Execute ensemble
    const result = await executor.executeFromYAML(
      stringify(myEnsemble),
      { input: 'test data' }
    );

    // Assert
    expect(result.success).toBe(true);
    expect(result.value.output).toBeDefined();
  });
});
Run tests: pnpm test
Note: Proper ExecutionContext mocking is required. See template examples in tests/basic.test.ts.

Limitations & Considerations

Platform Constraints:
  • Execution time: 30s limit for free tier, 15min for paid (CPU time limit)
  • Max payload: 100MB for requests/responses
  • Cold starts: ~50ms (negligible for most use cases)
Development Notes:
  • Rebuilding required after adding new agents/pages (discovered at build time)
  • Network binding needed for local dev: use --local-protocol http flag
  • Some operations require API keys (OpenAI, Anthropic, etc.)
What Works:
  • ✅ Dynamic route parameters (e.g., /blog/:slug) - Fixed in v1.8.0!
  • ✅ Static and dynamic pages
  • ✅ All 12 operations
  • ✅ Auto-discovery of pages, agents, ensembles
  • ✅ State management and caching
See troubleshooting guide

Use Cases

Scrape company data and analyze with AI to generate reports and store results.Operations: http + think + storage
Extract data from PDFs and validate quality with human approval for low scores.Starter Kit: validator + hitl
Index documents from R2 and perform semantic search to generate contextualized answers.Starter Kit: rag
Parse emails and classify intent to route to handlers and send automated responses.Operations: email + think + http
Test multiple prompt versions and agent implementations with model configs in parallel.Feature: Version multiverse with Edgit integration

Quick Start (60 Seconds)

Get a working Conductor project instantly: Your project includes:
  • 10 example pages - Static, dynamic, forms, and SSR patterns
  • Working workflows - hello-world ensemble ready to run
  • Custom agents - hello agent showing code operations
  • Tests - Vitest setup with passing examples

Ready to Get Started?

Architecture Principles

Cloudflare Workers + KV + D1 + R2 are the primitives. No centralized compute.
Multi-layer caching with TTL control reduces costs and latency by 10x.
AI operations produce machine-readable and type-safe output validated via JSON schema.
Every execution emits structured logs and metrics for effortless debugging.
No throwing exceptions in core runtime with explicit Result types for predictable error flow.

Next Steps

Conductor is open source. Workflows run on your Cloudflare account. We don’t see your data.You own everything.