Vercel Logo
DOCS
TECHNICAL DOCS
QUERY PIPELINES
CONDITIONAL BRANCHING PIPELINE

Conditional Branching Pipeline

The If-Else pipeline within Syncraft's query engine facilitates conditional branching within the query execution flow. This pipeline is employed whenever the pipeline logic must diverge based on a predicate test. The primary components of the If-Else pipeline include:

Untitled (11).jpg

  • The condition is a predicate query executed against the pipeline input state to determine the flow of execution.
  • The Then query pipeline is triggered if the specified specified evaluates to true.
  • The Or pipeline is triggered if the specified set evaluates to false.

Implementation

The If-Else pipeline can be integrated within the larger query pipeline structure to ensure that specific logic is executed based on certain conditions, making the query engine more flexible and adaptive to varying data scenarios.

In context with higher-order pipelines, an If-Else pipeline could be nested within Serial, Parallel, or Race pipelines to further control the logic flow and ensure that the data retrieved or transformed aligns with the application's logic requirements.

By structuring the query logic in this way, developers can create complex, condition-driven data retrieval and transformation flows that are robust and easy to manage.

Continue Your Journey
Filter And Data Guard Pipeline
Continue Your Journey
Looping Pipelines