Pipeline — DAG of PTransforms applied to PCollections
3. Windowing (Streaming)
Fixed windows — equal non-overlapping intervals (e.g., 1-minute buckets)
Sliding windows — overlapping intervals (e.g., 10-min window every 1 min)
Session windows — gap-based; group events within a user session
Global window — default; all elements in one window (use with triggers for streaming)
4. Watermarks and Late Data
Watermark — Dataflow's estimate of how far behind real-time the data is
Late elements arrive after the watermark passes their window
Handle with .withAllowedLateness(Duration.standardMinutes(10))
Late data triggers go to a dead-letter or side output
5. Triggers
Default (event time) — fire when watermark passes window end
AfterProcessingTime — fire after processing-time delay (for low-latency)
AfterCount — fire after N elements accumulated
Composite triggers — combine with .orFinally(), .repeatedly()
6. Templates
Classic Templates — staged as GCS files; no runtime parameters
Flex Templates — packaged as Docker images; support runtime parameters; preferred
Key Concepts
Fusion — Dataflow optimization: merges compatible transforms to reduce shuffles
Worker autoscaling — Dataflow scales workers based on backlog
Shuffle service — offloads GroupByKey shuffle to Dataflow backend (reduces worker cost)
Streaming Engine — offloads windowing/state to backend; reduces memory on workers
Checklist
Use Flex Templates (not Classic) for new pipelines?
Late data handled with .withAllowedLateness()?
Side outputs used for dead-letter / error records?
GroupByKey minimized (use Combine where possible)?
Dataflow Shuffle service enabled for batch jobs?
Streaming Engine enabled for streaming jobs?
Pipeline tested locally with DirectRunner before deploying?
Output Format
🔴 Critical — unbounded PCollection without windowing in streaming pipeline
🟡 Warning — Classic Template used (prefer Flex), no late data handling
🟢 Suggestion — Shuffle service / Streaming Engine not enabled
Exam Tips
Watermark = when Dataflow thinks all data with that timestamp has arrived
Late data arrives AFTER the watermark → use .withAllowedLateness() to capture it
Dataflow → BigQuery streaming inserts = standard pattern for real-time analytics
Dataproc = use for existing Spark/Hadoop code migration, not greenfield
Flex Templates > Classic Templates for all new pipelines (runtime params, easier updates)
DirectRunner = local testing; DataflowRunner = GCP execution
1---2name: dataflow-pipeline3description: Dataflow Pipeline4---56# Dataflow Pipeline78## When to Use9- Building ETL pipelines (batch or streaming) on GCP10- Choosing between Dataflow and Dataproc for a workload11- Designing windowing or late-data handling for streaming12- Preparing for GCP Professional Data Engineer exam (highest weight domain)1314## Core Jobs1516### 1. Dataflow vs Dataproc Decision17| Factor | Choose Dataflow | Choose Dataproc |18|--------|----------------|-----------------|19| Runtime | Apache Beam pipelines | Spark/Hadoop ecosystem |20| Management | Fully managed, serverless | Cluster to manage (or autoscaling) |21| Streaming | Native (Pub/Sub → BQ) | Spark Streaming (more complex) |22| Existing code | Greenfield | Migrating existing Spark jobs |23| Cost model | Per vCPU/memory/hour | Cluster uptime |2425### 2. Pipeline Design (Apache Beam)26Core abstractions:27- **PCollection** — distributed dataset (bounded for batch, unbounded for streaming)28- **PTransform** — operation on a PCollection (Map, Filter, GroupByKey, Combine)29- **ParDo** — element-wise transformation (like map/flatMap)30- **Pipeline** — DAG of PTransforms applied to PCollections3132### 3. Windowing (Streaming)33- **Fixed windows** — equal non-overlapping intervals (e.g., 1-minute buckets)34- **Sliding windows** — overlapping intervals (e.g., 10-min window every 1 min)35- **Session windows** — gap-based; group events within a user session36- **Global window** — default; all elements in one window (use with triggers for streaming)3738### 4. Watermarks and Late Data39- **Watermark** — Dataflow's estimate of how far behind real-time the data is40- Late elements arrive after the watermark passes their window41- Handle with `.withAllowedLateness(Duration.standardMinutes(10))`42- Late data triggers go to a dead-letter or side output4344### 5. Triggers45- **Default (event time)** — fire when watermark passes window end46- **AfterProcessingTime** — fire after processing-time delay (for low-latency)47- **AfterCount** — fire after N elements accumulated48- **Composite triggers** — combine with `.orFinally()`, `.repeatedly()`4950### 6. Templates51- **Classic Templates** — staged as GCS files; no runtime parameters52- **Flex Templates** — packaged as Docker images; support runtime parameters; preferred5354## Key Concepts55- **Fusion** — Dataflow optimization: merges compatible transforms to reduce shuffles56- **Worker autoscaling** — Dataflow scales workers based on backlog57- **Shuffle service** — offloads GroupByKey shuffle to Dataflow backend (reduces worker cost)58- **Streaming Engine** — offloads windowing/state to backend; reduces memory on workers5960## Checklist61- [ ] Use Flex Templates (not Classic) for new pipelines?62- [ ] Late data handled with `.withAllowedLateness()`?63- [ ] Side outputs used for dead-letter / error records?64- [ ] GroupByKey minimized (use Combine where possible)?65- [ ] Dataflow Shuffle service enabled for batch jobs?66- [ ] Streaming Engine enabled for streaming jobs?67- [ ] Pipeline tested locally with DirectRunner before deploying?6869## Output Format70- 🔴 **Critical** — unbounded PCollection without windowing in streaming pipeline71- 🟡 **Warning** — Classic Template used (prefer Flex), no late data handling72- 🟢 **Suggestion** — Shuffle service / Streaming Engine not enabled7374## Exam Tips75- **Watermark** = when Dataflow thinks all data with that timestamp has arrived76- Late data arrives AFTER the watermark → use `.withAllowedLateness()` to capture it77- **Dataflow → BigQuery streaming inserts** = standard pattern for real-time analytics78- **Dataproc** = use for existing Spark/Hadoop code migration, not greenfield79- Flex Templates > Classic Templates for all new pipelines (runtime params, easier updates)80- `DirectRunner` = local testing; `DataflowRunner` = GCP execution
Run npx skillmds@latest add kienbui1995/dataflow-pipeline in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Dataflow Pipeline It is listed under DevOps & Infra on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
kienbui1995 (@kienbui1995) published this skill. Their other Agent Skills are listed on their SkillMD profile.