> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oleander.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Kedro

> Write pipelines in Python, connect your GitHub repository, and run and monitor them in oleander.

Use Kedro to define your data pipelines in Python, and oleander to run them from GitHub. Your repository holds the code and schedules; oleander keeps the deployed pipelines up to date and gives you a place to run them, inspect their graphs, and read their logs.

## What is Kedro?

[Kedro](https://docs.kedro.org/en/stable/) is an open-source Python framework for building data pipelines. A **node** wraps a Python function and declares its inputs and outputs. A **pipeline** connects those nodes: when one node produces an input another needs, Kedro runs them in the right order.

You can start with ordinary Python functions, then add datasets, parameters, and more pipelines as your project grows. For the framework itself, see the [Kedro documentation](https://docs.kedro.org/en/stable/) and [project creation guide](https://docs.kedro.org/en/1.7.0/create/new_project/).

## What is oleander-kedro?

[`oleander-kedro`](https://pypi.org/project/oleander-kedro/) is a Python extension for Kedro. It adds two optional decorators to your pipeline definitions:

* `@schedule` declares when oleander should run a pipeline.
* `@run_as` declares which oleander principal a scheduled run should use.

The extension also reports pipeline and node execution events so you can follow runs in oleander. You keep using Kedro's normal Python APIs and `kedro run` command for local development.

The **oleander-kedro GitHub App** connects your repositories to your oleander organization. Each connected repository becomes a **pipeline group**, containing the pipelines registered in that project. On the initial connection and subsequent pushes to the repository's default branch, oleander discovers and deploys your pipelines automatically.

## Before you start

* Use a Kedro project at the **root of a GitHub repository**, with its `pyproject.toml`, `src/`, and shared configuration committed. Private repositories are supported.
* Use **Python 3.10 or newer** and **Kedro 1.7.x**, which the extension currently supports. Execution reporting requires `oleander-kedro` **0.0.2 or newer**.
* Have access to an oleander organization and permission to connect repositories. An organization administrator can help with [roles and permissions](https://docs.oleander.dev/iam/permissions.md).
* Have a valid, non-revoked [API key](https://docs.oleander.dev/platform/settings/api-keys.md) owned by the principal that will run the pipeline. For a manual run, that is you. For a scheduled run, it is the principal named by `@run_as`. The key must remain valid for the run's execution window.

You can test the Python example below locally before connecting GitHub or configuring an API key.

## 1. Add the extension to your project

From your Kedro project's root directory:

> [tab] uv
>
> Add the extension as a production dependency:
>
> ```bash theme={null}
> uv add "oleander-kedro>=0.0.2"
> ```
>
> Commit both `pyproject.toml` and `uv.lock`. Oleander uses the locked production dependencies when `uv.lock` is present. Put packages needed by your nodes in the main dependencies, rather than only in a development group or optional extra.

> [tab] pip / requirements.txt
>
> Add the extension to your root-level `requirements.txt`, alongside your pipeline's other dependencies:
>
> ```text requirements.txt theme={null}
> oleander-kedro>=0.0.2
> ```
>
> Install them in your project's virtual environment:
>
> ```bash theme={null}
> pip install -r requirements.txt
> ```
>
> Commit `requirements.txt`. When there is no `uv.lock`, oleander installs dependencies from this file.

Keep the Kedro `[tool.kedro]` section in `pyproject.toml`; it identifies your project. If you use `.python-version`, commit it too so oleander uses your chosen Python version.

## 2. Define a pipeline

This example passes a greeting between two Python nodes. It does not need the oleander SDK, SQL, or an external data source.

The examples use `my_project` as the Python package name. Replace it in file paths with your project's package name from `[tool.kedro].package_name`.

Create `src/my_project/pipelines/hello/__init__.py`:

```python src/my_project/pipelines/hello/__init__.py theme={null}
from kedro.pipeline import node, pipeline


def greeting():
    return "Hello from Kedro!"


def display(message):
    print(message)


def create_pipeline(**kwargs):
    return pipeline(
        [
            node(greeting, inputs=None, outputs="message", name="greeting"),
            node(display, inputs="message", outputs=None, name="display"),
        ]
    )
```

Register it in `src/my_project/pipeline_registry.py`. For a project with just this example:

```python src/my_project/pipeline_registry.py theme={null}
from .pipelines.hello import create_pipeline


def register_pipelines():
    return {"hello": create_pipeline()}
```

The dictionary key, `hello`, is the pipeline name you will see in oleander. If you already register other pipelines, add `hello` to that dictionary. Kedro's [`find_pipelines()`](https://docs.kedro.org/en/1.7.0/build/pipeline_registry/) is supported too; it discovers pipelines using their directory names.

This pipeline has no schedule and can be run manually in oleander. Decorators are not required for discovery.

If your project does not already have catalog or parameter configuration, create `conf/base/catalog.yml` and `conf/base/parameters.yml`, each containing `{}`, and an empty `conf/local/` directory for local development. The greeting passes through memory and needs no catalog entry.

## 3. Run it locally

```bash theme={null}
uv run kedro run --pipelines hello --runner=ThreadRunner
```

If you installed with pip, use the same command without `uv run`:

```bash theme={null}
kedro run --pipelines hello --runner=ThreadRunner
```

You should see `Hello from Kedro!` in the output. Oleander also uses `ThreadRunner`: independent nodes can run concurrently, and downstream nodes wait for their inputs.

## 4. Connect GitHub

Push the project to your repository's default branch, then:

1. Sign in to oleander and select the organization that should own the connection.
2. Open [**Settings → Kedro**](https://oleander.dev/app/settings/kedro) and choose **Install GitHub App**. You can also start from the installation guide in **Pipelines** when no installation is connected.
3. Install **oleander-kedro** on your GitHub account or organization, and select the repositories containing your Kedro projects.
4. Complete GitHub authorization. When you return to oleander, select the installation and choose **Connect installation**.
5. Open [**Pipelines**](https://oleander.dev/app/kedro). Your repository appears as a pipeline group. Wait for its sync status to become **Synced**, then expand it to see `hello`.

If the app is already installed on GitHub, use **Connect existing installation** in Kedro settings. There is no need to configure each pipeline separately in the UI.

## 5. Run and inspect your pipeline

Select `hello` from its pipeline group and choose **Run pipeline**. Leave the interval fields empty for this example and confirm the run.

The pipeline page has two views:

| View | What you can do |
| - | - |
| **Runs** | Browse execution history, status, duration, execution type, principal, and commit. Select a run to inspect it. |
| **Definition** | Explore the currently deployed pipeline graph and each node's inputs and outputs. |

Each run has its own views:

| View | What you can do |
| - | - |
| **Graph** | Follow reported node states and inspect node details. This graph reflects the definition used for that run, even after your code changes. |
| **Logs** | Read, copy, or download the container output. Logs are collected after execution finishes, for both successful and failed runs. |
| **Details** | See the run ID, execution principal, intervals, commit, and any reported pipeline error. |

A newly submitted execution may take a moment to appear. **Not reported** means execution events have not arrived; it does not mean the run succeeded or failed. The page refreshes automatically.

## Add a schedule

Add both decorators to the `create_pipeline()` function in the `hello` example:

```python theme={null}
from oleander_kedro import run_as, schedule


@run_as("pipeline-runner@iam.application.oleander.dev")
@schedule(cron="0 * * * *", timezone="UTC")
def create_pipeline(**kwargs):
    return pipeline(
        [
            node(greeting, inputs=None, outputs="message", name="greeting"),
            node(display, inputs="message", outputs=None, name="display"),
        ]
    )
```

Replace the example email with the actual email shown for an oleander [principal](https://docs.oleander.dev/iam/principals.md) in your organization. An **Application** principal is useful for scheduled pipelines because it is independent of a person's account. Give it permission to execute the pipeline and access any data it needs, and make sure it owns a usable API key.

Push the change to your default branch. After a successful sync, oleander schedules `hello` hourly.

* `@schedule` and `@run_as` must appear **together**. To make a pipeline manual-only again, remove both and push the change.
* `run_as` takes an **email address**, not a UUID or display name. It declares an identity; it does not grant permissions.
* Cron uses **five fields**: minute, hour, day of month, month, and day of week. Use numeric values with `*`, `,`, `-`, and `/`. For example, `0 9 * * 1-5` runs at 09:00 on weekdays. Named weekdays, named months, and extensions such as `@daily` or `L` are not supported.
* Supply an explicit timezone, such as `UTC` or `America/Los_Angeles`. Use UTC for a schedule unaffected by daylight saving changes.
* Register a scheduled pipeline object under one name. Do not give that same object a second name such as `__default__`. Put the decorators on the factory that returns the final pipeline you want to schedule.

### Which identity runs the pipeline?

| Execution | Identity used |
| - | - |
| **Run pipeline** in oleander | The signed-in user, even if the pipeline has `@run_as`. |
| Scheduled run | The principal whose email is declared by `@run_as`. |
| Local `kedro run` | Your local environment and credentials. The decorators do not select credentials or start a scheduler. |

Manual and scheduled runs both require the execution principal to have pipeline **Execute** permission and a usable API key. If that principal runs queries, its data permissions still apply.

## Work with execution intervals

A pipeline can accept `interval_start` and `interval_end` through Kedro parameters. For example, a node can process records between two timestamps:

```python theme={null}
from kedro.pipeline import node, pipeline


def show_interval(interval_start, interval_end):
    print(f"Processing from {interval_start} to {interval_end}")


def create_pipeline(**kwargs):
    return pipeline(
        [
            node(
                show_interval,
                inputs=["params:interval_start", "params:interval_end"],
                outputs=None,
                name="show_interval",
            )
        ]
    )
```

You can use this as another pipeline or replace the `hello` factory and its nodes with it. Add both scheduling decorators if it should run on a schedule.

For oleander-managed execution, supplied boundaries reach the node as timezone-aware Python `datetime` values in **UTC**, even when the schedule uses another timezone. Your code decides how to use the boundaries, including whether to include or exclude the endpoints.

| Execution | Interval behavior |
| - | - |
| Scheduled | Oleander supplies the current scheduled timestamp as the end and the previous scheduled timestamp as the start. For the first run, it calculates the previous occurrence from the cron expression. |
| Manual run of a scheduled pipeline | Enter both boundaries in the Run dialog, for example `2026-11-23T11:00:00Z` and `2026-11-23T12:00:00Z`. |
| Manual run of an unscheduled pipeline | Supply both boundaries or neither. If you omit them, normal Kedro parameter configuration applies; a node that needs them still needs values. |

For an uninterrupted hourly schedule, the run at 12:00 UTC typically receives 11:00 and 12:00 UTC. A delayed start does not shift that interval. These boundaries are not a record of the last successful run; rerun a failed interval explicitly when needed.

Conventional Kedro does not inject intervals automatically. To test the `show_interval` example locally under the `hello` name:

```bash theme={null}
uv run kedro run --pipelines hello --runner=ThreadRunner \
  --params='interval_start=2026-11-23T11:00:00Z,interval_end=2026-11-23T12:00:00Z'
```

Here the command-line values use Kedro's normal parameter types; they are not automatically converted to `datetime` by the extension.

## Query oleander from a node

Your nodes can call the [oleander Python SDK](https://docs.oleander.dev/sdk/python/introduction.md). Add `oleanderhq-sdk` to the same production dependencies as your pipeline and use the SDK's normal APIs.

Oleander-managed runs supply `OLEANDER_API_KEY` for the execution principal, so `Oleander()` can pick up the key without putting credentials in your code. For local execution, set your own `OLEANDER_API_KEY`. See [Python queries](https://docs.oleander.dev/sdk/python/query.md) for examples.

The SDK and the Kedro extension are separate packages. Plain Python pipelines such as the greeting example work without the SDK. Managed pipelines are suited to lightweight orchestration of remote work; keep large data processing in your query engine or data platform. Save lasting outputs to your data store, because files written during an execution are temporary.

## Update your pipelines

Push code, dependency, or schedule changes to the connected repository's **default branch**. Oleander synchronizes the group, adds newly registered pipelines, and removes pipelines no longer registered. A failed deployment keeps the last successfully deployed pipelines available.

Use **Settings → Kedro** to manage the connection. Removing a repository from the GitHub App removes its group from oleander. Disconnecting in oleander removes the connection but leaves the app installed on GitHub.

## Troubleshooting

| Symptom | What to check |
| - | - |
| The repository does not appear | Confirm it is selected in the GitHub App, the connection is complete in the intended oleander organization, and the repository root contains a Kedro `pyproject.toml`. |
| The group is visible but a pipeline is missing | Check its `register_pipelines()` entry, the group's sync status, and your permission to describe that pipeline. |
| Synchronization fails | Run the pipeline locally, check your declared dependencies and lockfile, and confirm scheduled pipelines have both decorators with valid arguments. Shared runtime configuration belongs in `conf/base`; `conf/local` and local `.env` files are not deployed. |
| Run is unavailable or execution fails before starting | Check the installation is connected and not suspended, the execution principal exists in this organization, and it has pipeline Execute permission and a usable API key. |
| Run history has no node status | Use `oleander-kedro` 0.0.2 or newer, push the dependency update, and wait for a successful sync. Events can take a moment to appear. |
| Logs are empty | Wait for the run to finish and refresh. Output is collected after execution, rather than streamed live. |

To browse pipeline groups and pipelines, you need **Describe** on each corresponding resource. Viewing installation connections in Kedro settings requires **Describe** on all pipeline groups; connecting requires **Create** on all pipeline groups. Ask your organization administrator if the appropriate pages or actions are unavailable.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.