Overview
Access the Workflows API:Workflows
Manage workflow definitions.Create or update a workflow
Create or modify a workflow definition.string
required
Name for the workflow
string
required
Your Cloudflare account ID
string
required
The exported Workflow class name from your Worker
string
required
The Worker script that contains the Workflow class
string
The workflow ID
string
The workflow name
string
The Workflow class name
string
The associated Worker script
string
ISO 8601 timestamp when the workflow was created
string
ISO 8601 timestamp when the workflow was last modified
List workflows
Retrieve all workflows in your account.string
required
Your Cloudflare account ID
string
Filter workflows by name
number
Page number for pagination
number
Number of workflows per page (default: 20, max: 100)
object
Instance count statistics
number
Number of queued instances
number
Number of running instances
number
Number of completed instances
number
Number of errored instances
Get a workflow
Retrieve details about a specific workflow.string
required
The workflow name
string
required
Your Cloudflare account ID
Delete a workflow
Delete a workflow definition.string
required
The workflow name to delete
string
required
Your Cloudflare account ID
Instances
Manage workflow execution instances.Create an instance
Start a new workflow instance.string
required
The workflow name
string
required
Your Cloudflare account ID
object
Parameters to pass to the workflow instance
string
The instance ID
string
The workflow name
string
Instance status: ‘queued’, ‘running’, ‘complete’, ‘errored’, or ‘terminated’
string
ISO 8601 timestamp when the instance was created
List instances
Retrieve all instances for a workflow.string
required
The workflow name
string
required
Your Cloudflare account ID
string
Filter by status: ‘queued’, ‘running’, ‘complete’, ‘errored’, ‘paused’, ‘waiting’, ‘terminated’, or ‘waitingForPause’
number
Page number for pagination
number
Number of instances per page (default: 20, max: 100)
Get an instance
Retrieve details about a specific workflow instance.string
required
The workflow name
string
required
The instance ID
string
required
Your Cloudflare account ID
string
The instance ID
string
Current instance status
object
The workflow output (if completed)
object
Error details (if errored)
Bulk instance operations
Terminate or pause multiple instances.string
required
The workflow name
string
required
Your Cloudflare account ID
string
required
Action to perform: ‘terminate’ or ‘pause’
array
required
Array of instance IDs to act on
Versions
Track workflow version history.List versions
Retrieve version history for a workflow.Get a version
Retrieve details about a specific workflow version.Defining workflows in Workers
Define a Workflow class in your Worker:Best practices
- Idempotent steps: Each step should be idempotent to handle retries
- Step naming: Use descriptive step names for easier debugging
- Error handling: Use try-catch blocks within steps for granular error handling
- State management: Store state in step results, not in memory
- Timeouts: Be aware of step execution time limits
- Monitoring: Regularly check instance status and error rates