PDE Maintaining and Automating Data Workloads Practice Question
You are designing a Cloud Composer workflow that loads data from Cloud Storage into BigQuery, runs a Dataflow job to transform the data, and then triggers a Dataproc Spark job. After each step, you need to conditionally branch based on success or failure. Which Airflow feature allows you to pass messages between tasks to enable dynamic branching?
⚠ Common exam trap
PDE often tests the confusion between XComs (data passing) and the TaskFlow API (a coding style that uses XComs) — candidates pick TaskFlow API thinking it is the transport mechanism.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
XComs
XComs (cross-communications) are Airflow's built-in mechanism for passing small pieces of data between tasks. A task can push a value via xcom_push() or by returning it, and downstream tasks pull it via xcom_pull(), enabling dynamic decisions such as choosing a branch based on a prior task's output. This is exactly what conditional branching in a Composer DAG requires.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Sensors
Why it's wrong here
Sensors block a workflow until a condition is met, such as a file landing in Cloud Storage, but they cannot pass a message or payload between tasks to drive branching. They suit polling-based gating, not conditional routing on a prior task's output.
- ✓
XComs
Why this is correct
XComs let a task push a small value, such as a success flag or branch key, that downstream tasks pull, enabling conditional branching via BranchPythonOperator. This passes messages between tasks without external storage, satisfying the requirement for dynamic branching after each step.
- ✗
TaskFlow API
Why it's wrong here
TaskFlow API is a Python decorator syntax for authoring tasks and passing data via XComArg, not a branching construct; it cannot evaluate success or failure and choose a downstream path. It is tempting because it simplifies task definition and implicit XCom passing, which suits building DAGs with typed Python functions.
- ✗
DAG dependencies
Why it's wrong here
DAG dependencies only set execution order between separate DAGs via triggers or sensors; they carry no payload, so no message reaches a downstream branch. They are tempting because cross-DAG orchestration genuinely needs them when one workflow must fire another. Here the branching happens inside a single DAG, which requires XComs to pass values between tasks.
Go deeper
Related to this question
About these practice questions
One of 747 original PDE practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Google Cloud exam blueprint
This PDE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PDE exam.