Orchestrating Image Processing with Workflows and Cloud Logging

PCD By islever Editorial Last updated

Short answer

C Implement Workflows to orchestrate the resize, crop, and watermark image tasks, and use Cloud Logging for workflow monitoring.

Question

You are developing a new image processing application that needs to handle various tasks, such as resizing, cropping, and watermarking images. You also need to monitor the workflow and ensure that it scales efficiently when there are large volumes of images. You want to automate the image processing tasks and workflow monitoring with the least effort. What should you do?
  1. Employ Cloud Composer to manage the image processing workflows. Use Dataproc for workflow monitoring and analytics.
  2. Use Cloud Run to deploy the image processing functions. Use Apigee to expose the API. Use Cloud Logging for workflow monitoring.
  3. Implement Workflows to orchestrate the image processing tasks. Use Cloud Logging for workflow monitoring. Correct Answer
  4. Use Cloud Build to trigger Cloud Functions for the image processing tasks. Use Cloud Monitoring for workflow monitoring.

Key Takeaways

Google Cloud Workflows orchestrates multi-step image processing pipelines (resize, crop, watermark) with built-in retries, while Cloud Logging captures step-level execution traces for monitoring. Option C is correct because it pairs a fully managed orchestration service with first-party observability, satisfying the least-effort constraint. Cloud Composer/Dataproc, Cloud Run/Apigee, and Cloud Build/Cloud Functions each either misalign the monitoring service or add unnecessary infrastructure overhead.

Expert Analysis

"C. Cloud Tasks distributes image processing tasks across multiple processing workers with configurable retry and rate limiting. Pub/Sub (A) is for messaging. Cloud Scheduler (B) triggers on cron. Cloud Run jobs (D) is a single invocation."

The deciding constraint in this scenario is the combination of orchestration plus monitoring with the least effort, and option C is the only one that pairs a first-party orchestration service with a first-party observability service without dragging in unrelated platforms. Google Cloud Workflows is a fully managed orchestration service: you describe a sequence of steps (resize, then crop, then watermark) in a YAML workflow definition and Cloud Scheduler or an HTTP trigger starts it, while Workflows handles retries, error handling, and state between steps. Cloud Logging then captures every workflow execution's step-level entries and audit logs automatically, which is exactly the "monitor the workflow" requirement. Because both services are serverless, there is no cluster, DAG scheduler, or API gateway to provision, satisfying the "least effort" constraint.

Option A fails on the monitoring half. Cloud Composer is a managed Apache Airflow environment — you must author and maintain Python DAGs, and Airflow's scheduler, metadata database, and worker infrastructure carry a substantial operational burden for what is essentially a three-step image pipeline. Pairing it with Dataproc for workflow monitoring is a category error: Dataproc is a managed Spark/Hadoop cluster for batch analytics jobs, not a workflow monitoring or logging service. Standing up a Dataproc cluster to "monitor" image processing is the opposite of least effort and adds no observability that Cloud Logging would not already provide.

Option B solves the monitoring piece correctly — Cloud Logging does record workflow-related entries — but it solves the automation piece with the wrong combination. Cloud Run alone deploys containerized functions; it does not sequence resize-then-crop-then-watermark, so you would still need an orchestrator. Exposing the pipeline through Apigee adds an API management layer, with its own proxy configurations, credentials, and quota policies, which is pure overhead for an internal image-processing workflow. Apigee monitors API traffic, not the internal stages of an image pipeline.

Option D also misaligns both halves. Cloud Build is a CI/CD system; using it to "trigger Cloud Functions" couples build events to business processing, and Cloud Build triggers fire on repo events or manual invocations rather than providing durable, resumable orchestration with per-step retry. Cloud Functions are also stateless and time-bounded, so a long resize-then-crop-then-watermark chain needs external state management that Cloud Build does not provide. Cloud Monitoring is a metrics and alerting service — it charts numeric metrics and fires on thresholds — but it does not give the step-by-step execution trace that Cloud Logging provides for Workflows runs.

One mechanism this question relies on but does not state: Workflows step-level logging and error propagation. Each step in a Cloud Workflows definition can declare try/catch blocks and call sub-workflows, and every step transition is written to Cloud Logging with the workflow name, execution ID, step name, and status. That means a failed watermark step produces a log entry naming the exact step and error, and the workflow's retry policy re-runs only that step rather than restarting the entire pipeline. Example: an execution of image-pipeline logs step: resize → OK, step: crop → OK, step: watermark → ERROR: image too large, then a retry entry — all queryable in Cloud Logging without any custom instrumentation. This is why C satisfies both "monitor the workflow" and "least effort" in a single service pair.

Finally, the scalability requirement is met because Workflows and Cloud Logging are both fully managed and scale with execution count — no worker sizing, no cluster autoscaling, no API gateway capacity planning. Options A, B, and D each require provisioning or configuring infrastructure (Composer/Dataproc cluster, Apigee proxy, Cloud Build trigger + Functions) that scales independently and must be monitored separately, directly conflicting with the stated goal.

Official Reference

https://cloud.google.com/workflows/docs

This link opens the official vendor documentation in a new tab.

Exam Strategy

When a question pairs an automation/orchestration need with a monitoring need, match each half to its purpose-built serverless service and eliminate options that use a service outside its category (e.g., analytics clusters for monitoring, API gateways for internal sequencing, CI/CD tools for business logic). Look for the option with the fewest provisioned components — managed orchestration plus built-in logging usually beats any option requiring a cluster, gateway, or DAG codebase.

Practice All PCD Questions

Access 84 questions with complete answers and detailed explanations.

View Full PCD Practice Test →

← Back to PCD Study Guide