KNIME logo
Contact SalesDownload
Back to all templates

How to Switch Workflow Branches Based on Input Data

Switching workflow branch execution based on input data means automatically directing a process down different paths depending on the characteristics of the data. This approach lets you adapt processing steps to fit the data’s size or structure, ensuring efficiency and relevance without manual intervention.

AutomationData basics how-to
Header icon
Workflow
70%
How to Switch Workflow Branches Based on Input Data

How This Workflow Works

This workflow evaluates the size of an input dataset and automatically chooses between two processing paths: sampling the data if it’s large, or using the full dataset if it’s small. It then creates a bar chart to visualize average working hours by sex, ensuring the process remains efficient and scalable for future data updates.

Key Features:

  • Automatically adapts processing steps to the size of the input data
  • Ensures efficient visualization by sampling large datasets
  • Maintains flexibility for future changes in data volume
  • Produces clear visual insights without manual adjustments

Step-by-step:

1. Determine Data Size and Set Branching Condition:

The workflow first checks how many rows are in the input dataset. It then sets a condition to decide whether to process all data or just a sample, based on whether the row count exceeds a defined threshold.

2. Branch Workflow Based on Data Size:

Depending on the result of the size check, the workflow automatically selects one of two paths. For large datasets, it samples a subset of rows to keep processing efficient. For smaller datasets, it uses all available data.

3. Aggregate and Visualize Results:

After processing the appropriate data subset, the workflow creates a bar chart to present data insights in a clear, visual format.

How to Get Started