AutoFlow asks a model to break a query into a team of agents, each with a task, the tools it may use and the agents it depends on, and turns the plan into a flow. Independent agents run in parallel.
run() returns the answer of the last agent of the plan, in dependency order. Its agents run in-process with the llm and the tool instances you gave, your own tools included.

Plan first, run later

plan(query) returns the Flow without running it, so it can be reviewed, edited, saved or run durably:
A planned flow refers to the model and the tools by name (openai/gpt-5-mini, wikipedia), so it can run anywhere. That works for built-in providers and tools only; with your own tools, use autoflow.run(), which runs the plan with the instances you gave.

From the command line

When to use it

AutoFlow suits exploratory, multi-step research where the decomposition is not known in advance. For a pipeline you run repeatedly, plan it once, review the YAML and keep it as a regular flow: the result is then predictable and cheaper. For decisions taken turn by turn, use a team or sub-agents.