How Conditional Paths Work?
Conditional Path is a part of setting up the automations by providing logical expressions that resolve to either true or false. Based on this, different actions can be executed for different paths. It adds flexibility and adaptability in automation.
Here are the steps to configure Conditional Path in your automation.
- Configure Trigger
- Configure Action Step
- Select Conditional Path
- If - Add Step
- Else - Add Step
- Select Conditional Path
-
Configure Trigger
Triggers are invocation events that happen whenever an event is triggered. Agent OS provides different triggers to invoke an event based on certain conditions.
Click to enlargeFor example, Contentstack Trigger provides different events to configure the trigger connector, such as executing an action when an entry is created in Contentstack.
Note If the trigger conditions do not satisfy the conditions, then the automation will not be executed. To go ahead in the conditional path block, the configuration in the Trigger Conditions (if provided) must match.
-
Configure Action Step
Configure Action Step executes when the trigger event is fired. For example, when an entry is created/updated/deleted in Contentstack, a slack message is sent to the channel to notify the team members of the ongoing updates.
Click to enlargeContentstack provides a variety of connectors or third-party applications that can be used based on the requirements. This allows you to connect your Contentstack application to a third-party application by simply authenticating your account.
NotePause and Response action connectors cannot be used inside Conditional Path.
Click to enlargeIn the Conditional Path configuration, provide the conditions you want to set up in the input box.
Suppose you want to execute the If block only when an entry is created in a specific content type. You can provide the content type UID and match it with the content type.
Click to enlarge -
2-1 If (Configure Action Step)
In the Configure Action Step section, provide the action you want to perform if the conditions provided in the Conditional Path configuration resolves to true, then the If block will get executed.
Click to enlargeYou can check the success message for the execution of the automation in the Execution Log section.
Click to enlargeSimilarly, you can add multiple steps in the If statement for execution. See the screenshot below.
Click to enlarge -
2-2 Else (Configure Action)
The basic formula of the Conditional Path is to execute a specific action. Check for the configuration; if the conditions match, execute IF; otherwise, execute ELSE block.
So, if the condition resolves to false, then execute the Else block. You can set up any action connector in the Else block.
Click to enlargeOnce the Else block is executed, you can check the success message for the execution in the Execution Log section. In detail , you can see the name of the steps that are executed and number of steps configured (2-3 and 3-2)
Click to enlargeNoteThe naming for steps 2-1, 2-3, 4-3 depends on the number of actions configured in the conditional path.