wrangler.jsonc.
Define and export your workflows
Create a file (e.g. The key name in the
workflows.ts) that defines your workflows and calls createDurableWorkflows. This generates the Workflows Durable Object class and the typed WorkflowClient.workflows object ("processOrder") is what clients use to reference the workflow. The WorkflowClient exported here is already typed to those workflow names and their input types.Export Workflows from your worker entry point
Cloudflare requires Durable Object classes to be exported from the worker’s main entry file. Re-export the
Workflows class there:Configure wrangler.jsonc
Add a The
durable_objects binding and a migration entry to your wrangler.jsonc:name field ("WORKFLOWS") is the binding name you’ll use in your Env type and when creating a client: WorkflowClient.fromBinding(env.WORKFLOWS).The
migrations array is required by Cloudflare for Durable Objects. If you don’t include it, the binding will fail to deploy.Next: using the client
Once the worker is deployed, useWorkflowClient to start and manage workflow instances. See Client.