1
presets
The input named by presets.by picks a parameter set; without it, the values in defaults apply. Replaces only {{preset.x}} in steps.
2
trim by project
if: on the flow's own steps and on use: is evaluated against project; if false, the step is removed and the steps that depend on it inherit its needs. An input whose if: is false becomes hidden and keeps its default. {{project.x}} in with: is filled in first and passed to the fragment with its type.
3
use: fragments
Reads flows/lib/*.yaml, checks with against params, replaces {{params.x}}, drops unwanted steps by the fragment's if: (params only) and trims needs. Fragment IDs come from the id of the use entry.
4
project values
{{project.x}} is read from the project pack's project.yaml (template overlaid); {{project.prompts.<slot>}} is the text of prompts/<slot>.md. Both are read fresh at start. A flow that uses project values or if: without --project is an error.
5
check
Flow model validation: IDs, needs graph, expressions, field ranges.