Compound Flows
Step-by-step guide to installing and setting up Mira Flows SDK for your project
A Compound Flow is an advanced flow type designed for complex, multi-stage processing pipelines. Unlike Elemental Flows which perform single, focused tasks, Compound Flows can create sophisticated decision trees, implement custom processing logic, and orchestrate multiple processing stages. 🎯
Compound Flow Attributes
Version ⚡
Component | Description | Required | Example |
---|---|---|---|
version | Flow specification version using semantic versioning | Yes | "0.1.0" |
Metadata
Component | Description | Required | Example |
---|---|---|---|
flow_type | Type of flow (must be “compound”) | Yes | "compound" |
name | Unique identifier for the flow | Yes | "your-flow-name" |
description | Explanation of flow’s purpose | Yes | "A brief description of your flow" |
author | Creator’s username | Yes | "your-username" |
tags | Keywords for categorization | No | [tag1, tag2, tag3] |
private | Access control setting | Yes | false |
Input Configuration
Component | Description | Required | Example |
---|---|---|---|
inputs | Map of input parameters | Yes | Collection of input definitions |
type | Data type of input (currently only string) | Yes | "string" |
description | Purpose of the input | Yes | "Description of input1" |
required | Whether input is mandatory | Yes | true or false |
example | Sample input value | No | "Example value for input1" |
Workflow Configuration
Each Compound Flow must define a workflow consisting of multiple processing stages. There are two types of workflow stages:
Elemental Stage Configuration
Component | Description | Required | Example |
---|---|---|---|
type | Must be “elemental” | Yes | "elemental" |
flow_name | Reference to existing Elemental Flow | Yes | "author/flow-name" |
inputs | Mapping to flow inputs | Yes | Input mapping object |
depends_on | List of dependent stages | No | ["stage1", "stage2"] |
Custom Stage Configuration
Component | Description | Required | Example |
---|---|---|---|
type | Must be “custom” | Yes | "custom" |
model | LLM configuration | Yes | Model settings object |
prompt | Processing instructions | Yes | Template with placeholders |
inputs | Stage input parameters | Yes | Input mapping object |
dataset | RAG dataset configuration | No | "author_name/dataset_name" |
depends_on | List of dependent stages | No | ["stage1", "stage2"] |
Dependency Configuration
Component | Description | Required | Example |
---|---|---|---|
depends_on | List of stages that must complete before execution | No | ["stage1", "stage2"] |
Execution Behavior
-
Stages without depends_on can execute in parallel
-
Stages with depends_on will wait for specified stages to complete
-
Multiple stages can depend on the same previous stage
Output Configuration
Component | Description | Required | Example |
---|---|---|---|
output.value | List of stage outputs to combine | Yes | [${stage1.outputs}, ${stage2.outputs}] |
Basic Flow Structure
Implementation Structure 🛠️
Compound Flows can either define custom processing logic within their workflow or integrate existing Elemental Flows, providing maximum flexibility for solving complex challenges. The workflow allows for:
-
Advanced Decision Making with conditional processing paths đź§
-
Custom Processing stages with direct model and prompt configurations ⚙️
-
Integration of existing Elemental Flows for reusability 🔄
-
Parallel execution of independent stages ⚡
-
Sequential execution through depends_on configurations đź”—
-
Flexible input/output mapping between stages 🔀
Was this page helpful?