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 ⚡

ComponentDescriptionRequiredExample
versionFlow specification version using semantic versioningYes"0.1.0"

Metadata

ComponentDescriptionRequiredExample
flow_typeType of flow (must be “compound”)Yes"compound"
nameUnique identifier for the flowYes"your-flow-name"
descriptionExplanation of flow’s purposeYes"A brief description of your flow"
authorCreator’s usernameYes"your-username"
tagsKeywords for categorizationNo[tag1, tag2, tag3]
privateAccess control settingYesfalse

Input Configuration

ComponentDescriptionRequiredExample
inputsMap of input parametersYesCollection of input definitions
typeData type of input (currently only string)Yes"string"
descriptionPurpose of the inputYes"Description of input1"
requiredWhether input is mandatoryYestrue or false
exampleSample input valueNo"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

ComponentDescriptionRequiredExample
typeMust be “elemental”Yes"elemental"
flow_nameReference to existing Elemental FlowYes"author/flow-name"
inputsMapping to flow inputsYesInput mapping object
depends_onList of dependent stagesNo["stage1", "stage2"]

Custom Stage Configuration

ComponentDescriptionRequiredExample
typeMust be “custom”Yes"custom"
modelLLM configurationYesModel settings object
promptProcessing instructionsYesTemplate with placeholders
inputsStage input parametersYesInput mapping object
datasetRAG dataset configurationNo"author_name/dataset_name"
depends_onList of dependent stagesNo["stage1", "stage2"]

Dependency Configuration

ComponentDescriptionRequiredExample
depends_onList of stages that must complete before executionNo["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

ComponentDescriptionRequiredExample
output.valueList of stage outputs to combineYes[${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:

  1. Advanced Decision Making with conditional processing paths 🧠

  2. Custom Processing stages with direct model and prompt configurations ⚙️

  3. Integration of existing Elemental Flows for reusability 🔄

  4. Parallel execution of independent stages ⚡

  5. Sequential execution through depends_on configurations đź”—

  6. Flexible input/output mapping between stages 🔀