Skip to main content

What You’ll Build

A simple company intelligence workflow that:
  1. Fetches company data from an API
  2. Analyzes it with Claude
  3. Returns structured results
Running on Cloudflare Workers at 200+ locations globally.

Prerequisites

Step 1: Create a Project

The Ensemble CLI provides access to all tools: Conductor (orchestration), Edgit (versioning), and Cloud (managed platform). No installation needed - just use npx.
For CI/CD pipelines, use npx @ensemble-edge/conductor init my-project -y to skip interactive prompts.
The init command will:
  1. Check your Wrangler authentication (prompts to login if needed)
  2. Ask which AI provider you’ll use (Anthropic, OpenAI, or Cloudflare)
  3. Securely store your API key
  4. Create the project structure
This creates:

Step 3: Write Your First Ensemble

Edit ensembles/company-intel.yaml:

Step 4: Configure Cloudflare

You need two things:

1. API Tokens

Add to .dev.vars (local development):
Add to Cloudflare dashboard (production):
Edit wrangler.toml:
Create KV namespace:

Step 5: Test Locally

Response:
Run it again - see "cached": true and <10ms response time.

Step 6: Deploy to Production

Test production:
You’re live. Globally. With caching. In 5 minutes.

What Just Happened?

  1. Edge Execution - Your workflow runs on Cloudflare’s network at 200+ locations
  2. Sub-50ms Cold Starts - First request takes ~40ms, cached requests <10ms
  3. Built-in Caching - HTTP responses cached in KV automatically
  4. AI Gateway - All AI calls tracked and cached via Cloudflare AI Gateway
  5. Structured Outputs - JSON response format enforced

Next Steps

Add Component Versioning (Edgit)

Now reference it in your ensemble:

Add A/B Testing

Add More Operations

Use Starter Kit Agents

Learn More

Ensemble CLI

Full CLI documentation

Core Concepts

Understand components, agents, and ensembles

Operations Reference

All available operations (think, code, http, storage, etc.)

Starter Kit

Ready-to-use agents (scraper, validator, RAG, etc.)

Troubleshooting

Add your API key to .dev.vars for local development:
For production, add it in Cloudflare dashboard under Workers > Settings > Variables.
Create a KV namespace first:
Copy the ID to your wrangler.toml file.
First request always takes longer (~100-200ms). Subsequent requests should be <50ms cold start + execution time.Enable caching to get <10ms for repeated requests:
Make sure you’ve configured AI Gateway in Cloudflare dashboard:
  1. Go to AI > AI Gateway
  2. Create a gateway
  3. Add the gateway ID to your wrangler.toml
That’s it. You’ve got a production AI workflow running on the edge with caching, versioning, and infinite scale.No Docker, no Kubernetes, no server management. Just Git, YAML, and Cloudflare Workers.