ProcessTaskRunner
ProcessTaskRunner
This plugin is currently in beta. While it is considered safe for use, please be aware that its API could change in ways that are not compatible with earlier versions in future releases, or it might become unsupported.
type: "io.kestra.core.models.tasks.runners.types.ProcessTaskRunner"
Task runner that executes a task as a subprocess on the Kestra host.
To access the task's working directory, use the Pebble expression or the
WORKING_DIR
environment variable. Input files and namespace files will be available in this directory.
To generate output files you can either use the outputFiles
task's property and create a file with the same name in the task's working directory, or create any file in the output directory which can be accessed by the Pebble expression or the
OUTPUT_DIR
environment variables.
Note that when the Kestra Worker running this task is terminated, the process will be interrupted and re-created at worker restart.
Examples
Execute a Shell command.
id: new-shell
namespace: myteam
tasks:
- id: shell
type: io.kestra.plugin.scripts.shell.Commands
taskRunner:
type: io.kestra.core.models.tasks.runners.types.ProcessTaskRunner
commands:
- echo "Hello World"
Pass input files to the task, execute a Shell command, then retrieve output files.
id: new-shell-with-file
namespace: myteam
inputs:
- id: file
type: FILE
tasks:
- id: shell
type: io.kestra.plugin.scripts.shell.Commands
inputFiles:
data.txt: "{{inputs.file}}"
outputFiles:
- out.txt
taskRunner:
type: io.kestra.core.models.tasks.runners.types.ProcessTaskRunner
commands:
- cp {{workingDir}}/data.txt {{workingDir}}/out.txt