Documentation
¶
Index ¶
- func ExecuteFlowDefinition(flowInstance flow.Flow, initialInputs map[string]any, options *Options) (*spi.FlowExecutionResult, error)
- type ExecutionObserver
- type FlowEngine
- type FlowFinishedEvent
- type FlowStartedEvent
- type Middleware
- type NodeExecutor
- type NodeFinishedEvent
- type NodeStartedEvent
- type NoopObserver
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteFlowDefinition ¶
Types ¶
type ExecutionObserver ¶
type ExecutionObserver interface {
FlowStarted(evt FlowStartedEvent)
NodeStarted(evt NodeStartedEvent)
NodeFinished(evt NodeFinishedEvent)
FlowFinished(evt FlowFinishedEvent)
}
type FlowEngine ¶
type FlowEngine struct {
// contains filtered or unexported fields
}
func NewFlowEngine ¶
func NewFlowEngine(flowInstance flow.Flow, options *Options) (*FlowEngine, error)
func (*FlowEngine) Execute ¶
func (engine *FlowEngine) Execute(initialInputs map[string]any) ( *spi.FlowExecutionResult, error, )
type FlowFinishedEvent ¶
type FlowStartedEvent ¶
type Middleware ¶
type Middleware func(NodeExecutor) NodeExecutor
Middleware wraps a NodeExecutor to add cross-cutting behavior — retry, timeout, tracing, circuit-breaking — without baking it into node code. The first middleware in the slice is the outermost wrapper (it runs first / sees the final result last).
type NodeExecutor ¶
type NodeExecutor func(spi.ExecutionContext) (spi.AnyResult, error)
NodeExecutor runs a single node and returns its result. It is the unit that Middleware wraps.
type NodeFinishedEvent ¶
type NodeStartedEvent ¶
type NoopObserver ¶
type NoopObserver struct{}
func (NoopObserver) FlowFinished ¶
func (NoopObserver) FlowFinished(FlowFinishedEvent)
func (NoopObserver) FlowStarted ¶
func (NoopObserver) FlowStarted(FlowStartedEvent)
func (NoopObserver) NodeFinished ¶
func (NoopObserver) NodeFinished(NodeFinishedEvent)
func (NoopObserver) NodeStarted ¶
func (NoopObserver) NodeStarted(NodeStartedEvent)
type Options ¶
type Options struct {
Observer ExecutionObserver
ModuleResolver spi.ModuleResolver
ModuleCallStack []string
DynamicVars spi.DynamicResolver
// Ctx is the request-scoped context propagated to every node execution for
// cancellation/deadlines. Nil is treated as context.Background().
Ctx context.Context
// Middleware wraps each node's execution (retry/timeout/tracing). Outermost first.
Middleware []Middleware
}
Click to show internal directories.
Click to hide internal directories.