New to Kestra?
Use blueprints to kickstart your first workflows.
Run a parametrized Python script in Kestra that produces a downloadable CSV, named outputs, and custom counters and timers. Drive behavior with workflow variables.
Run a Python script as an orchestrated task that produces real, observable results: a downloadable file, structured outputs, and custom metrics. This blueprint generates a CSV of 100 synthetic orders, computes the total and average order value, and surfaces those numbers as Kestra outputs and metrics so downstream tasks, dashboards, and stakeholders can consume them. It solves a common gap with ad hoc Python: scripts that write files and print numbers locally but leave nothing tracked, versioned, or shareable.
analyze_orders task runs io.kestra.plugin.scripts.python.Script with its dependencies set to faker and kestra, installed automatically at runtime.{{ vars.file }} variable (default orders.csv) to decide the output filename, avoiding hardcoded paths.total_sum and average_order.outputFiles is set to *.csv, so Kestra captures the generated file into internal storage for download.Kestra.outputs(...) for total_sum and average_order, Kestra.counter(...) for both values, and Kestra.timer(...) for processing_time, all tagged with the filename.total_sum, average_order) usable by later tasks via expressions.Python's own runtime has no scheduler, no retry policy, and no built-in way to track outputs or metrics across runs. Kestra adds event and schedule triggers, automatic retries, execution lineage, and declarative YAML so the same script becomes reproducible and observable. Outputs and outputFiles are captured centrally instead of vanishing on the worker, and metrics are queryable over time.
faker and kestra).secret(...) values.orders.csv.file variable to change the output name per execution.total_sum into a downstream notification or database task.