Skip to content

Interface: FlowExecutionContext<TIn, THandle> ​

Defined in: runtime/flow/flow-execution-context.ts:29

Mutable runtime state and dependency context for executing a single FlowNode run (SPEC.md §3.9).

Holds the root scopeHandle, completedStepOutputs map, pinned wire prefixes, AbortController for active step drain barriers, and runtime store/manager references.

Type Parameters ​

Type ParameterDefault typeDescription
TInunknownValidated flow input payload type.
THandleunknownRuntime handle type of the active isolation scope.

Properties ​

PropertyModifierTypeDescriptionDefined in
activeReplacementExecutable?publicStepASTNode<unknown, unknown, THandle>Currently executing replacement StepASTNode promoted via .replaceWith(), if any.runtime/flow/flow-execution-context.ts:85
activeStepAbortControllerpublicAbortControllerAbortController governing the currently executing step for rewind/cancel drain barriers.runtime/flow/flow-execution-context.ts:89
activeStepExecIdpublicstring | nullCurrently executing stepExecId (or null between steps).runtime/flow/flow-execution-context.ts:83
activeStepIdpublicstring | nullCurrently executing stepId (or null between steps).runtime/flow/flow-execution-context.ts:81
completedStepOutputsreadonlyMap<string, unknown>Completed step outputs keyed by FlowStepNode.id or outer FlowBranchNode.id.runtime/flow/flow-execution-context.ts:71
continuationQueuereadonlyStepContinuationQueuePer-stepExecId continuation stack serialization queue.runtime/flow/flow-execution-context.ts:59
currentInputpublicTInLatest validated flow input payload (mutable across .replaceWith() and .onSignal().update()).runtime/flow/flow-execution-context.ts:39
enforceRunBudget?readonly(addedCostUsd) => Promise<{ allowed: boolean; newLimitUsd?: number; }>Optional callback enforcing enclosing lane maxCostUsd budget after each model turn (SPEC.md §1.18 & §3.6).runtime/flow/flow-execution-context.ts:99
envreadonlyReadonly<Record<string, string | undefined>>Explicit environment variable map for resolving symbolic P.env(key) references.runtime/flow/flow-execution-context.ts:47
flowreadonlyFlowNode<TIn, THandle>Passive FlowNode AST definition being executed.runtime/flow/flow-execution-context.ts:37
humanAdaptersByIdreadonlyReadonlyMap<string, HumanAdapter>Map of HumanNode.id to runtime HumanAdapter.runtime/flow/flow-execution-context.ts:65
itemKeyreadonlystringDeduplication key (itemKey) of the work item.runtime/flow/flow-execution-context.ts:35
laneIdreadonlystringIdentifier of the enclosing LaneNode (defaults to 'default-lane').runtime/flow/flow-execution-context.ts:33
ledgerStorereadonlyLedgerStoreDurable state ledger store.runtime/flow/flow-execution-context.ts:49
lessonStore?readonlyLessonStoreOptional lesson store for empirical lesson recall and outcome attribution.runtime/flow/flow-execution-context.ts:55
lockManagerreadonlyScopeLockManagerPer-handle read/write lock manager.runtime/flow/flow-execution-context.ts:57
observedRunEffectsreadonlyToolEffect[]Accumulated ToolEffect entries observed across all steps in the flow run.runtime/flow/flow-execution-context.ts:79
pendingRewindToStepId?publicstringTarget stepId queued by .rewindTo() to jump the flow loop to after draining.runtime/flow/flow-execution-context.ts:91
poolManagerreadonlyPoolManagerStateful pool manager for model and account seat selection.runtime/flow/flow-execution-context.ts:61
prefixGroups?readonlyreadonly PrefixGroupNode[]Optional prefix groups to compile and pin at run start.runtime/flow/flow-execution-context.ts:67
registryreadonlyRuntimeExecutorRegistryComposite runtime executor registry.runtime/flow/flow-execution-context.ts:45
resumeContinuationStack?publicreadonly ContinuationFrame[]Persisted continuation stack restored during reboot recovery for the first resumed step execution.runtime/flow/flow-execution-context.ts:87
retryConfig?readonlyobjectOptional step retry configuration inherited from the enclosing LaneNode.runtime/flow/flow-execution-context.ts:93
retryConfig.exponentialBaseMsreadonlynumber-runtime/flow/flow-execution-context.ts:95
retryConfig.orFailStatereadonlystring-runtime/flow/flow-execution-context.ts:96
retryConfig.triesreadonlynumber-runtime/flow/flow-execution-context.ts:94
runIdreadonlystringUnique identifier of the flow run.runtime/flow/flow-execution-context.ts:31
scopeDriverreadonlyIsolationScope<THandle, Record<string, unknown>> & Partial<CheckpointableScope<THandle, Record<string, unknown>>>Resolved IsolationScope (and optional CheckpointableScope / BranchableScope) driver.runtime/flow/flow-execution-context.ts:43
scopeHandlepublicTHandleActive root isolation scope handle for the run.runtime/flow/flow-execution-context.ts:41
serviceRegistryreadonlyServiceSessionRegistryLifecycle registry for 'scope', 'fork', and 'skill' ServiceSession daemons.runtime/flow/flow-execution-context.ts:63
stepBaseCheckpointsByStepId?readonlyMap<string, string>Optional map of initial base scope checkpoints keyed by FlowStepNode.id.runtime/flow/flow-execution-context.ts:73
stepContinuationStacks?readonlyMap<string, readonly ContinuationFrame[]>Optional map of latest ContinuationFrame[] stacks keyed by stepExecId for step telemetry attribution.runtime/flow/flow-execution-context.ts:75
stepObservedEffectsByStepExecId?readonlyMap<string, ToolEffect[]>Optional map of step-scoped ToolEffect arrays keyed by stepExecId.runtime/flow/flow-execution-context.ts:77
topologyNode?readonlyTopologyNode<string>Optional declarative TopologyNode AST for commitOverlayWhen correlation.runtime/flow/flow-execution-context.ts:51
topologyStore?readonlyTopologyStoreOptional topology store for run-scoped partition contract overlays.runtime/flow/flow-execution-context.ts:53
wirePrefixesByGroupIdpublicReadonlyMap<string, CompiledWirePrefix>Pinned CompiledWirePrefix records keyed by PrefixGroupNode.id.runtime/flow/flow-execution-context.ts:69

Released under the MIT License.