You can now create and manage Workflows using Terraform, now supported in the Cloudflare Terraform provider v5.11.0. Workflows allow you to build durable, multi-step applications — without needing to worry about retrying failed tasks or managing infrastructure.
Now, you can deploy and manage Workflows through Terraform using the new cloudflare_workflow resource:
resource "cloudflare_workflow" "my_workflow" { account_id = var.account_id workflow_name = "my-workflow" class_name = "MyWorkflow" script_name = "my-worker"}Examples
Here are full examples of how to configure cloudflare_workflow in Terraform, using the existing cloudflare_workers_script resource, and the beta cloudflare_worker_version resource.
With cloudflare_workflow and cloudflare_workers_script
resource "cloudflare_workers_script" "workflow_worker" { account_id = var.cloudflare_account_id script_name = "my-workflow-worker"
content_file = "${path.module}/../dist/worker/index.js" content_sha256 = filesha256("${path.module}/../dist/worker/index.js") main_module = "index.js"}
resource "cloudflare_workflow" "workflow" { account_id = var.cloudflare_account_id workflow_name = "my-workflow" class_name = "MyWorkflow" script_name = cloudflare_workers_script.workflow_worker.script_name}With cloudflare_workflow, and the new beta resources
You can more granularly control the lifecycle of each Worker resource using the beta cloudflare_worker_version resource, alongside the cloudflare_worker and cloudflare_workers_deployment resources.
resource "cloudflare_worker" "workflow_worker" { account_id = var.cloudflare_account_id name = "my-workflow-worker"}
resource "cloudflare_worker_version" "workflow_worker_version" { account_id = var.cloudflare_account_id worker_id = cloudflare_worker.workflow_worker.id
main_module = "index.js"
modules = [{ name = "index.js" content_file = "${path.module}/../dist/worker/index.js" content_type = "application/javascript+module" }]}
resource "cloudflare_workers_deployment" "workflow_deployment" { account_id = var.cloudflare_account_id script_name = cloudflare_worker.workflow_worker.name
strategy = "percentage" versions = [{ version_id = cloudflare_worker_version.workflow_worker_version.id percentage = 100 }]}
resource "cloudflare_workflow" "my_workflow" { account_id = var.cloudflare_account_id workflow_name = "my-workflow" class_name = "MyWorkflow" script_name = cloudflare_worker.workflow_worker.name}Try it out
- Get started with the Cloudflare Terraform provider (v5.11.0) and the new
cloudflare_workflowresource.
Source: Cloudflare
Latest Posts
- (Updated) Outlook: Share Word, Excel and PowerPoint local files via the new Outlook for Windows [MC1245222]
![(Updated) Outlook: Share Word, Excel and PowerPoint local files via the new Outlook for Windows [MC1245222] 2 pexels skitterphoto 390089](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- (Updated) Microsoft 365 Copilot will use private community and event content as grounding sources [MC1296480]
![(Updated) Microsoft 365 Copilot will use private community and event content as grounding sources [MC1296480] 3 pexels nextvoyage 3763903](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- (Updated) Viva Engage digest updates: Improvements to weekly [MC1269207]
![(Updated) Viva Engage digest updates: Improvements to weekly [MC1269207] 4 pexels olly 3761504](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- (Updated) Microsoft 365 Apps: Cloud Update adds update health reporting [MC1289720]
![(Updated) Microsoft 365 Apps: Cloud Update adds update health reporting [MC1289720] 5 pexels googledeepmind 25626583](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)

![(Updated) Outlook: Share Word, Excel and PowerPoint local files via the new Outlook for Windows [MC1245222] 2 pexels skitterphoto 390089](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-skitterphoto-390089-150x150.webp)
![(Updated) Microsoft 365 Copilot will use private community and event content as grounding sources [MC1296480] 3 pexels nextvoyage 3763903](https://mwpro.co.uk/wp-content/uploads/2025/06/pexels-nextvoyage-3763903-150x150.webp)
![(Updated) Viva Engage digest updates: Improvements to weekly [MC1269207] 4 pexels olly 3761504](https://mwpro.co.uk/wp-content/uploads/2025/06/pexels-olly-3761504-150x150.webp)
![(Updated) Microsoft 365 Apps: Cloud Update adds update health reporting [MC1289720] 5 pexels googledeepmind 25626583](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-googledeepmind-25626583-150x150.webp)
