# Flow Execution

Flow execution components enable complex workflow orchestration, sub-flow management, and nested flow operations within BroxiAI.

## Run Flow

The Run Flow component executes other BroxiAI flows from within the current flow, enabling modular workflow design.

### Usage

Run Flow capabilities:

* Execute external flows
* Pass data between flows
* Modular workflow architecture
* Flow composition
* Reusable workflow components

### Inputs

| Name        | Display Name | Info                              |
| ----------- | ------------ | --------------------------------- |
| flow\_id    | Flow ID      | Identifier of the flow to execute |
| input\_data | Input Data   | Data to pass to the executed flow |
| tweaks      | Tweaks       | Flow configuration overrides      |

### Outputs

| Name         | Display Name | Info                                    |
| ------------ | ------------ | --------------------------------------- |
| flow\_result | Flow Result  | Results returned from the executed flow |

## Sub Flow

The Sub Flow component enables hierarchical flow organization and nested workflow execution.

### Usage

Sub Flow features:

* Nested workflow execution
* Hierarchical flow organization
* Isolated execution contexts
* Parameter passing
* Result aggregation

### Inputs

| Name       | Display Name | Info                               |
| ---------- | ------------ | ---------------------------------- |
| sub\_flow  | Sub Flow     | Sub-flow definition or reference   |
| parameters | Parameters   | Parameters to pass to the sub-flow |
| context    | Context      | Execution context for the sub-flow |

### Outputs

| Name              | Display Name    | Info                                |
| ----------------- | --------------- | ----------------------------------- |
| sub\_flow\_result | Sub Flow Result | Results from the sub-flow execution |

## Flow as Tool

The Flow as Tool component enables flows to be used as tools by AI agents and other components.

### Usage

Flow as Tool capabilities:

* AI agent integration
* Tool-like flow execution
* Dynamic flow invocation
* Agent-driven workflows
* Tool composition

### Inputs

| Name           | Display Name  | Info                              |
| -------------- | ------------- | --------------------------------- |
| flow\_tool     | Flow Tool     | Flow configured as a tool         |
| tool\_input    | Tool Input    | Input data for the tool execution |
| agent\_context | Agent Context | Context from the calling agent    |

### Outputs

| Name         | Display Name | Info                                 |
| ------------ | ------------ | ------------------------------------ |
| tool\_result | Tool Result  | Results from the tool flow execution |

## Usage Notes

* **Modular Design**: Create reusable and composable workflows
* **Data Flow**: Seamless data passing between flows
* **Error Handling**: Robust error propagation and handling
* **Performance**: Optimized execution for nested flows
* **Scalability**: Support for complex workflow hierarchies
* **Agent Integration**: Native support for AI agent tool usage
