Workflows Study Notes
Workflows is a fully managed, serverless orchestration service that connects Google Cloud services and HTTP APIs in a defined sequence using YAML or JSON syntax. Each execution runs steps that can call services, evaluate conditions, handle errors with retries, and wait for callbacks. You pay per step executed and there is no infrastructure to provision or maintain.
Key facts
- A workflow definition is written in YAML or JSON and consists of steps that perform assignments, service calls, switches for conditions, loops, and error handling blocks.
- Workflows has built-in connectors for many Google Cloud services, such as BigQuery, Pub/Sub, Cloud Storage, and Firestore, which handle authentication and request formatting for calls.
- Standard library functions and expressions let a workflow parse JSON, manipulate strings and lists, work with dates, and compute values between steps without external code.
- Error handling uses try and except blocks with configurable retry policies, including backoff, so a transient failure in one step does not fail the whole execution immediately.
- A workflow can wait for a callback, pausing execution until an external system sends an HTTP request to a generated callback endpoint, which suits human approval steps.
- Executions are serverless and scale automatically, and a workflow that is not running consumes no compute resources, with billing based on steps executed.
- Workflows can be triggered by Eventarc events, Cloud Scheduler, Pub/Sub through an intermediary in some designs, direct API calls, or the console and gcloud for testing.
- Arguments are passed to an execution as JSON, step results are stored in variables, and the execution history shows inputs, outputs, and errors for each step.
- By default, a single execution has limits on duration and steps at the time of writing, so very long-running or extremely high-step processes may need a different orchestration design.
What the exam expects you to know
- The exam tests Workflows as the lightweight serverless orchestration answer for sequencing API calls, such as provisioning resources in order or coordinating several services.
- Know that definitions are YAML, executions are stateless and serverless, and pricing follows steps, contrasting with Composer's always-on Airflow environment.
- Expect questions on error handling and retries per step, and on using conditions to branch based on a previous step's result.
- Candidates should recognise callback endpoints for long waits, such as pausing for a human approval or an external batch job to finish.
- Understand triggering options: Eventarc for event-driven starts, Scheduler for timed starts, and direct execution through gcloud or the API for on-demand runs.
- Questions may ask how to call another Google Cloud service without writing a function, with a Workflows connector as the intended low-code answer.
Workflows vs Cloud Composer: when to use which
Choose Workflows when the process is a sequence of Google Cloud API and HTTP calls, needs to scale to zero, and can be expressed cleanly in YAML steps with conditions and retries. Choose Cloud Composer when the team needs Apache Airflow's Python DAGs, extensive operator library, and scheduling features for complex data engineering pipelines. Workflows is event-friendly and serverless with per-step billing, while Composer runs a managed but always-on environment. Exam clue: orchestrating services and APIs with no infrastructure points to Workflows; Airflow, DAGs, and data pipeline scheduling point to Composer. See also the Cloud Composer notes.
Useful gcloud commands
gcloud workflows list --location=us-central1
gcloud workflows execute my-workflow --location=us-central1 --data='{"input":"value"}'
gcloud workflows executions list my-workflow --location=us-central1Common exam traps
- Workflows is not a data-processing engine: a step should call BigQuery, Dataflow, or another service to process large data, not try to transform it inline.
- An execution that waits on a callback is paused, not free of all limits: very long business processes must still respect execution duration and step limits.
- Workflows does not provide Airflow DAG compatibility, so migrating existing Airflow pipelines is a Composer task, not a Workflows rewrite by default.
- Treating a workflow as a message queue is a mistake: it orchestrates steps for one execution, while Pub/Sub and Cloud Tasks handle messaging and queued work.
Frequently asked questions
How is a Workflows execution triggered?
Executions can be started through the Cloud Console, the gcloud workflows execute command, or the Workflows API, and they can be triggered automatically by Eventarc events or on a schedule through Cloud Scheduler calling the workflow. Each execution receives JSON arguments, runs independently, and records its step history, result, and any errors for inspection afterwards.
What can a single workflow step do?
A step can assign variables, call an HTTP endpoint or a Google Cloud service through a connector, evaluate a switch condition to choose the next step, iterate over a list with a loop, raise a custom error, or pause to wait for a callback. Combining these primitives lets a definition express branching business logic without deploying custom code.
How does Workflows handle a failing step?
Steps can be wrapped in try and except blocks with a retry policy that repeats the call with backoff when the error matches specified conditions, such as transient server errors. If retries are exhausted, the except block can run fallback steps, assign a default value, or end the execution with a clear error, making failures predictable and observable in the execution history.
Study aid disclaimer: Cloud Cert Notes is an independent educational study aid. It is not affiliated with, endorsed by, or sponsored by Google, Microsoft, Amazon, Oracle, or Alibaba. Google Cloud, Associate Cloud Engineer, and Cloud Digital Leader are trademarks of Google LLC; all other certification names and product names are trademarks of their respective owners. Always confirm service details against the official provider documentation before sitting an exam.