New to Kestra?
Use blueprints to kickstart your first workflows.
Clone a Git repository and run a Python ETL script with Kestra. Pull version-controlled code at runtime and run it in an isolated Docker container.
id: git-python
namespace: company.team
tasks:
- id: python_scripts
type: io.kestra.plugin.core.flow.WorkingDirectory
tasks:
- id: clone_repository
type: io.kestra.plugin.git.Clone
url: https://github.com/kestra-io/scripts
branch: main
- id: python
type: io.kestra.plugin.scripts.python.Commands
taskRunner:
type: io.kestra.plugin.scripts.runner.docker.Docker
dependencies:
- requests
- pandas
commands:
- python etl/global_power_plant.py
Clone a Git repository and execute a Python ETL script from version-controlled source, with dependencies installed automatically inside an isolated Docker container. This blueprint keeps your transformation logic in Git where it belongs, pulls the latest code at runtime, and runs it in a clean, reproducible Python environment, so your pipeline always reflects what is in your repository without manual packaging or copying scripts onto a server.
A io.kestra.plugin.core.flow.WorkingDirectory task named python_scripts creates a shared, ephemeral working directory and runs its child tasks in sequence against it:
clone_repository uses io.kestra.plugin.git.Clone to clone https://github.com/kestra-io/scripts at the main branch into the working directory.python uses io.kestra.plugin.scripts.python.Commands on a io.kestra.plugin.scripts.runner.docker.Docker task runner. It declares its dependencies (requests, pandas), which are installed into the container, then runs python etl/global_power_plant.py against the freshly cloned code.Git itself only stores and versions your code, it has no scheduler, no retries, and no execution engine. Kestra closes that gap: define the whole pipeline as declarative YAML, attach event or schedule triggers, add automatic retries on transient failures, and get full execution history and lineage across the clone and run steps. The Docker task runner guarantees an isolated, reproducible environment so the same commit always runs the same way.
This blueprint clones a public repository, so no secrets are required. To clone a private repository, add username and password (a personal access token) to the clone_repository task, for example via {{ secret('GITHUB_TOKEN') }}.
clone_repository then python run in order.python task.url and branch at your own repository and script path.dependencies list.io.kestra.plugin.core.trigger.Schedule trigger to run on a cadence.clone_repository to a private repo by adding credentials.