Skip to content

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:

  1. Filter executable nodes (shouldNodeExecuteInContext)
  2. Detect pure clusters
  3. Add implicit captured-child -> parent edges
  4. Build adjacency list
  5. Validate DAG
  6. If disableSPTreeOptimization -> flat Series
  7. Compute post-dominators + detect fork-join regions
  8. Recursively build SP-tree
  9. Optimization pass (collapse trivial branches)

Parameters

flow

Flow

context

ExecutionContext

options?

SPTreeExecutionOptions

Returns

ExecutionPlan

Licensed under BUSL-1.1