Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:SeldonIO Seldon core Seldon Pipeline Advanced Routing

From Leeroopedia
Field Value
Implementation Name Seldon Pipeline Advanced Routing
Type Pattern Doc
Overview Concrete pattern for configuring conditional routing, triggers, and join semantics in Seldon Core 2 Pipelines.
Related Principle SeldonIO_Seldon_core_Pipeline_Conditional_Routing
Source samples/pipelines/choice.yaml:L1-23, samples/pipelines/tfsimples-join.yaml:L1-18
Domains MLOps, Data_Flow
External Dependencies Kubernetes API, Kafka Streams
Knowledge Sources Repo (https://github.com/SeldonIO/seldon-core), Doc (https://docs.seldon.io/projects/seldon-core/en/v2/)
Last Updated 2026-02-13 00:00 GMT

Description

This implementation provides concrete YAML patterns for configuring advanced data routing within Seldon Core 2 Pipelines. It covers conditional branching with triggers, join semantics for multi-input aggregation, and output merging strategies. These patterns extend the base Pipeline CRD with control flow capabilities.

Code Reference

Conditional Choice Pipeline (choice.yaml)

apiVersion: mlops.seldon.io/v1alpha1
kind: Pipeline
metadata:
  name: choice
spec:
  steps:
  - name: choice-is-one
  - name: mul10
    inputs:
    - choice.inputs.INPUT
    triggers:
    - choice-is-one.outputs.choice
  - name: choice-is-two
  - name: add10
    inputs:
    - choice.inputs.INPUT
    triggers:
    - choice-is-two.outputs.choice
  output:
    steps:
    - mul10
    - add10
    stepsJoin: any

Source: samples/pipelines/choice.yaml:L1-23

In this pipeline:

  • choice-is-one and choice-is-two are classifier models that output a boolean-like choice tensor.
  • mul10 only executes if choice-is-one triggers (outputs a truthy choice tensor).
  • add10 only executes if choice-is-two triggers.
  • Both conditional steps receive the original pipeline input via choice.inputs.INPUT.
  • The output uses stepsJoin: any, meaning whichever branch fires returns the result.

Fan-in Join Pipeline (tfsimples-join.yaml)

apiVersion: mlops.seldon.io/v1alpha1
kind: Pipeline
metadata:
  name: join
spec:
  steps:
    - name: tfsimple1
    - name: tfsimple2
    - name: tfsimple3
      inputs:
      - tfsimple1.outputs.OUTPUT0
      - tfsimple2.outputs.OUTPUT1
      tensorMap:
        tfsimple1.outputs.OUTPUT0: INPUT0
        tfsimple2.outputs.OUTPUT1: INPUT1
  output:
    steps:
    - tfsimple3

Source: samples/pipelines/tfsimples-join.yaml:L1-18

In this pipeline, tfsimple3 joins outputs from two parallel upstream steps, using tensorMap to remap tensor names.

Key Parameters

Parameter Description Values
triggers List of tensor references that gate step execution Tensor ref strings (e.g., choice-is-one.outputs.choice)
triggersJoinType How multiple triggers are combined inner (all required), outer (union), any (first)
inputsJoinType How multiple inputs are aggregated inner, outer, any
stepsJoin How output from multiple output steps is merged inner, outer, any
joinWindowMs Milliseconds to wait for join inputs before timeout Integer (e.g., 5000)
batch.size Batch size for step processing Integer

I/O Contract

Inputs

  • Base pipeline topology: A valid Pipeline CRD with steps and output defined.
  • Routing logic requirements: The desired conditional branching and join behavior.

Outputs

  • Enhanced Pipeline CRD YAML: A Pipeline manifest with triggers, join types, and output merge strategies configured.

Usage Examples

Conditional Branching Pattern

Route input to different models based on a classifier output:

spec:
  steps:
  - name: classifier
  - name: model-a
    inputs:
    - pipeline.inputs.data
    triggers:
    - classifier.outputs.class_a
  - name: model-b
    inputs:
    - pipeline.inputs.data
    triggers:
    - classifier.outputs.class_b
  output:
    steps:
    - model-a
    - model-b
    stepsJoin: any

Fan-in with Join Window

Wait up to 5 seconds for both branches before proceeding:

spec:
  steps:
  - name: branch-a
  - name: branch-b
  - name: aggregator
    inputs:
    - branch-a
    - branch-b
    inputsJoinType: inner
    joinWindowMs: 5000
  output:
    steps:
    - aggregator

Loading and Testing

# Load the conditional pipeline
seldon pipeline load -f ./pipelines/choice.yaml

# Wait for readiness
seldon pipeline status choice -w PipelineReady | jq -M .

# Send inference request
seldon pipeline infer choice \
    '{"inputs":[{"name":"INPUT","data":[1],"datatype":"INT32","shape":[1]}]}' | jq -M .

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment