FlowchartExecutionEngine is the activity-owned scoped execution seam. It owns Flowchart runtime state mutation, child scheduling metadata, arrival recording, implicit join evaluation, loop/race scope creation, diagnostics, and deferred composite completion.
The scoped execution model is intentionally not an extension point directly: custom gateway behavior crosses the public policy contract below, and FlowchartExecutionEngine remains the authority that validates and applies policy commands.
- Kind: Contributor (policy decision provider)
- Contract:
Elsa.Activities.Flowchart.Contracts.IFlowchartPolicy - Policy contract: policies receive
IFlowchartPolicyContextand returnFlowchartPolicyDecisioncommands forFlowchartExecutionEngineto validate and apply. - Registration: Register one or more implementations with DI as
IFlowchartPolicy. - Aggregation:
IFlowchartPolicyRegistryresolves all registered policy implementations by stablePolicyKind. - Selection: Flowchart structure metadata can assign a policy kind to a node through
FlowchartStructure.NodeMetadata. - Decision boundary: Policies receive
IFlowchartPolicyContext, which exposes read-only graph/state/trigger information. Policies returnFlowchartPolicyDecisioncommands;FlowchartExecutionEnginevalidates and applies those commands.
Known implementations:
DirectContinuationFlowchartPolicy(intra-domain — default)ImplicitActivationJoinFlowchartPolicy(intra-domain — default)DecisionFlowchartPolicy(intra-domain — default)ParallelForkFlowchartPolicy(intra-domain — default)ParallelJoinFlowchartPolicy(intra-domain — default)InclusiveForkFlowchartPolicy(intra-domain — default)InclusiveJoinFlowchartPolicy(intra-domain — default)FirstWinsFlowchartPolicy(intra-domain — default)MergeFlowchartPolicy(intra-domain — default)
This module also exposes these activity-owned contracts:
Flowchart.Activitieschild slotelsa.flowchart.structurestructure payload with schema version1.0.0FlowchartStructure.ConnectionscontainingFlowchartConnection[]FlowchartStructure.StartNodeIdoptional start-node selectionFlowchartStructure.NodeMetadataoptional node policy metadataFlowchartStructure.ConnectionMetadataoptional connection policy metadataFlowchartStructure.Variablesoptional container-scoped variable declarations (ADR 0027)
Flowchart implements two runtime parent-callback contracts (Elsa.Activities.Runtime.Core.Contracts):
IActivityChildCompletionHandler— invoked when a child completes; routes throughFlowchartExecutionEngine.OnChildCompletedAsyncto follow outbound connections, evaluate implicit/parallel joins, and complete the composite when no active or waiting paths remain.IActivityChildFaultHandler— invoked when a child branch faults (#308); routes throughFlowchartExecutionEngine.OnChildFaultedAsync. Because a flowchart join requires every inbound branch, a faulted inbound branch can never let the join fire, so the flowchart faults deterministically (surfacing a composite incident) instead of hanging — mirroring theParallelfork/join composite. The faulted leaf keeps its own blocking incident.
FlowchartStructureHandlerimplementsIActivityStructureHandler(Elsa.Workflows.Design.Core) withSupportsScopedVariables = trueandProjectScopedVariables— aFlowchartis a container scope that can own container-scoped variables visible to its descendant activities, using the same generic scope semantics asSequence(ADR 0027).