New to Kestra?
Use blueprints to kickstart your first workflows.
Read, filter, and rewrite a daily orders CSV with the Apache Beam YAML framework and Python SDK on Kestra. Backfill-safe, with retry, alerting, and a safe threshold.
Run a declarative Apache Beam YAML pipeline with the Python SDK on a daily schedule to download an orders CSV, filter and reshape it, and write the result back to Kestra internal storage keyed on the run date. This blueprint solves the everyday data engineering problem of turning a portable Beam pipeline into a scheduled, retried, alerted, and backfill-safe job without hand-rolling cron, glue scripts, or a brittle string-built filter. No transform code, only YAML.
Filtering a small CSV is below the threshold where Beam earns its weight, so treat this sample as a stand-in for a large partitioned source. Beam YAML pays off at volume, or when you graduate the same declarative pipeline to a portable runner such as Flink, Spark, or Dataflow without rewriting the transforms.
daily_transform trigger (io.kestra.plugin.core.trigger.Schedule) fires at 05:00 with an explicit Etc/UTC timezone so the run time does not drift with the server zone or DST.download_orders (io.kestra.plugin.core.http.Download) fetches inputs.source_url into internal storage as orders.csv, with retry and a timeout because a public-host download is the most likely transient failure.write_pipeline (io.kestra.plugin.core.storage.Write) renders a Beam YAML pipeline that reads the CSV, keeps only orders whose total meets the threshold, selects a subset of fields, and writes high_value_orders.transform_orders (io.kestra.plugin.beam.RunPipeline) runs that pipeline with sdk: PYTHON and beamRunner: DIRECT. The threshold is injected as the MIN_AMOUNT env var and read via os.environ inside the Filter callable, not concatenated into the filter code. Results are captured through outputFiles.archive_partition (io.kestra.plugin.core.storage.Write) records the result under a date-partitioned key, and log_result (io.kestra.plugin.core.log.Log) prints the run date and shard URIs.{{ trigger.date ?? execution.startDate }} and the partition key is built from that same value, so replays land in the right partition.FLOAT threshold that Kestra validates before it reaches the pipeline, passed safely as a parameter rather than concatenated into Python.retry and timeout on the download and pipeline tasks, plus a Slack failure alert.apache/beam_python3.11_sdk:2.71.0 image for reproducible runs.Beam's own runner executes a single pipeline, but it does not schedule, retry across runs, alert on failure, or wire one pipeline's output into the next step. Kestra adds an event-driven Schedule trigger, per-task retry with wall-clock timeout, an errors block that pages Slack on failure, and full execution lineage across download_orders, transform_orders, and the downstream archive and log tasks. The declarative YAML flow keeps the whole job version-controlled and reproducible, filling the gap Beam's scheduler cannot: backfill-aware orchestration around the pipeline.
download_orders can fetch the source CSV.SLACK_WEBHOOK: used only by the alert_failure errors block to post a failure notification. The sample dataset is public, so the transform itself needs no credentials. To read from a private source, store the credential as a secret and reference it with {{ secret('NAME') }}.min_amount to change the filter threshold (typed FLOAT).transform_orders Outputs tab and download the high_value_orders CSV.source_url at a date-templated path built from the run_date variable to make the schedule genuinely incremental.MapToFields projections) to the pipeline body in write_pipeline.options.environment_type (LOOPBACK for local execution without a Docker socket mount, DOCKER for distributed sibling workers).