# Lertha Flow

> For the complete documentation index, see [llms.txt](https://docs.lertha.com/llms.txt).
> Any documentation page is available as raw Markdown by appending `.md` to its URL.

> Durable flows, tasks and runs for Lertha. What the orchestrator is, the three words you need, and where to go next.

Lertha Flow is the orchestrator for agents. It runs the work that must not be lost: an agent deciding its next step, a
transfer waiting on a human, a nightly recompute, an SMS that has to go out exactly once. It
records every step, retries what fails, waits for as long as a person needs, and survives every
restart in between.

You write ordinary Kotlin against a small port. The orchestrator owns the durability.

## Three words

| Word | What it is |
| --- | --- |
| **Task** | One unit of work with a side effect. Retried, timed out, de-duplicated by id. |
| **Flow** | The program around tasks: sequence, fan-out, sleep, wait for a signal. Deterministic, replayable. |
| **Run** | One execution of a task or a flow, addressed by a `RunId` you choose. |

The [Glossary](/reference/vocabulary) has the full list, including the core identifiers you will
meet in queries and event histories.

## Where to start

- **New to durable execution?** Read [Concepts](/concepts), then do the
  [study track](/reference/study-track). The kill-the-worker exercise is the one that makes it click.
- **Writing application code?** [Kotlin quickstart](/develop/kotlin/quickstart) gets a task running in
  ten minutes; [Flows](/develop/kotlin/flows) is the agent-loop shape.
- **Running it?** [Orchestrator](/orchestrator) explains the single binary, its Postgres, and how it
  deploys.

## Why a port

Application code depends on `orchestration-api` only. `orchestration-engine` is the first engine
behind it, and `orchestration-memory` runs the same port with no server at all. A 40-test contract
decides what an engine must do. That is what lets the engine change without the applications
noticing.

```mermaid
flowchart LR
  App[Application code] --> Port[orchestration-api]
  Port --> T[orchestration-engine]
  Port --> M[orchestration-memory]
  T --> O[(Lertha Orchestrator<br/>Postgres)]
```
