Skip to content
  • There are no suggestions because the search field is empty.

How-To: Utilize Switch Stages in Pipelines

What is in this article

  • Prerequisites

  • Introduction

  • Configuration Steps

  • Use Cases

  • Switch Example

Prerequisites

This article assumes you have read the[ Switch User Guide](Switch | User Guide | HighByte Account Portal) Article as well as the [Transform Stage Expression article](Transform | User Guide | HighByte Account Portal).

Introduction

The Switch Stage in Pipelines is a feature that allows you to direct data flow dynamically based on specified conditions. This feature is particularly useful for scenarios requiring conditional logic to determine the pathway of data processing. It can be used to segregate data or apply specific transformations.

Configuration Steps

  1. Add a switch Stage to your pipeline

    a. Navigate to the pipeline configuration area in your Intelligence Hub

    b. Insert a Switch Stage into the desired location within your pipeline

  2. Define Switch Case Expressions

    a. In the Switch Stage settings, define the conditions that will determine how the data is routed

    b. Each Switch case should return true and false. If a case returns 'unknown'

[INSERT IMAGE - 2024-04-30-12-31-48-image.png]

Stage and State cannot be referenced in the expression

Event and System can be referenced in the expression

  1. Set up Branches

    a. For each condition set up a branch. Ensure that each branch has appropriate stages that match the expected data processing needs for that condition

Use Cases

  1. Data Handling : Different data schemas can be routed to specific processing routines designed to handle them

  2. Error Handling : Route erroneous or anomalous data to a branch designed for error logging and correction

  3. Flexibility in Operations: Switch statements allow for adjustments in data routing or processing without the need of significant changes to pipeline architecture

Switch Example

In the project file included below contains a basic switch that routes the incoming payload based on the values of the attributes. You can view the switch in action by looking at the pipeline replay.

Download Example Project File - switch-stage.json