Core Plugins and tasks Process

Core Plugins and tasks Process

Certified

Run tasks as local subprocesses on the worker.

Executes task commands with the host OS process APIs. Working directory is exposed via {{workingDir}} expression / WORKING_DIR environment variables; if outputFiles are configured, write them to the same directory or use {{outputDir}} / OUTPUT_DIR when enabled. Input files and namespace files will be available in this directory.

Platform-agnostic (Linux/macOS/Windows). If the worker stops, the process is interrupted and will be recreated on restart.

yaml
type: io.kestra.plugin.core.runner.Process

Execute a Shell command.

yaml
id: new_shell
namespace: company.team

tasks:
  - id: shell
    type: io.kestra.plugin.scripts.shell.Commands
    taskRunner:
      type: io.kestra.plugin.core.runner.Process
    commands:
      - echo "Hello World"

Install custom Python packages before executing a Python script. Note how we use the --break-system-packages flag to avoid conflicts with the system packages. Make sure to use this flag if you see errors similar to error: externally-managed-environment.

yaml
id: before_commands_example
namespace: company.team

inputs:
  - id: url
    type: URI
    defaults: https://jsonplaceholder.typicode.com/todos/1

tasks:
  - id: transform
    type: io.kestra.plugin.scripts.python.Script
    taskRunner:
      type: io.kestra.plugin.core.runner.Process
    beforeCommands:
      - pip install kestra requests --break-system-packages
    script: |
      import requests
      from kestra import Kestra

      url = "{{ inputs.url }}"

      response = requests.get(url)
      print('Status Code:', response.status_code)
      Kestra.outputs(response.json())

Pass input files to the task, execute a Shell command, then retrieve output files.

yaml
id: new_shell_with_file
namespace: company.team

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.plugin.core.runner.Process
    commands:
      - cp {{workingDir}}/data.txt {{workingDir}}/out.txt
Properties

Reference (ref) of the pluginDefaults to apply to this task runner.

Plugin Version

Defines the version of the plugin to use.

The version must follow the Semantic Versioning (SemVer) specification:

  • A single-digit MAJOR version (e.g., 1).
  • A MAJOR.MINOR version (e.g., 1.1).
  • A MAJOR.MINOR.PATCH version, optionally with any qualifier (e.g., 1.1.2, 1.1.0-SNAPSHOT).