Workflows and Cloud Tasks are GCP's serverless orchestration services. Workflows runs APIs/services in sequence; Cloud Tasks is an async task queue. Using them together lets you build complex serverless flows.
main:
params: [input]
steps:
- validate:
call: http.post
args:
url: https://api.example.com/validate
body: ${input}
result: validation
- check:
switch:
- condition: ${validation.body.valid}
next: process
- condition: true
return: "Invalid input"
- process:
parallel:
shared: [result]
branches:
- charge:
steps:
- call_charge:
call: googleapis.cloudfunctions.v2.functions.call
args:
name: projects/PROJECT/locations/asia-northeast1/functions/charge
body: ${input}
result: result.charge
- notify:
steps:
- call_notify:
call: googleapis.cloudfunctions.v2.functions.call
args:
name: projects/PROJECT/locations/asia-northeast1/functions/notify
body: ${input}
result: result.notify
- return:
return: ${result}from google.cloud import tasks_v2
client = tasks_v2.CloudTasksClient()
parent = client.queue_path('PROJECT', 'asia-northeast1', 'my-queue')
task = {
"http_request": {
"http_method": tasks_v2.HttpMethod.POST,
"url": "https://my-service.run.app/process",
"body": json.dumps({"user_id": 123}).encode(),
"headers": {"Content-Type": "application/json"},
"oidc_token": {
"service_account_email": "[email protected]",
},
},
"schedule_time": datetime.utcnow() + timedelta(minutes=10),
}
response = client.create_task(parent=parent, task=task)| Service | Price |
|---|---|
| Workflows internal step | $0.01 / 1000 steps |
| Workflows external step (HTTP) | $0.025 / 1000 steps |
| Workflows free tier | 5,000 internal + 2,000 external steps per month |
| Cloud Tasks | $0.40 per 1 million calls |
| Cloud Tasks free tier | 1 million calls per month |
| Requirement | Recommended Service |
|---|---|
| Ordered multi-API calls | Workflows |
| Parallel execution + result aggregation | Workflows |
| Delayed execution (10 min / 1 hour later) | Cloud Tasks |
| Rate limiting required (e.g., 10 req/s) | Cloud Tasks |
| Event-driven + automatic retry | Pub/Sub |
| Complex data ETL (Python-centric) | Cloud Composer |
| Scheduled execution (cron) | Cloud Scheduler |
| Item | Workflows | AWS Step Functions | Azure Logic Apps |
|---|---|---|---|
| Language | YAML / JSON | JSON (ASL) | JSON + Visual |
| Max execution time | 1 year | 1 year (Standard) | Unlimited |
| Pricing | $0.01-0.025 per 1k steps | $0.025 per 1k steps | $0.000025/exec |
| SaaS connectors | Few | Many | 1000+ |
What is the difference between Workflows and Cloud Tasks?
Workflows orchestrates multiple APIs/services in sequence (orchestration), while Cloud Tasks executes tasks via async queues (scheduling). They serve completely different roles.
Workflows or Cloud Composer: which should I choose?
Serverless, lightweight, API-integration focused → Workflows. Complex data pipelines, Python-centric → Composer. Workflows is dramatically cheaper.
What is the maximum execution time for Workflows?
1 year. Long-running jobs can wait using sleep/callback patterns. Ideal for workflows that exceed the 60-minute limit of Cloud Functions / Run.
What is the difference between Cloud Tasks and Pub/Sub?
Pub/Sub is broadcast-style (fan-out). Cloud Tasks is 1-to-1 task delivery with fine-grained rate limiting and retry control. Cloud Tasks is better suited for dispatching tasks to HTTP endpoints.
What is the pricing model?
Workflows: $0.01 per 1000 internal steps, $0.025 per 1000 external steps. Cloud Tasks: free up to 1 million calls per month, then $0.40 per million.
Can I combine it with Eventarc?
Yes. Eventarc → Workflows triggers (since 2022) enable event-driven orchestration. Integrates with GCS, Pub/Sub, and Audit Logs for automation.
Are there YAML examples for Workflows?
Workflows supports control structures like main, steps, parallel, try-except, and for loops. It executes HTTP calls, Cloud Functions, and GCP APIs in sequence.
How does it compare to AWS Step Functions and Azure Logic Apps?
Step Functions offers AWS integration and a visual editor. Logic Apps has 1000+ connectors and strong SaaS integration. Workflows is YAML-centric and easy to manage as code.
Related Articles: Orchestration
Cloud Composer (Managed Airflow) Guide (2026)
Cloud Composer fundamentals — environments, Airflow workflows, common orchestration patterns.
Eventarc Guide: Event-Driven on GCP (2026)
Eventarc fundamentals — triggers, Cloud Audit Log sources, Cloud Run/Functions targets.
Cloud Functions 2nd Gen (now Cloud Run Functions) (2026)
Cloud Functions 2nd gen — Cloud Run-based, supported triggers, common event-driven patterns.
Cloud Build Complete Guide: Triggers, Steps, Substitutions (2026)
Cloud Build — triggers, build steps, common CI patterns. The build engine of choice on GCP.
Google Cloud is a trademark of Google LLC. For the latest information, see the official Workflows documentation.
Practice with certification-focused question sets
View GCP exam prep pageNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Google Cloud Certification Roadmap (2026)
Choose your GCP certification path — Foundational, Associate...
CDL Cloud Digital Leader: Complete Exam Guide (2026)
Pass the Cloud Digital Leader exam — cloud business value, G...
GAIL Generative AI Leader: Complete Exam Guide (2026)
Pass the Generative AI Leader exam — Gemini, Vertex AI, Work...
Vertex AI Fundamentals for GCP Certs (2026)
Vertex AI basics every cert candidate needs — Workbench, Pip...
Associate Cloud Engineer (ACE): Complete Guide (2026)
Pass the Associate Cloud Engineer exam — Console, gcloud, pr...