Workflow
Creates a workflow binding for orchestrating and automating tasks in Cloudflare Workers.
Props
Name of the workflow.
className if provided, otherwise id
- Max length: 64
- Min length: 1
Name of the class that implements the workflow.
workflowName if provided, otherwise id
- Max length: 255
- Min length: 1
Name of the script containing the workflow implementation.
Bound worker script
Output
Unique identifier for the workflow.
Class name used to identify the workflow.
Name of the script containing the workflow implementation.
Type identifier for the binding.
Examples
Basic Workflow
const workflow = Workflow("my-workflow", {
workflowName: "my-workflow",
className: "MyWorkflow"
});
const worker = await Worker("api", {
entrypoint: "./src/worker.ts",
bindings: {
WORKFLOW: workflow
}
});
OFAC Compliance Workflow
const worker = await Worker("compliance", {
entrypoint: "./src/worker.ts",
bindings: {
OFAC_WORKFLOW: Workflow("OFACWorkflow", {
className: "OFACWorkflow",
workflowName: "ofac-workflow"
})
}
});