What You’ll Build
A simple company intelligence workflow that:- Fetches company data from an API
- Analyzes it with Claude
- Returns structured results
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.- Check your Wrangler authentication (prompts to login if needed)
- Ask which AI provider you’ll use (Anthropic, OpenAI, or Cloudflare)
- Securely store your API key
- Create the project structure
Step 3: Write Your First Ensemble
Editensembles/company-intel.yaml:
Step 4: Configure Cloudflare
You need two things:1. API Tokens
Add to.dev.vars (local development):
2. Bindings (Optional but Recommended)
Editwrangler.toml:
Step 5: Test Locally
"cached": true and <10ms response time.
Step 6: Deploy to Production
What Just Happened?
- Edge Execution - Your workflow runs on Cloudflare’s network at 200+ locations
- Sub-50ms Cold Starts - First request takes ~40ms, cached requests <10ms
- Built-in Caching - HTTP responses cached in KV automatically
- AI Gateway - All AI calls tracked and cached via Cloudflare AI Gateway
- Structured Outputs - JSON response format enforced
Next Steps
Add Component Versioning (Edgit)
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
Error: Missing API key
Error: Missing API key
Add your API key to For production, add it in Cloudflare dashboard under Workers > Settings > Variables.
.dev.vars for local development:Error: KV namespace not found
Error: KV namespace not found
Create a KV namespace first:Copy the ID to your
wrangler.toml file.Cold starts taking longer than 50ms
Cold starts taking longer than 50ms
First request always takes longer (~100-200ms). Subsequent requests should be <50ms cold start + execution time.Enable caching to get <10ms for repeated requests:
AI Gateway not working
AI Gateway not working
Make sure you’ve configured AI Gateway in Cloudflare dashboard:
- Go to AI > AI Gateway
- Create a gateway
- 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.

