Skip to content

Value Routing

The Value Router block is a versatile utility in FlowRunner™ that allows you to dynamically route flow execution based on predefined cases. By defining cases—static or dynamic—it allows you to split the flow into multiple branches, ensuring decisions are handled with precision and flexibility. The built-in Everything Else case further enhances the block by providing a default branch for unmatched values, ensuring the flow continues smoothly even in unexpected scenarios.

value router example

Using the Value Router Block

The Value Router block dynamically routes flow execution based on predefined cases. It evaluates a single input value and splits the flow into branches, each corresponding to a specific case. This makes it ideal for workflows requiring clear decision-based routing.

To configure a Value Router:

  1. Set Up Input Value
    Start by specifying the input value for the block. This could come from a trigger event data, result of an action (e.g., a database query or API call), output from a data transformation. Broadly speaking, the Value Router input can be anything that is referenced in the Expression Editor.

  2. Define Cases
    Define possible outcomes for the input value by configuring cases:

    • Static Values: Specify fixed values for predictable routing, such as predefined roles ("admin", "user") or states ("pending", "approved").
    • Dynamic Values: Use the Expression Editor to create dynamic cases based on flow data. This enables cases to adapt to changing conditions, such as seasonal adjustments or data transformations.

    Assign a descriptive label (called "Case") for clarity.

  3. Handle Everything Else

    The Everything Else case is automatically included in every Value Router block. This branch activates when the input value doesn’t match any of the defined cases. Use this branch to handle unexpected scenarios gracefully, such as logging errors or applying fallback logic.

  4. Branch the Flow
    The Value Router generates a connector for each case. Link these connectors to specific actions or transformations to define the flow’s execution paths.

Key Features

The Expression Editor integration enables dynamic routing by allowing cases to evaluate live data. For example, you could define cases based on:

  • User roles ("admin", "user", "guest").
  • Workflow statuses ("pending", "approved", "rejected").
  • Ranges of numerical values (e.g., checking if a value is greater than 10).

The Expression Editor allows you to define dynamic case values that adapt to the flow’s current context. For example:

  • Seasonal Adjustments: Map customer satisfaction ratings to cases dynamically based on seasonal benchmarks. During a holiday period, a satisfaction rating of "7" might map to "Highly Satisfied," whereas the same rating might map to "Neutral" at other times.
  • Threshold Changes: Adjust routing based on evolving business rules, such as categorizing order values into tiers ("Small Order", "Medium Order", "Large Order") dynamically based on the latest thresholds.

The Everything Else case ensures robustness by covering input values that don’t match any defined case. This feature prevents flow interruptions by routing unmatched values to a default branch. For example, you can log the unexpected value for later review or execute an alternative action when a match isn’t found.

The Value Router block simplifies decision-making by centralizing routing logic. This keeps flows clean and readable, even with multiple branching paths.