Junctions

Junctions help you to model the layout and logic of your flow. Multiple transitions can point to the same junction, or a junction can be the starting point of multiple transitions.

Junction

Junctions themselves don't do anything, they don't execute scripts, don't display an output, they just offer an easy way to model your flow. By following the rules below you will get the most out of junctions.

When do we need junctions?

Here we describe some common cases where junctions are used in flows.

Branching at the beginning of a flow

If you want to branch immediately after a flow trigger you can do this using a junction. This might be necessary if you have different responses for the channels your bot uses, or for different customer types, or on specialized cases of the user input. In this exercise we show you how to branch at the beginning of a flow.

When you add a branch at the beginning of a flow it looks something like this:

Branch at beginning of a flow

When transitions share part of a condition

In this example the transitions following the junction represent special cases of the main case that leads to the junction.

Transitions sharing part of a condition

When can we avoid junctions?

Keep in mind that you can branch directly from an output node without using a junction. Adding junctions in such cases can make your flow harder to manage and also introduce unwanted errors. When adding a simple branch, don't use a junction.

Right and wrong ways to branch

Have a look at the transitions page for another example of correct branching from an output node.

How do we use junctions correctly?

You can add logical branches to your flows using junction nodes. These branches (transitions) can be assigned a language or script condition, and can also be set to unconditional. Here we describe some basic guidelines to help you use junctions in the best way possible.

Tip 1: Incoming transitions that "get input" must be conditional

Transitions connecting an output to a junction should be set to "conditional" and "gets input before continuing". If a transition is conditional it uses a language condition.

Get input and use language condition

Tip 2: Leaving transitions must "continue without input"

Make sure the transitions leaving a junction use the option "continues without input". It will look like this:

Transitions leaving a junction

Tip 3: Use a fallback transition

When multiple transitions leave a junction, use the last transition as a fallback, set to "unconditional".

Use a fallback transition

Was this page helpful?