Skip to main content

Write your first workflow with Cadence

· 3 min read
Chris Qin
Applications Developer @ Uber

We have covered basic components of Cadence and how to implement a Cadence worker on local environment in previous blogs. In this blog, let's write your very first HelloWorld workflow with Cadence. I've started the Cadence backend server in background and registered a domain named test-domain. You may use the code snippet for the worker service in this blog Let's first write a activity, which takes a single string argument and print a log in the console.

func helloWorldActivity(ctx context.Context, name string) (string, error) {
logger := activity.GetLogger(ctx)
logger.Info("helloworld activity started")
return "Hello " + name + "!", nil
}

Bad practices and Anti-patterns with Cadence (Part 1)

· 3 min read
Chris Qin
Applications Developer @ Uber

In the upcoming blog series, we will delve into a discussion about common bad practices and anti-patterns related to Cadence. As diverse teams often encounter distinct business use cases, it becomes imperative to address the most frequently reported issues in Cadence workflows. To provide valuable insights and guidance, the Cadence team has meticulously compiled these common challenges based on customer feedback.

  • Reusing the same workflow ID for very active/continuous running workflows

Cadence organizes workflows based on their unique IDs, using a process called partitioning. If a workflow receives a large number of updates in a short period of time or frequently starts new runs using the continueAsNew function, all these updates will be directed to the same shard. Unfortunately, the Cadence backend is not equipped to handle this concentrated workload efficiently. As a result, a situation known as a "hot shard" arises, overloading the Cadence backend and worsening the problem.

Solution: Well, the best way to avoid this is simply just design your workflow in the way such that each workflow owns a uniformly distributed workflow ID across your Cadence domain. This will make sure that Cadence backend is able to evenly distribute the traffic with proper partition on your workflowIDs.

Implement a Cadence worker service from scratch

· 4 min read
Chris Qin
Applications Developer @ Uber

In the previous blog, we have introduced three critical components for a Cadence application: the Cadence backend, domain, and worker. Among these, the worker service is the most crucial focus for developers as it hosts the activities and workflows of a Cadence application. In this blog, I will provide a short tutorial on how to implement a simple worker service from scratch in Go.

To finish this tutorial, there are two prerequisites you need to finish first

  1. Register a Cadence domain for your worker. For this tutorial, I've already registered a domain named test-domain
  2. Start the Cadence backend server in background.

To get started, let's simply use the native HTTP package built in Go to start a process listening to port 3000. You may customize the port for your worker, but the port you choose should not conflict with existing port for your Cadence backend.

package main

import (
"fmt"
"net/http"
)

func main(){
fmt.Println("Cadence worker started at port 3000")
http.ListenAndServe(":3000", nil)
}

Understanding components of Cadence application

· 2 min read
Chris Qin
Applications Developer @ Uber

Cadence is a powerful, scalable, and fault-tolerant workflow orchestration framework that helps developers implement and manage complex workflow tasks. In most cases, developers contribute activities and workflows directly to their codebases, and they may not have a full understanding of the components behind a running Cadence application. We receive numerous inquiries about setting up Cadence in a local environment from scratch for testing. Therefore, in this article, we will explore the components that power a Cadence cluster.

There are three critical components that are essential for any Cadence application:

  1. A running Cadence backend server.
  2. A registered Cadence domain.
  3. A running Cadence worker that registers all workflows and activities.

Let's go over these components in more details.

Cadence Community Spotlight Update - June 2023

· 3 min read
Sharan Foga
Director of Operations & Customer Success @ Encube Technologies

We've had a short break but now we are back. Welcome to the latest of our regular monthly Community Spotlight updates that gives you news from in and around the Cadence community!

Please see below for a roundup of the highlights:

Cadence Release 1.0

Just in case you missed it - at the end of April Cadence v1.0 was officially released. This release is a significant milestone for the project and the community. It indicates that we are confident in the stability of the code that we can recommend it and promote it widely to more users. Kudos to everyone that worked together to make this release happen.

And the Uber team also gave Cadence a writeup on the Uber Engineering Blog so please take a look.

2023 Cadence Community Survey Results

