Core Operations
think
AI reasoning (GPT, Claude, Llama, ML models)
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
html
Full-stack pages
form
Generate validated forms
queue
Message queue processing
telemetry
Analytics Engine metrics
Documentation: The
docs/ directory is a first-class component for API documentation.
See Building Documentation.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. Async Operations
Process background jobs and messages. queue - Message queue processing:6. 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

