Operations
Operations are the building blocks of agents. Think of them as atomic actions - the primitives you compose into workflows. Every agent uses operations to do work. There are 12 operations, each doing one thing well.The 12 Operations
think
AI reasoning (GPT, Claude, Llama)
code
JavaScript/TypeScript execution
storage
KV, D1, R2, Vectorize access
http
HTTP requests to APIs
tools
MCP tools and skills
Send emails
sms
Send SMS messages
html
Render HTML
Generate PDFs
page
Full-stack pages
ml
Machine learning (coming soon)
Operation Basics
Declaration
Operations are declared in agents:Execution
Operations run when the agent executes:Chaining
Operations reference each other’s outputs:Operation Categories
1. Compute Operations
Execute logic and transform data. think - AI reasoning:2. Data Operations
Access and manipulate data stores. storage - All Cloudflare storage:3. Communication Operations
Send messages and notifications. http - HTTP requests:4. Presentation Operations
Render content for users. html - HTML rendering:5. Extension Operations
Extend functionality with external tools. tools - MCP tools and skills:Operation Features
Conditional Execution
Skip operations based on conditions:Caching
Cache operation results:Retry Logic
Automatic retries on failure:Parallel Execution
Operations without dependencies run in parallel:Operation Reference
Common Configuration
All operations support:Output Access
Access operation outputs using template syntax:Best Practices
- Use the Right Operation - Each operation is optimized for its use case
- Cache Expensive Operations - Especially AI and HTTP calls
- Handle Failures - Use conditions and retry logic
- Optimize for Parallel - Don’t create unnecessary dependencies
- Keep Operations Simple - Single responsibility per operation
- Use Built-in Features - Leverage caching, retry, and conditions
- Monitor Performance - Track operation execution times
- Test Thoroughly - Unit test each operation

