Agent
📸 Screenshots
Here are visual examples of this section:
Agent - Worker Configuration Interface
1. Overview and Purpose
The Agent worker encapsulates an entire agent to be executed as a worker within larger workflows. It allows you to embed complex agent logic as a reusable component, taking inputs from connected workers and producing outputs that can be consumed by downstream workers. This enables modular agent composition and workflow orchestration.
2. Configuration Parameters
The Worker accepts the following parameters:
agent: Optional reference ID to specify which agent should be executed by this worker
3. Input/Output Handles
The handles are dynamically created based on the referenced agent's configuration:
- Input handles: Accept data that gets passed to the agent's input worker
- Output handles: Return data from the agent's response worker after execution
4. Usage Examples with Code
// Agent worker execution with input data
const agentWorker = {
type: "agentWorker",
parameters: {
agent: 123 // Reference to specific agent
},
handlers: [
{ name: "userQuery", direction: "input", value: "What is the weather?" },
{ name: "response", direction: "output", value: null }
]
}
// The worker will execute the referenced agent and populate output handles
await execute(agentWorker, parameters)5. Integration Examples
Agent workers are ideal for creating reusable agent components that can be chained together in complex workflows. They enable you to break down sophisticated AI processes into manageable, testable units that can be combined and orchestrated.
6. Best Practices
- Ensure the referenced agent has properly configured input and output workers before execution
- Use descriptive handle names that clearly indicate the data flow between agents
- Test agent workers independently before integrating them into larger workflows
- Consider the computational cost when nesting multiple agent workers
7. Troubleshooting Tips
- Verify that the referenced agent exists and is properly configured if execution fails
- Check that input handles are properly connected and contain valid data
- Ensure the agent's input and output workers are correctly set up
- Monitor execution flow to identify bottlenecks in nested agent workflows
