You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Google Cloud Workflows is a fully managed orchestration service that lets you execute multi-step workflows by combining Google Cloud services, APIs, and custom code. Unlike event-driven, fire-and-forget patterns, Workflows provides a durable, stateful execution engine that tracks progress, handles errors, and supports long-running processes.
Workflows lets you define a series of steps — calling APIs, running Cloud Functions, invoking Cloud Run services, waiting for events, and performing logic — in a declarative YAML or JSON format. The Workflows engine executes each step, manages state, handles retries, and provides observability.
| Characteristic | Description |
|---|---|
| Fully managed | No servers, clusters, or infrastructure to manage |
| Durable execution | State is persisted — workflows survive infrastructure failures |
| Long-running | Workflows can run for up to one year |
| Serverless pricing | Pay per step executed (first 5,000 steps/month free) |
| Built-in error handling | Try/catch, retry policies, and custom error handling |
| Connectors | Pre-built connectors for 20+ Google Cloud services |
A workflow is defined as a series of steps. Each step performs an action — calling an HTTP endpoint, assigning variables, evaluating conditions, or iterating over data.
# A simple workflow that calls a Cloud Function and processes the result
main:
steps:
- get_data:
call: http.get
args:
url: https://europe-west2-my-project.cloudfunctions.net/getData
auth:
type: OIDC
result: api_response
- check_status:
switch:
- condition: \${api_response.body.status == "ready"}
next: process_data
- condition: \${api_response.body.status == "pending"}
next: wait_and_retry
next: handle_error
- process_data:
call: http.post
args:
url: https://my-service-xyz.run.app/process
auth:
type: OIDC
body:
data: \${api_response.body.records}
result: process_result
- wait_and_retry:
call: sys.sleep
args:
seconds: 30
next: get_data
- handle_error:
raise:
code: 500
message: "Unexpected status"
Workflows supports several step types for building complex logic:
Call any HTTP endpoint — Google Cloud APIs, Cloud Run services, Cloud Functions, or external APIs.
- call_api:
call: http.get
args:
url: https://api.example.com/data
headers:
Authorization: "Bearer my-token"
query:
limit: 100
result: response
Store and manipulate data between steps.
- assign_vars:
assign:
- name: "Cloud Functions"
- count: 42
- items: [1, 2, 3]
Branch workflow execution based on conditions.
- check_count:
switch:
- condition: \${count > 100}
next: high_volume
- condition: \${count > 10}
next: medium_volume
next: low_volume
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.