Workflow Logic Elements
Updated
The following topics are available in this article:
Overview
This article discusses key workflow logic elements Guided Workflow configurator. It provides an overview of how these elements help structure and control workflow execution based on dynamic conditions and predefined variables.
Update Properties
The Update Properties node enables you to set the value of a variable within a guided workflow using either a static value or a dynamic value derived from executing a script. Scripts, written in Groovy, can be added within a custom code block and are used for implementing complex configurations and logic within the workflow. You can derive dynamic values from custom fields and other variables, which are used as well.
Note: The Groovy library can be used for guiding how to write Groovy.
Using this capability, you can also write Custom Code.
Once you click on the ${X} icon, a dropdown opens.
Then click on Enter Custom Code.
A screen pops up where you can write your custom code.
You can also execute the workflow by clicking on Execute Code.
Decision Box
The Decision Box is a workflow node used to branch workflows into multiple paths based on defined conditions. For example, if certain teams need to follow one branch under specific conditions and another branch under different conditions, the Decision Box enables this. Conditions can be set using case custom fields, predefined variables, or button actions. Based on these criteria, the workflow dynamically routes to the appropriate branch, ensuring flexibility and precision in workflow execution. If you want to create more than two paths, you can add additional branches. For example, to have three paths instead of two, click on Add Another Path, which creates an extra branch. This allows the workflow to handle multiple scenarios effectively.
Note: The list of operators available will change based on the type of node or variable you select.
Go to Node
If you want to link one branch to a different node, you can use the go-to-node element.
Add Loop Node
The Loop node helps in iterating over a collection variable or an array within a workflow. To add a loop, you need to define a collection variable and then insert the Loop node into the workflow. You can set the direction of the loop (first to last or last to first) and define an iterating variable to be used inside the loop.
How it Works
You can define the direction of iteration, such as from first to last or last to first. Once the direction is set, the loop will work on each item in the array or collection sequentially.
For example, if you have an array with multiple elements, the loop will process each element one by one, allowing you to perform tasks on each item in the collection. You can define a variable (e.g., "i") inside the loop to store and work with each element as the iteration progresses. This way, the workflow will handle each array element independently, executing actions in a defined order based on your specifications.
Loop Variable: The Loop variable is the iterator that picks items separately from an array.
Loop Variable Index: Loop variable index is the item of the array.
Further, if you want to use this node, you can click on Update Properties.
You can select the loop you have created from the Select variable dropdown.
After selecting, click on Save.
Then click on Go to Node.
The workflow will break out of the loop after the last item is encountered in the After Last Item branch.
Break Loop Node
If a specific condition is met and you need to break the loop early, the Break Loop node can be used. If the loop needs to run on all items, auto-branching occurs, and you can specify actions to be executed on each item, as well as tasks to be performed after the loop completes. Once the loop iterates over all items, the workflow continues normally. For more information on the loop configuration, please refer to the related documentation.
Call Another Guided Workflow
Call Another Workflow is a method used to run one workflow inside another. With this approach, you can pass data between workflows by setting input and output variables. You specify which variables from the calling workflow need to be passed to the called workflow.
Though this method is functional, it is less commonly used today because newer methods like Embed Workflow offer better integration. However, Call Another Workflow is still helpful when you need separate workflows to work together while sharing important data.
Embed Guided Workflow
Embed Guided Workflow: This embeds another workflow inside the current workflow. All the variables that are being used in the embedded workflow are available for use in the current workflow, as well as all the variables in the current workflow are available for use in the embedded workflow. This is mainly used in case you want a certain part workflow to be called in multiple workflows.
For example, making an authentication-guided workflow and calling it at the start of every workflow. For effectively using this feature, it is recommended that declare the same variable for the same variable across workflows in a partner. This helps because you can use the variable directly without setting any values, as the value is pre-set from the previous workflow.
Business Hour Check
With the Business Hour Check node, you can easily configure a business hour check to ensure cases are transferred to the appropriate departments based on the current time and the predefined business hours in the system.
Various Fields in Business Hours Node
Enter your node Name: This is where you define the name of the node for the workflow.
Select Business Hours: This determines the business hours during which the check will be conducted.
Define the variable name for Is in business hours: This field allows you to assign a variable that will hold either "true" or "false" depending on whether the case is received during business hours or outside of business hours. This variable can be used later to make decisions or handle cases accordingly.
Enter Start of Next Business Hours (optional): This field lets you assign a variable that holds the date and time for the beginning of the next business hour. This variable is useful for informing customers about the upcoming start of business hours, scheduling messages to be sent at the start of the next business hour, or setting up callbacks for that time.
Enter End of Next Business Hours (optional): This variable is used when you intend to inform the customer about the end time of our business hours for the next time slot.
Define Start of Business Hour Format: This variable lets you choose the format of the Start of Business Hour variable to be returned. The following formats are available with examples:
Time Day Date and Month: 10 AM, Monday, 12th June
Date, Month, and Time: 12th June, 10 AM
Day and Time: Monday, 10 AM
Timestamp: This will return in epoch format
Click Save to save the defined Business Hours node.
Note: The Business Hours node bifurcates into two paths - In Business Hours and Not In Business Hours. The case takes a respective path as per the business hours and the time of the call.
End Current Workflow
The "End Current Workflow" node is used to terminate the current workflow, which could be a particular branch or sequence of actions within a larger Guided Workflow. This action allows for the selective stopping of a specific workflow or sequence while other parts of the larger workflow continue to execute. It's particularly useful when certain conditions or decisions make it necessary to stop only a segment of the process without halting the entire workflow.
End Execution
The End Execution node is used to stop the execution of the entire process. When triggered, this action halts the entire workflow, branches, and sequences within the process, effectively terminating everything in the current execution. This is useful when the entire process needs to be stopped, often due to an error or a condition that requires ceasing all activities in the workflow.