VOOZH about

URL: https://thenewstack.io/meet-cadence-workflow-engine-for-taming-complex-processes/

⇱ Meet Cadence: Workflow Engine for Taming Complex Processes - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2022-01-27 04:00:10
Meet Cadence: Workflow Engine for Taming Complex Processes
contributed,sponsor-instaclustr,sponsored,sponsored-post-contributed,
Open Source / Software Development

Meet Cadence: Workflow Engine for Taming Complex Processes

The Cadence code platform and workflow engine can abstract away the most difficult complexities in developing high-scale distributed applications.
Jan 27th, 2022 4:00am by Ben Bromhead and Emrah Seker
👁 Featued image for: Meet Cadence: Workflow Engine for Taming Complex Processes
Feature image via Pixabay  
Instaclustr sponsored this post.
Ben Bromhead
Ben Bromhead is co-founder and chief technology officer at Instaclustr, which provides a platform around open source data technologies.
Developers building any modern application face the challenge of complex interactions with third-party APIs, internal services and long-running business processes. These processes require developers to track complex states, enable responses to asynchronous events and achieve communication with external dependencies that are potentially unreliable. Developers regularly approach these complex needs with equally complex solutions — rigging together systems involving stateless services, databases, retry algorithms and scheduled job queues.
Emrah Seker
Emrah is a staff software engineer at Uber. His software development experience covers a wide span from kernel-level programming to distributed web services. He loves working on cloud computing and highly scalable systems. Emrah’s previous companies include Box, Microsoft and Siemens.
However, these unwieldy systems bury the application’s business logic beneath all that complexity and often face availability issues due to their reliance on dispersed and untested components. Ultimately, developer productivity suffers under the weight of maintaining these sprawling and burdensome systems. Cadence is an open source fault-oblivious stateful code platform and workflow engine specifically designed to solve this development challenge. Originally developed and open-sourced by Uber — and now adopted and developed by an increasing number of companies including Uber and Instaclustr — Cadence can abstract away the most difficult complexities associated with developing high-scale distributed applications.

How Does Cadence Work?

Cadence preserves the entire state of an application in durable virtual memory not associated with any specific process. The stored application state includes all call parameters and returned results for user-defined activities. It then uses that information to catch up and replay workflows that get interrupted. Cadence has libraries that enable developers to create and coordinate workflows using popular languages such as Java, Go, Python and Ruby. Cadence services, such as workers, are largely stateless and leverage a data store for task/workflow persistence. Supported storage options include open source Cassandra and MySQL/PostgreSQL, and an adapter is available for any database featuring multi-row single shard transactions. Multiple service deployment models are available as well. For example, Uber uses multitenant Cadence clusters shared by hundreds of applications. In this way, Cadence empowers developers with a new tool for writing and managing distributed applications while maintaining application durability, availability and scalability.

How Does Cadence Help Developers?

Cadence offers a lot of value to development teams that work with microservices-based architectures that require fault tolerance, as well as applications that include myriad multistep concurrent workflows or interact with multiple third-party APIs. But Cadence’s versatility lends itself to nearly any scenario involving multiple requests and replies. Developers can use Cadence to create applications that serve as workflow and orchestration platforms, and get back tremendous boosts to developer productivity by replacing traditional strategies for leveraging databases and task queues.
Instaclustr delivers reliability at scale through an integrated data platform of open source technologies such as Apache Cassandra®, Apache Kafka®, Apache SparkTM, ElasticsearchTM, RedisTM, Apache ZooKeeperTM, and PostgreSQL®.
Learn More
The latest from Instaclustr
Getting more specific, the advantages of Cadence are demonstrated in the following use cases:
  • Periodic execution (distributed cron). Cadence guarantees the execution of periodically-scheduled business logic, complete with complex error handling, retry policies and asynchronous history event replication. Importantly, Cadence supports the execution of jobs in parallel and at a massive scale, with the capability to execute millions of workflows concurrently.
  • Microservice orchestration. Business processes implemented as multiple microservices calls must have all those calls succeed, even if downstream services fail. Cadence guarantees completion of workflow code, supporting unlimited retries and making compensation logic simple to develop, such as the SAGA pattern.
  • Polling. Polling jobs that periodically check for a state change — often used for monitoring or file processing — are particularly well-matched with Cadence’s support for long-running activities and unlimited retries.
  • Event-driven applications. Cadence directly supports asynchronous events and abstracts away the complexity of state persistence for developers, making it simple to implement applications that listen to multiple event sources.
  • Storage scanning. Cadence enables scalable, resilient and complete scans of large partitioned datasets, even across billions of files.
  • Batch jobs. For batch jobs where external API calls may fail, Cadence guarantees durability.
  • Infrastructure provisioning. Long-running provisioning operations can suffer from intermittent failures; Cadence prevents this from happening. The platform further supports routing of activity execution to specific processes or hosts, as well as scalable fault-tolerant locking behavior to execute a single mutation on a resource at a time.
  • CI/CD pipelines and application deployment. By enabling developers’ focus on business logic, Cadence offers an ideal platform for building deployment solutions.
  • Operational management. Cadence enables automated management and recovery for creating self-operating databases and more.
  • Interactive applications. Cadence’s performance and scalability enable UI session state tracking and simultaneous background operation execution.
  • DSL workflows. The Cadence SDK allows developers to write fault-tolerant, scalable, durable applications that interpret DSL process definitions.
  • Big data and ML. Cadence offers a powerful control plane for big data and machine learning solutions, providing task execution routing to control how ML models and other files are allocated.

