Documentation
¶
Index ¶
- type NodeRunSubFlow
- func (n *NodeRunSubFlow) GetAIParams() []nai.AIParam
- func (n *NodeRunSubFlow) GetID() idwrap.IDWrap
- func (n *NodeRunSubFlow) GetName() string
- func (n *NodeRunSubFlow) GetOutputVariables() []string
- func (n *NodeRunSubFlow) GetRequiredVariables() []string
- func (n *NodeRunSubFlow) RunAsync(ctx context.Context, req *node.FlowNodeRequest, ...)
- func (n *NodeRunSubFlow) RunSync(ctx context.Context, req *node.FlowNodeRequest) node.FlowNodeResult
- type SubFlowExecutor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeRunSubFlow ¶
type NodeRunSubFlow struct {
FlowNodeID idwrap.IDWrap
Name string
TargetFlowID *idwrap.IDWrap
TargetFlowName string
Inputs []mflow.SubFlowInputMapping
Executor SubFlowExecutor
// TargetParams holds the target sub-flow's trigger parameter definitions.
// Populated by the builder when it can resolve the target flow.
// Used by GetAIParams() for AI tool integration.
TargetParams []mflow.SubFlowParam
}
NodeRunSubFlow invokes another flow from the parent flow. It evaluates input expressions, calls the SubFlowExecutor, and writes the sub-flow outputs to the parent VarMap under this node's name.
func New ¶
func New( id idwrap.IDWrap, name string, targetFlowID *idwrap.IDWrap, targetFlowName string, inputs []mflow.SubFlowInputMapping, executor SubFlowExecutor, ) *NodeRunSubFlow
func (*NodeRunSubFlow) GetAIParams ¶
func (n *NodeRunSubFlow) GetAIParams() []nai.AIParam
GetAIParams implements nai.AIParamProvider. When RunSubFlow is connected to an AI node via HandleAiTools, the AI agent can invoke it as a tool. The parameter schema comes from the target flow's SubFlowTrigger params.
func (*NodeRunSubFlow) GetID ¶
func (n *NodeRunSubFlow) GetID() idwrap.IDWrap
func (*NodeRunSubFlow) GetName ¶
func (n *NodeRunSubFlow) GetName() string
func (*NodeRunSubFlow) GetOutputVariables ¶
func (n *NodeRunSubFlow) GetOutputVariables() []string
GetOutputVariables implements node.VariableIntrospector.
func (*NodeRunSubFlow) GetRequiredVariables ¶
func (n *NodeRunSubFlow) GetRequiredVariables() []string
GetRequiredVariables implements node.VariableIntrospector.
func (*NodeRunSubFlow) RunAsync ¶
func (n *NodeRunSubFlow) RunAsync(ctx context.Context, req *node.FlowNodeRequest, resultChan chan node.FlowNodeResult)
func (*NodeRunSubFlow) RunSync ¶
func (n *NodeRunSubFlow) RunSync(ctx context.Context, req *node.FlowNodeRequest) node.FlowNodeResult
type SubFlowExecutor ¶
type SubFlowExecutor interface {
// ExecuteSubFlow runs the target flow with the given input variables.
// It returns the output variables produced by the sub-flow's Return node.
ExecuteSubFlow(ctx context.Context, targetFlowID *idwrap.IDWrap, targetFlowName string, inputVars map[string]any) (map[string]any, error)
}
SubFlowExecutor loads and runs a target sub-flow. Implementations live in the flowbuilder or CLI packages where they have access to all required services.