ReferenceDocumentation map

Language specification

Runtime

Guides

Background

The Flow Book

Flow documentation

On this page

Flow is a small, typed language for programs that work through other systems. A program computes deterministically and reaches the outside world in exactly one way: a typed Tool call, a call to a function whose body lives outside Flow. Every outside observation, and every runtime choice the program could not derive for itself, is retained as semantic history. The same history explains a run afterwards, replays it without calling anything, and resumes it in a new process.

This tree is the design of record for that language. It is one layered chain: each layer has a distinct job and cites the layer above it instead of restating its claims.

How to read this tree

Everything here states the target design, what a conforming Flow implementation must do, or practice around it. A rule is not a claim that today's code satisfies it, and a shipped behavior does not become design by existing. Runtime architecture holds the only implementation ledger, which lists where the code falls short. Nothing else in this tree discusses implementation status, and where the code and a specification disagree, the specification is right.

Flow is pre-release. No artifact carries a compatibility promise, no encoding is stable, and versioned stability begins at the first public release, with the contracts the runtime architecture names.

Start here

This is the one reading entry point for the repository.

To learn the language by doing, follow the Flow Book, a tutorial whose first chapters run in the browser. To read the design, start with Getting started with Flow, which walks through one realistic program from its first Tool call to fixing its code and continuing. Keep examples beside it for the patterns a program reaches for, such as fan-out, timeouts, people in the loop and uncertain effects. Then read the design chain in order, from Philosophy down.

The design chain

  1. Philosophy says why Flow is built the way it is and what comes first when its goals pull apart.
  2. Foundations says which principles Flow holds to, and links each to the specification that makes it exact.
  3. Language architecture says which mechanisms meet those principles, and where the language ends and the application that embeds it begins.
  4. language/spec/ says exactly what a program means. Each specification owns one surface, and its index is the map of which one owns what.
  5. Runtime architecture says how the contract maps onto a conforming runtime, and holds the implementation ledger.
  6. runtime/spec/ says how a runtime realizes the language without redefining it. The host boundary says how values, libraries and Tool processes cross the boundary, Running a program how a run starts, waits, stops, resumes and replays, The history format how a history is laid out, The runs library how a program reads and starts other runs, and Diagnostics how a diagnostic is shaped.

Read in that order. A disagreement between two layers is a documentation defect, and the higher layer owns the decision until the lower one is repaired.

The application boundary

Flow owns the meaning of the program written in Flow, and the application or host that embeds a run owns everything around it; foundations draws the line.

Guides

Guides show how to do things. They state no rule, and where a guide and a specification differ, the specification is right.

Guide What it shows
The flow command how to use the flow command, its host and its MCP server
Writing a Tool library how to write a Tool library in Python, Rust, another language or an MCP server, and choose honest answers
People and webhooks how a person answers a call through a library that holds it
Runs in the background how runs live in the background under the reference host, and how to stop them
Fix and continue what to do when a run stops, and when to fork instead
Loops that never return how to write a program that runs for days parked on Tool calls
Harnesses over tool registries how to choose between an Action enum the program keeps and an open registry the host keeps
Recursive delegation how delegation recurses, through tasks and nested runs
Sharing types between libraries how modules, libraries and implementations share types
Install Flow how to install, upgrade and uninstall a release bundle and set up an editor
Running agent workflows checking an agent's work, typed answers from a model, and Flow as an MCP server
Embedding Flow in a Rust application how to run Flow inside a Rust application