Protected_JSON validator instance for cleaning and validating responses
Static ReadonlyCURRENT_Common placeholder for current payload injection
Flow agents don't need loop results injected as messages - they navigate paths
Flow agents don't require agent-level prompts - they use step-level prompts exclusively
Flow agents apply ActionOutputMapping after each iteration
OptionalBeforeCalled before each loop iteration to prepare parameters and payload.
Loop agents use this to resolve template variables ("item.email"). Flow agents typically don't need this (params already resolved).
Current iteration context
Modified context or null for default behavior
ProtectedcreateProtectedCreates a standardized next step object with common defaults
The payload type
The step type
Additional options to merge
The next step object
ProtectedcreateProtectedCreates a retry step with a standardized error message
The payload type
The error message
Additional options
Retry step
ProtectedcreateProtectedCreates a success step with optional payload changes
The payload type
Success options
Success step
Determines the initial step for flow agent types.
Flow agents look up their configured starting step instead of executing a prompt. If agentTypeParams.startAtStep is provided, the flow will begin at that step instead of the configured entry point.
The full execution parameters
The initial step to execute, or null if flow context not ready
Determines the next step based on the flow graph structure.
For Flow agents, the next step is determined by:
Result from prompt execution (null for non-prompt steps)
The full execution parameters
The next step to execute
Provides Flow-specific guidance for prompt configuration
Gets the prompt to use for a specific step. Flow agents may use different prompts for different steps in the flow.
The execution parameters
The loaded agent configuration
OptionalpreviousDecision: BaseAgentNextStep<P>The previous step decision that may contain flow prompt info
Custom prompt for flow steps, or default config.childPrompt
Flow agents should NEVER fall back to prompt execution for Success/Failed steps. Flow agents are deterministic and driven by their graph structure (steps and paths). When a step completes (Success or Failed), the agent should terminate rather than retry with prompts.
Handles the initialization of the flow agent state that is specialized, additional state information specific to the Flow Agent Type
Injects flow-specific context into the prompt parameters.
The payload to inject
The prompt parameters to update
Agent identification info
ProtectedparseProtectedParses JSON response from prompt execution with automatic validation syntax cleaning
The expected response type
The prompt execution result
Parsed response or null if parsing fails
Override of BaseAgentType's PostProcessActionStep to handle Flow-specific logic.
This method checks if the current step has action output mapping configured and applies it to update the payload accordingly.
The results from action execution
The actions that were executed
The current payload
The current step being executed
Payload changes from output mapping
Post-processes the result of sub-agent execution.
This method is called by BaseAgent after a sub-agent has been executed. Agent types can override this method to perform custom processing of sub-agent results, such as extracting specific data from the sub-agent's payload or updating context.
The result from sub-agent execution
The sub-agent request that was executed
The current payload
The current step being executed
Optional payload change request
Override of BaseAgentType's PreProcessActionStep to handle Flow-specific input mapping.
This method checks if the current step has action input mapping configured and applies it to map payload values or static values to action input parameters.
The actions that will be executed (modified in place)
The current payload
The current step being executed
Optionalparams: ExecuteAgentParams<P>Actions are modified in place
Pre-processes steps for flow agent types.
For Flow agents, 'Retry' after actions means evaluate paths from the current step and continue the flow based on the updated payload. The only exception is when executing a Prompt step within the flow, which should execute normally.
Also, 'Success' steps after sub-agents need to be evaluated in the same way as Retry after actions
The full execution parameters
The retry step that was returned
The current payload
The current agent type state
The next flow step, or null for prompt execution
Processes action results and applies output mapping if configured This should be called by BaseAgent after action execution
OptionaloutputMapping: stringOptionalcurrentPayload: PProtected StaticgetProtectedInstantiates an agent type class using a specific driver class name.
This method is used when an individual agent has its own DriverClass override, allowing for specialized implementations per agent instance.
The driver class name to instantiate
Instance of the agent type class
Protected StaticgetProtectedInstantiates the appropriate agent type class based on the agent type entity.
This method uses the MemberJunction class factory to dynamically instantiate agent type classes. It uses the DriverClass field. If DriverClass is not specified it throws an error.
The agent type entity to instantiate
Instance of the agent type class
StaticGetHelper method that retrieves an instance of the agent type based on the provided agent type entity.
This method uses the ClassFactory to create an instance of the agent type class specified in the DriverClass field of the agent type entity. If the DriverClass is not specified, it throws an error.
The agent type entity to instantiate
An instance of the agent type class
Implementation of the Flow Agent Type pattern.
This agent type enables deterministic workflow execution where agents follow predefined paths through a graph of steps. Key features:
FlowAgentType
Example