Supported Programming Languages in Kestra
Kestra lets you run code in many languages inside your workflows.
Choose the right way to run a language
Use a dedicated script plugin when Kestra provides one for your language. Use the Shell plugin when you need to run another language or compile code inside a container.
Languages with dedicated plugins
Kestra provides dedicated script plugins for these languages:
Each of these plugins provides two task types:
Scriptfor short inline code in your flow definition.Commandsfor code stored in files or split across multiple commands.
Here is a minimal example that uses the Python Script task:
id: python_script_examplenamespace: company.team
tasks: - id: run_python type: io.kestra.plugin.scripts.python.Script containerImage: python:3.12-slim script: | print("Hello from Python")Use the Commands task when you want to run a file from namespaceFiles or execute multiple commands in sequence:
id: python_commands_examplenamespace: company.team
tasks: - id: run_python_file type: io.kestra.plugin.scripts.python.Commands namespaceFiles: enabled: true containerImage: python:3.12-slim commands: - python hello.pyLanguage-specific guides
Use these guides for complete examples, outputs, metrics, and dependency management:
- Run Python inside your flows
- Run R inside your flows
- Run JavaScript inside your flows
- Run Shell scripts inside your flows
- Run PowerShell inside your flows
- Run Julia inside your flows
- Run Go inside your flows
- Run Perl inside your flows
- Run Rust inside your flows
Run other languages with the Shell plugin
Use io.kestra.plugin.scripts.shell.Commands when your language does not have a dedicated plugin or when you want to compile and run code in a container.
This approach works best when:
- the language runtime is available in the container image
- your commands can be executed from a shell
- you want to use
namespaceFilesorinputFilesfor source code
For outputs and metrics, use the same ::{}:: syntax documented for Shell tasks. See Shell outputs and metrics.
Rust example
This example compiles and runs a Rust file stored in namespaceFiles:
id: rust_examplenamespace: company.team
tasks: - id: run_rust type: io.kestra.plugin.scripts.shell.Commands taskRunner: type: io.kestra.plugin.scripts.runner.docker.Docker containerImage: rust:1.82 namespaceFiles: enabled: true commands: - rustc hello_world.rs - ./hello_worldThe hello_world.rs file can contain:
fn main() { println!("Hello, World!");}See the full Rust guide for outputs and file handling.
Java example
If you need to run Java code without building a custom plugin, you can compile and run it from a container:
id: java_examplenamespace: company.team
tasks: - id: run_java type: io.kestra.plugin.scripts.shell.Commands taskRunner: type: io.kestra.plugin.scripts.runner.docker.Docker containerImage: eclipse-temurin:21 namespaceFiles: enabled: true commands: - javac HelloWorld.java - java HelloWorldclass HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); }}TypeScript example
You can run TypeScript with the Node.js plugin by compiling it to JavaScript first:
id: typescript_examplenamespace: company.team
tasks: - id: run_typescript type: io.kestra.plugin.scripts.node.Commands namespaceFiles: enabled: true containerImage: node:22-slim commands: - npm install --save-dev typescript - npx tsc example.ts - node example.jsThe example.ts file can contain:
type User = { name: string; age: number;};
function isAdult(user: User): boolean { return user.age >= 18;}
const justine: User = { name: "Justine", age: 23,};
console.log(isAdult(justine));For more background, see the official Node.js with TypeScript guide.
Use a custom Docker image for extra dependencies
Use a custom Docker image when you need tools or libraries that are not present in the default runtime image.
The Dockerfile below adds Go to a Kestra image:
FROM kestra/kestra:latestUSER root
RUN apt-get update -y && apt-get install -y wget && \ wget -qO- https://go.dev/dl/go1.24.3.linux-amd64.tar.gz | tar -C /usr/local -xzf - && \ echo 'export PATH=$PATH:/usr/local/go/bin' > /etc/profile.d/golang.sh
ENV PATH="/usr/local/go/bin:${PATH}"Point your docker-compose.yml file to that Dockerfile:
services: kestra: build: context: . dockerfile: Dockerfile image: kestra-go:latestAfter you start Kestra with docker compose up -d, you can run Go code with the Process task runner:
id: golang_processnamespace: company.team
tasks: - id: go_custom_dependencies type: io.kestra.plugin.scripts.go.Script taskRunner: type: io.kestra.plugin.core.runner.Process beforeCommands: - go mod init go_script - go get github.com/go-gota/gota/dataframe - go mod tidy script: | package main
import ( "os" "github.com/go-gota/gota/dataframe" "github.com/go-gota/gota/series" )
func main() { names := series.New([]string{"Alice", "Bob", "Charlie"}, series.String, "Name") ages := series.New([]int{25, 30, 35}, series.Int, "Age") df := dataframe.New(names, ages) file, _ := os.Create("output.csv") defer file.Close() df.WriteCSV(file) } outputFiles: - output.csvRelated pages
Was this page helpful?