Skip to main content
Agents use operations to do work. Ensembles orchestrate agents. Operations are where the rubber meets the road.

Core Operations

Compute Operations

Execute logic and transform data.

Data Operations

Access and manipulate data stores.

Communication Operations

Send messages and make requests.

Async Operations

Background processing and message queues.

queue

Cloudflare Queue message processing

Presentation Operations

Render content for users.
Looking for API documentation? The docs/ directory is now a first-class component in Conductor. See Building Documentation for details.

HTTP Context Operations

Manage HTTP-specific concerns.

cookies

Cookie management with consent awareness

Analytics Operations

Track metrics and emit events.

telemetry

Emit events to Cloudflare Analytics Engine

Extension Operations

Extend functionality with external tools.

tools

MCP tools and custom skills

Quick Reference

OperationUse CaseExample
thinkAI reasoning, text generationAnalyze sentiment, generate content
codeComplex logic, calculationsCalculate totals, custom algorithms
transformDeclarative data shapingPick/omit fields, merge data, mock data
convertDocument format conversionHTML→Markdown, DOCX extraction
chartData visualizationBar, line, pie charts as SVG or image URLs
storageSimple storage, cachingCache in KV, store files in R2
dataDatabase queries, structured dataQuery D1, vector search in Vectorize
httpAPI calls, web requestsFetch external data
emailSend notificationsOrder confirmations, alerts
smsSend text messages2FA codes, alerts
htmlRender web pagesDashboard, reports
pdfGenerate documentsInvoices, reports
formGenerate validated formsUser registration, surveys
queueMessage queue processingBackground jobs, event processing
cookiesCookie managementSessions, tracking, consent
telemetryAnalytics eventsTrack metrics, billing, costs
toolsExternal tool integrationWeb search, file operations

Common Configuration

All operations support:
operations:
  - name: my-operation
    operation: think  # Operation type
    config:
      # Operation-specific config
    condition: ${some.condition}  # Optional: when to run
    cache:
      ttl: 3600  # Optional: cache duration (seconds)
      key: custom-key  # Optional: cache key
    retry:
      maxAttempts: 3  # Optional: retry count
      backoff: exponential  # Optional: exponential or linear
      initialDelay: 1000  # Optional: ms before first retry
      maxDelay: 30000  # Optional: max delay between retries
    timeout: 30000  # Optional: timeout in ms

Output Access

Reference operation outputs:
${operation-name.output}          # Full output
${operation-name.output.field}    # Specific field
${operation-name.executed}        # true if ran
${operation-name.failed}          # true if failed
${operation-name.cached}          # true if from cache
${operation-name.duration}        # Execution time (ms)
${operation-name.retry_count}     # Number of retries

Performance Features

Automatic Parallelization

Operations without dependencies run in parallel:
operations:
  # These 3 run in parallel
  - name: fetch-a
    operation: http
    config:
      url: https://api-a.com

  - name: fetch-b
    operation: http
    config:
      url: https://api-b.com

  - name: fetch-c
    operation: http
    config:
      url: https://api-c.com

  # This waits for all 3
  - name: merge
    operation: code
    config:
      script: scripts/merge-fetch-results
    input:
      fetchA: ${fetch-a.output}
      fetchB: ${fetch-b.output}
      fetchC: ${fetch-c.output}
// scripts/merge-fetch-results.ts
import type { AgentExecutionContext } from '@ensemble-edge/conductor'

export default function mergeFetchResults(context: AgentExecutionContext) {
  const { fetchA, fetchB, fetchC } = context.input
  return {
    a: fetchA,
    b: fetchB,
    c: fetchC
  }
}

Built-in Caching

Cache expensive operations:
operations:
  - name: expensive-ai
    operation: think
    config:
      provider: openai
      model: gpt-4o
      prompt: ${input.text}
    cache:
      ttl: 3600  # Cache for 1 hour
      key: ai-${input.text}

Automatic Retry

Retry failed operations:
operations:
  - name: flaky-api
    operation: http
    config:
      url: https://api.example.com
    retry:
      maxAttempts: 3
      backoff: exponential
      initialDelay: 1000

Error Handling

Conditional Execution

Skip operations on failure:
operations:
  - name: try-operation
    operation: http
    config:
      url: https://api.example.com

  - name: fallback
    condition: ${try-operation.failed}
    operation: http
    config:
      url: https://backup-api.com

outputs:
  data: ${try-operation.output || fallback.output}

Error Context

Access error details:
operations:
  - name: risky-op
    operation: http
    config:
      url: https://api.example.com

  - name: log-error
    condition: ${risky-op.failed}
    operation: data
    config:
      backend: d1
      binding: DB
      operation: execute
      sql: INSERT INTO errors (error, timestamp) VALUES (?, ?)
      params:
        - ${risky-op.error}
        - ${Date.now()}

Best Practices

  1. Use the Right Operation - Each is optimized for its use case
  2. Cache Aggressively - Cache expensive operations
  3. Handle Failures - Use conditions and fallbacks
  4. Parallel by Default - Don’t create unnecessary dependencies
  5. Set Timeouts - Prevent hanging operations
  6. Monitor Performance - Track operation durations
  7. Test Thoroughly - Unit test each operation
  8. Version Components - Use Edgit for prompts/configs

Operation Comparison

When to Use What

think vs code vs transform vs convert:
  • Use think for AI reasoning, natural language
  • Use code for complex logic, conditionals, loops
  • Use transform for simple data shaping (pick/omit/merge)
  • Use convert for format conversion (HTML↔Markdown, DOCX)
storage vs data:
  • Use storage (KV) for caching, simple key-value
  • Use data (D1) for structured data, complex queries
http vs tools:
  • Use http for direct API calls
  • Use tools for MCP-compatible tools
email vs sms:
  • Use email for rich content, attachments
  • Use sms for urgent, short messages
html vs page:
  • Use html for simple rendering
  • Use page for full-stack, interactive UIs

Next Steps