BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Cloudflare Introduces Workflows for Building Scalable Resilient Multi-Step Applications

Cloudflare Introduces Workflows for Building Scalable Resilient Multi-Step Applications

This item in japanese

Cloudflare has launched "Workflows," a durable execution engine on its Cloudflare Workers platform, which is now in open beta. Workflows enable developers to create scalable, multi-step applications that can persist through failures like network instability, server downtimes, or code errors, offering automated retries and state management without manual infrastructure handling.

Workflows were introduced earlier this year. They allow automated retries to ensure that processes can restart from the point of failure, reducing the risk of data loss and operational delays. Each step in a workflow functions independently, with state maintained throughout the process, so tasks are more modular, and failures are more contained. For developers, this independence enables granular error handling, so individual components of a workflow can be re-run or modified without impacting the entire application.

Developers can create a multi-step application with steps that only run when specific conditions are met. This can streamline processes by removing unnecessary actions and providing the ability to execute tasks conditionally, enhancing resource efficiency and ensuring that only essential processes are run at each stage.

The authors of the company blog post on Workflows write:

The core building block of every Workflow is the step: an individually retriable component of your application that can optionally emit state. That state then persists, even if subsequent steps fail. This means that your application doesn’t have to restart, allowing it to not only recover more quickly from failure scenarios but also avoid doing redundant work.

(Source: Cloudflare blog post)

Workflows isn’t a standalone feature; it’s part of Cloudflare’s broader suite of cloud-based developer tools, which includes services like Durable Objects and Workers KV (Key-Value) storage. These integrations mean developers can harness the best of Cloudflare’s cloud ecosystem, such as using Durable Objects to maintain stateful data across serverless functions or Workers KV to access fast, globally distributed storage.

With Workflows, Cloudflare aims to support more advanced use cases. Some scenarios that Cloudflare envisions for Workflows include batch processing for file handling, workflows involving machine learning models, and other compute-intensive tasks. This capability suits enterprises and developers looking to build applications involving data pipelines, automation, and real-time processing at scale.

Clayton King, a CTO and data scientist at Fount, tweeted:

I was skeptical after my experience with Queues (great product, just a bummer Vectorize can't run locally while Queues can't run remote on dev). But Workflows is fantastic. Perfect for offloading long-running LLM jobs while keeping the front end feeling snappy.

Cloudflare's durable workflows are not the only cloud offering; Microsoft offers durable functions with similar features, and AWS provides Step Functions. Ashley Peacock, a staff software engineer at Simply Business, responds in a tweet when asked if Step Functions is like Cloudflare Workflows:

I’ve not used Step Functions a ton, but I think writing them with IaC and the glue can be a bit involved. Workflows will be super simple to integrate with any service, as you’ll have bindings. The fact that they are defined with a Cloudflare-provided DSL is pretty nice, very good DX, in my opinion.

Other offerings include Netlify Functions, Vercel Functions, and Fastly Compute@Edge.

Lastly, Workflows are priced just like Cloudflare Workers, which introduced CPU-based pricing only for active CPU time and requests.

About the Author

Rate this Article

Adoption
Style

BT