· 4 min read
Ender Demirkaya
Senior Manager at Uber, Cadence. Author of the Software Engineering Handbook

We released a user survey earlier this year to learn about who our users are, how they use Cadence, and how we can help them. It was shared from our Slack workspace, cadenceworkflow.io Blog and LinkedIn. After collecting the feedback, we wanted to share the results with our community. Thank you everyone for filling it out! Your feedback is invaluable and it helps us shape our roadmap for the future.

Here are some highlights in text and you can check out the visuals to get more details:

using.png

job_role.png

Most of the people who replied to our survey were engineers who were already using Cadence, actively evaluating, or migrating from a similar technology. This was exciting to hear! Some of you have contacted us to learn more about benchmarks, scale, and ideal use cases. We will share more guidelines about this but until then, feel free to contact us over our Slack workspace for guidance.

Cadence Community Spotlight Update - March 2023

· 2 min read
Sharan Foga
Director of Operations & Customer Success @ Encube Technologies

Welcome to the latest of our regular monthly Community Spotlight updates that gives you news from in and around the Cadence community!

Please see below for a roundup of the highlights:

Cadence at Open Source Summit, North America

We are very pleased to let you know that a talk on Cadence has been accepted for the Linux Foundation's Open Source Summit, North America in Vancouver on 10th - 12th May 2023.

The talk called Cadence: The New Open Source Project for Building Complex Distributed Applications will be given by Ender Demirkaya and Emrah Seker If you are planning to attend the Open Source Summit then please don't forget to attend the talk and take time catch up with Ender and Emrah!

Community Activity

Our Slack #support channel has been very active over the last few months as we continue to get an continual stream of questions. Here are the stats:

  • February 2023 : 16 questions asked
  • March 2023 : 12 questions asked

All of these questions are being answered collaboratively by the community. Thanks everyone for sharing your knowledge and we are looking forward to receiving more of your questions!

Cadence Community Spotlight Update - March 2024

· 3 min read
Kevin Corbett
Open Source Community Manager | @instaclustr @NetApp

Welcome back to the latest in our regular Cadence community spotlight updates where we aim to deliver you news from in and around the Cadence community! It’s been a few months since our last update, so I have a bunch of exciting updates to share.

Let’s get started!

Proposal for Cadence Plugin System

Community member Mantas Sidlauskas drafted a thorough proposal around putting together a plugin system in Cadence. Aimed at enhancing the flexibility of integrating various components like storage, document search, and archival, this system encourages the use of external plugins, promoting innovation and reducing dependency complications. Your insights and feedback are crucial; learn more and contribute your thoughts at the link below:

A huge thank you to Mantas for initiating this work. This is an excellent example of how we can collaborate together to bring about new features that benefit us all.

Cadence Community Spotlight Update - February 2023

· 2 min read
Sharan Foga
Director of Operations & Customer Success @ Encube Technologies

Here’s the latest in our regular monthly Community Spotlight updates that gives you news from in and around the Cadence community!

Please see below for a roundup of the highlights:

Community Survey

We've been talking about doing a community survey for a while and during February we sent it out. We are still collating the results so it's not too late to send in your response.

The survey takes 5 minutes and is your opportunity to provide feedback to the project and highlight areas you think we need to focus on.

Use this Survey Link

Please take a few minutes to give us your opinion.

Cadence Community Spotlight Update - January 2023

· 3 min read
Sharan Foga
Director of Operations & Customer Success @ Encube Technologies

Happy New Year everyone! Here’s the latest in our regular monthly Community Spotlight updates that gives you news from in and around the Cadence community!

Please see below for a roundup of the highlights:

Closing Down Cadence Office Hours

We have been running Office Hours sessions every month since May last year. The aim was to give the community an opportunity to speak directly with some of the Cadence core developers and experts to answer questions on particular issues you may be having. We have found that the most preferred method for community questions has been the support Slack channel so have decided to stop this monthly call.

Thanks very much to Ender Demirkayaand the Uber team for making themselves available for these sessions.

Please remember that if you have question about Cadence or are facing a specific issue then you can post your question in our #support Slack channel. If you also post the details on StackOverflow with the cadence workflow tag then there will be a searchable history for others who encounter the same issue to find a solution.