Principle:SeldonIO Seldon core Pipeline Conditional Routing
| Field | Value |
|---|---|
| Principle Name | Pipeline Conditional Routing |
| Overview | Data-driven routing mechanisms within inference pipelines using triggers, joins, and conditional branching. |
| Domains | MLOps, Data_Flow |
| Related Implementation | SeldonIO_Seldon_core_Seldon_Pipeline_Advanced_Routing |
| Last Updated | 2026-02-13 00:00 GMT |
Description
Seldon pipelines support advanced routing: triggers gate step execution based on upstream outputs, joinType controls how multi-input steps aggregate data (inner/outer/any), and stepsJoin at the output level determines how branched results merge. This enables conditional logic, fan-out/fan-in patterns, and pipeline-to-pipeline composition.
The core routing mechanisms are:
- Triggers: A list of tensor references that gate whether a step executes. The step only runs if the referenced trigger tensors are present and evaluate to a truthy condition. This enables conditional branching where different model paths activate based on upstream predictions.
- Join Types: Control how a step with multiple inputs or triggers aggregates data before executing:
- inner (default): All inputs/triggers must be present before the step executes.
- outer: The step executes with whatever inputs are available (union semantics).
- any: The step executes as soon as any one input/trigger is available (first-available semantics).
- Output Steps Join: The
stepsJoinfield on the output section controls how results from multiple output steps are merged into the pipeline response. Withany, the first available result is returned.
Theoretical Basis
Conditional routing extends DAGs with control flow. Triggers implement guard conditions (only execute if upstream tensor matches criteria). Join semantics (inner=all required, outer=union, any=first available) determine data aggregation strategy at convergence points.
This is analogous to control flow in dataflow programming languages:
- Triggers as guards: Similar to conditional execution in dataflow graphs where a node only fires when its guard condition is satisfied. The guard is an upstream tensor output that acts as a boolean gate.
- Join semantics as synchronization barriers: In parallel dataflow systems, convergence points must decide how to handle partial data. Inner join requires all branches to complete (barrier synchronization), outer join accepts partial results (non-blocking merge), and any join takes the first responder (race condition resolution).
- Pipeline-to-pipeline composition: Pipelines can reference other pipelines as inputs, enabling hierarchical decomposition of complex inference workflows. This follows the composability principle where complex systems are built from simpler, well-defined subsystems.
The combination of triggers and join semantics provides Turing-incomplete but expressive control flow sufficient for most inference routing patterns without the complexity of arbitrary control flow.
When to Use
Use this principle when pipeline logic requires:
- Conditional branching: Different models should process the input based on a classifier's output (e.g., route to model A if class 1, model B if class 2).
- Parallel fan-out processing: Multiple models should process the same input in parallel, with results aggregated downstream.
- Selective execution: Only certain pipeline branches should execute based on runtime data conditions.
- Race conditions: The first model to respond should provide the pipeline output (using
stepsJoin: any). - Guard conditions: Steps should only execute when specific upstream conditions are met.
Structure
Conditional routing is layered onto the base pipeline topology:
- Define trigger sources: Identify which upstream model outputs serve as boolean gates for conditional execution.
- Configure trigger lists: Each conditionally-executed step lists its trigger tensor references in the
triggersfield. - Set join semantics: Choose
triggersJoinType,inputsJoinType, orstepsJoinbased on the desired aggregation behavior. - Handle timing: Use
joinWindowMsto set the maximum time to wait for join inputs before timing out.
Related Pages
- SeldonIO_Seldon_core_Seldon_Pipeline_Advanced_Routing - implements - Concrete YAML patterns for configuring triggers, joins, and conditional branching.
- SeldonIO_Seldon_core_Pipeline_Topology_Definition - extends - Base DAG topology that conditional routing builds upon.
- SeldonIO_Seldon_core_Seldon_Pipeline_CRD - base pattern - The Pipeline CRD structure that conditional routing fields are added to.
- SeldonIO_Seldon_core_Pipeline_Inference_Execution - consumed by - Inference requests flow through conditional routing logic at runtime.
Implementation:SeldonIO_Seldon_core_Seldon_Pipeline_Advanced_Routing