Skip to content

Builder Guide ​

Write flows in Python with this guide. A flow is an async def function decorated with @flow that runs agents in environments, can ask the person, and can call other flows. If you are new to flows, start with Write your first flow.

A flow is a Python function that drives agents, environments, the person and other flowsA flow is a Python function that drives agents, environments, the person and other flows

A flow ​

  • Anatomy of a flow: use @flow, define arguments, store flows, and run them.
  • Agent roles: declare agents, compare harnesses, and scope an agent to one job.
  • Sessions and turns: start a session, run and steer a turn, read its output, and handle errors.
  • Loops: loop in Python with fresh or persistent sessions, and decide when to stop.
  • Params: declare typed parameters that render as a form in the app and -p flags on the CLI.
  • Context, errors and cleanup: read ctx, catch errors, and clean up when a run stops.
  • Budgets in a flow: read the epic budget, set call or turn budgets, and stop cleanly.

What you can ask an agent ​

  • Goals: give the agent a goal and let it decide when it is done.
  • Typed answers: request structured answers with validation and retries.
  • Hooks: handle turn events like permission requests and agent questions.
  • Tools the agent can call: expose flow functions as tools or add commands to PATH.
  • Skills and permissions: attach skills and control what each role can read, write, and reach.

People ​

Composing ​

Environments ​

Ship it ​

Next ​

  • Tutorials: follow a complete job from nothing to a finished result.
  • Flow API: look up every public name of hmz.flows.
  • User Guide: learn how to run and manage flows in Humanize.

Open source on github.com/humanfia · RSS: blog · news