How Can You Get Started?

To get started using Cadence, grab the GitHub repo for the Cadence server or the Docker image.

Cadence: Java Hello World example

The following example demonstrates how to create and run a Hello World application in Cadence using Java. First, get the latest Cadence Java client here. Include it as a dependency in your Java project, which looks like this in Gradle.
	compile group: 'com.uber.cadence', name: 'cadence-client', version: '<latest_version>'

Add these dependencies, required by cadence-client.
compile group: 'commons-configuration', name: 'commons-configuration', version: '1.9'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'

Next, compile this code.
import com.uber.cadence.workflow.Workflow;

import com.uber.cadence.workflow.WorkflowMethod;

import org.slf4j.Logger;

public class GettingStarted {

private static Logger logger = Workflow.getLogger(GettingStarted.class);

public interface HelloWorld {

@WorkflowMethod

void sayHello(String name);

}

}
Add this logback config file in your classpath.
<configuration>
 <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
 <!-- encoders are assigned the type
 ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
 <encoder>
 <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
 </encoder>
 </appender>
 <logger name="io.netty" level="INFO"/>
 <root level="INFO">
 <appender-ref ref="STDOUT" />
 </root>
</configuration>

Next, implement the Hello World workflow by adding HelloWorldImpl with the sayHello method:
import com.uber.cadence.worker.Worker;
import com.uber.cadence.workflow.Workflow;
import com.uber.cadence.workflow.WorkflowMethod;
import org.slf4j.Logger;

public class GettingStarted {

 private static Logger logger = Workflow.getLogger(GettingStarted.class);

 public interface HelloWorld {
 @WorkflowMethod
 void sayHello(String name);
 }

 public static class HelloWorldImpl implements HelloWorld {

 @Override
 public void sayHello(String name) {
 logger.info("Hello " + name + "!");
 }
 }
}

Link this workflow to the Cadence framework by registering it with a worker connected to a Cadence Service (the worker connects to the locally running service by default).
public static void main(String[] args) {
 WorkflowClient workflowClient =
 WorkflowClient.newInstance(
 new WorkflowServiceTChannel(ClientOptions.defaultInstance()),
 WorkflowClientOptions.newBuilder().setDomain(DOMAIN).build());
 // Get worker to poll the task list.
 WorkerFactory factory = WorkerFactory.newInstance(workflowClient);
 Worker worker = factory.newWorker(TASK_LIST);
 worker.registerWorkflowImplementationTypes(HelloWorldImpl.class);
 factory.start();
}

Now, execute the Hello World workflow with the CLI by running the worker program.
> docker run --network=host --rm ubercadence/cli:master --do test-domain workflow start --tasklist HelloWorldTaskList --workflow_type HelloWorld::sayHello --execution_timeout 3600 --input \"World\"

Started Workflow Id: bcacfabd-9f9a-46ac-9b25-83bcea5d7fd7, run Id: e7c40431-8e23-485b-9649-e8f161219efe
The last line of the program’s output will now resemble this:
13:40:28.308 [workflow-root] INFO c.u.c.samples.hello.GettingStarted - Hello World!
A look at the workflow execution history will further yield valuable information for developers to use in troubleshooting their applications. Given the advantages Cadence offers to organizations and application developers ready to benefit from its rather unique strengths — and its availability as free and open source software! — those interested should be quick to explore the platform’s inviting potential.
Instaclustr delivers reliability at scale through an integrated data platform of open source technologies such as Apache Cassandra®, Apache Kafka®, Apache SparkTM, ElasticsearchTM, RedisTM, Apache ZooKeeperTM, and PostgreSQL®.
Learn More
The latest from Instaclustr
TRENDING STORIES
Ben Bromhead is co-founder and chief technology officer at Instaclustr, which provides a platform around open source data technologies.
Read more from Ben Bromhead
Emrah is a staff software engineer at Uber. His software development experience covers a wide span from kernel-level programming to distributed web services. He loves working on cloud computing and highly scalable systems. Emrah’s previous companies include Box, Microsoft and...
Read more from Emrah Seker
Instaclustr sponsored this post.
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Pragma, Docker.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.