New to Kestra?
Use blueprints to kickstart your first workflows.
Pass data between Kestra tasks using outputs and variables. Build data-driven workflows where each task consumes and produces structured values and files.
Learn how to pass data between tasks in Kestra using outputs, the mechanism that lets one task hand off values and files to downstream tasks. This blueprint solves a common orchestration problem: how do you chain a Python script, a Shell command, and core tasks so that each step can consume what the previous step produced, without writing to a shared filesystem or hardcoding values? It demonstrates the three output patterns you need most: a simple returned value, a structured map of variables, and a passed file.
The flow runs four tasks in sequence:
pass_output uses io.kestra.plugin.core.debug.Return to emit a value (hello) that becomes available under the value key.py_outputs uses io.kestra.plugin.scripts.python.Script running on the io.kestra.plugin.scripts.runner.docker.Docker task runner. It calls Kestra.outputs() from the kestra Python package to publish a key/value map, and writes myoutput.json declared in outputFiles.take_inputs uses io.kestra.plugin.core.log.Log to read both upstream results with {{ outputs.pass_output.value }} and {{ outputs.py_outputs.vars.mykey }}.check_output_file uses io.kestra.plugin.scripts.shell.Commands on the io.kestra.plugin.core.runner.Process runner to cat the passed file via {{ outputs.py_outputs.outputFiles['myoutput.json'] }}.vars map, and outputFiles.{{ outputs.task_name.vars.key_name }}).A standalone script or cron job has no shared, typed way to hand data between steps: you end up parsing stdout or writing brittle temp files. Kestra makes outputs first-class. Values and files are captured automatically, persisted in internal storage, and addressable from any downstream task with declarative YAML. You also get event triggers, automatic retries, and full execution lineage so you can inspect exactly what each task produced on the Outputs tab. This is the gap a plain scheduler cannot fill: it can run scripts, but it cannot pass and track structured data between them.
This flow references no secrets.
value, vars, and outputFiles.check_output_file logs to confirm the JSON file was passed through.Kestra.outputs().outputFiles into a downstream upload, database load, or notification task.