PersistentAI API Documentation / @persistentai/fireflow-types / buildExecutionPlan
Function: buildExecutionPlan()
buildExecutionPlan(
flow,context,options?):ExecutionPlan
Defined in: packages/fireflow-types/src/flow/execution/planner/sp-tree-builder.ts:39
Build an ExecutionPlan (SP-tree) from a flow DAG.
Steps:
- Filter executable nodes (shouldNodeExecuteInContext)
- Detect pure clusters
- Add implicit captured-child -> parent edges
- Build adjacency list
- Validate DAG
- If disableSPTreeOptimization -> flat Series
- Compute post-dominators + detect fork-join regions
- Recursively build SP-tree
- Optimization pass (collapse trivial branches)