Day #1 with Cloud Workflows: your first step to “Hello World”
With more and more interconnected services, making sense of their interactions becomes critical. With Google Cloud Workflows, developers can orchestrate and automate such complex systems by creating serverless workflows.
In this series of articles, we will learn together how to use Cloud Workflows, and get to know all its features, with short and easy to read tutorials. For our first day, we’ll discover and use the Workflows UI in the cloud console. We will create a simple “hello world” workflow, consisting of a simple step. Going further, in the coming days, we’ll learn more about advanced features. But first things first!
In the Google Cloud console UI, you can locate Workflows in the Tools section of the hamburger menu:
You can pin this menu item, to have it stick at the top of the list.
The first time you are accessing this page, you’ll be greeted with the following screen, which will ask you to enable the Workflows API. So just click on “ENABLE”:
Find a name for your workflow (it should start with a letter). You can provide an optional description. Currently, only “us-central1” is available for the beta of Cloud Workflows, but more regions will be available later on.
Notice that we have to select a service account that Workflows will use to call other Google Cloud APIs, however here, there’s a warning telling us that the project requires a service account. As I’ve created a brand new project, I didn’t have any service account created. If you had used, for example, Cloud Functions beforehand, a default service account would have been created. If you need to create a service account, you can create one in “IAM & Admin > Service Accounts”, then use this one.
My first workflow will be called “w01-first-workflow”:
This first workflow consists in one single step, called “sayHello”, and whose sole purpose is to return a hello world message:
return: Hello from Cloud Workflows!
As you can see, workflow definitions are written using the YAML configuration language.
Click “DEPLOY” to deploy the workflow. You will then see the details of your new workflow. In the “executions” tab, you can see past executions.
In the coming days, we will have a closer look at the structure of workflow definitions (its steps), how to define input arguments, but also how to create an execution of a workflow from the command-line.