Google Cloud

Workflows / Cloud Tasks Complete Guide: Serverless Orchestration

2026-05-24
NicheeLab Editorial Team

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.

Workflows

Key Features

  • Serverless, YAML / JSON based
  • Integrates with HTTP / GCP APIs / Cloud Functions / Cloud Run
  • Control structures: parallel, for loops, try-except, switch
  • Maximum execution time: 1 year
  • Connectors give one-click access to 50+ GCP services
  • Event-driven via Eventarc integration

Workflow YAML Example

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}

Cloud Tasks

Key Features

  • HTTP targets and App Engine targets
  • Delayed execution (scheduleTime)
  • Rate limiting (Token Bucket / Concurrent)
  • Retry configuration (max attempts / min backoff / max backoff)
  • Dead Letter Queue support
  • Automatic OIDC / OAuth token injection

Task Creation Example (Python)

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)

Pricing

ServicePrice
Workflows internal step$0.01 / 1000 steps
Workflows external step (HTTP)$0.025 / 1000 steps
Workflows free tier5,000 internal + 2,000 external steps per month
Cloud Tasks$0.40 per 1 million calls
Cloud Tasks free tier1 million calls per month

When to Use Which

RequirementRecommended Service
Ordered multi-API callsWorkflows
Parallel execution + result aggregationWorkflows
Delayed execution (10 min / 1 hour later)Cloud Tasks
Rate limiting required (e.g., 10 req/s)Cloud Tasks
Event-driven + automatic retryPub/Sub
Complex data ETL (Python-centric)Cloud Composer
Scheduled execution (cron)Cloud Scheduler

Typical Use Cases

Workflows

  • Customer onboarding (Auth → DB registration → email → Slack notification)
  • Vertex AI inference pipeline (image fetch → preprocessing → inference → result storage)
  • Multi-cloud integration (AWS S3 → Dataflow → BQ)

Cloud Tasks

  • Delayed user notifications (24 hours after sign-up)
  • Rate-limiting webhook calls
  • Async report generation
  • Reliable calls to external APIs (retry + backoff)

Comparison with Other Clouds

ItemWorkflowsAWS Step FunctionsAzure Logic Apps
LanguageYAML / JSONJSON (ASL)JSON + Visual
Max execution time1 year1 year (Standard)Unlimited
Pricing$0.01-0.025 per 1k steps$0.025 per 1k steps$0.000025/exec
SaaS connectorsFewMany1000+

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 / Apache Airflow 完全ガイド|DAG・Operator・Workflows 比較 (GCP)

Google Cloud Composer (Apache Airflow マネージド) の全機能解説。Composer 2/3、DAG 記述、Operator、料金、Workflows / Dataform との使い分け、AWS MWAA / Azure Data Factory 比較を網羅。

Eventarc 完全ガイド|CloudEvents・90+ イベントソース・サーバレストリガー (GCP)

Google Cloud Eventarc の全機能解説。CloudEvents 標準、Cloud Audit Logs / GCS / Pub/Sub トリガー、Cloud Run / Functions / Workflows ターゲット、料金、AWS EventBridge 比較を網羅。

Cloud Functions (2nd gen) 完全ガイド|1st gen 違い・料金・Lambda 比較 (GCP)

Google Cloud Functions 2nd gen の全機能解説。1st gen 違い、Eventarc 統合、Cloud Run ベース、対応言語、コールドスタート対策、AWS Lambda 比較、無料枠・料金体系を網羅。

Cloud Build 完全ガイド|CI/CD・cloudbuild.yaml・Private Pool・GitHub 連携 (GCP)

Google Cloud Cloud Build の全機能解説。cloudbuild.yaml、トリガー設定、Private Pool、Workload Identity、Build Approvals、Cloud Deploy 連携、AWS CodeBuild / Azure DevOps 比較を網羅。

Google Cloud is a trademark of Google LLC. For the latest information, see the official Workflows documentation.

Check what you learned with practice questions

Practice with certification-focused question sets

View GCP exam prep page
Author

NicheeLab Editorial Team

NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.


Related articles
Google Cloud

Google Cloud Certification Roadmap (2026)

Choose your GCP certification path — Foundational, Associate...

Google Cloud

CDL Cloud Digital Leader: Complete Exam Guide (2026)

Pass the Cloud Digital Leader exam — cloud business value, G...

Google Cloud

GAIL Generative AI Leader: Complete Exam Guide (2026)

Pass the Generative AI Leader exam — Gemini, Vertex AI, Work...

Google Cloud

Vertex AI Fundamentals for GCP Certs (2026)

Vertex AI basics every cert candidate needs — Workbench, Pip...

Google Cloud

Associate Cloud Engineer (ACE): Complete Guide (2026)

Pass the Associate Cloud Engineer exam — Console, gcloud, pr...

Browse all Google Cloud articles (103)
© 2026 NicheeLab All rights reserved.