--- title: Control Flow excerpt: Control Flow blocks that are available in the Plugin Editor. deprecated: false hidden: false metadata: title: '' description: '' robots: index next: pages: - slug: moveworks-dsl-reference title: DSL Reference type: basic --- # Overview Control Flow blocks in the Plugin Editor enable developers to define the logic and decision-making processes for conversational plugins. These blocks work alongside Activities to create workflows that mirror business processes. # Conversation Process Decision Policy ## What is a Decision Policy? A **Conversation Process Decision Policy** executes a set of process blocks based on whether a condition, defined using a DSL expression, evaluates to `true`. It emulates human decision-making by directing the AI agent’s workflow according to predefined rules. #### Use Case Example For a flight booking plugin, your organization may require: * **If the flight is booked ≥ 7 days in advance**: The Assistant books the flight directly. * **If booked \< 7 days in advance**: The Assistant collects approval from a manager before booking. * **If booked \< 3 days in advance**: The Assistant instructs the user to book with a personal card and submit a reimbursement request. ![](https://files.readme.io/c570fb7056d34f140b50aeff674b6db54459d73f61063dcd09602775391e91a8-CleanShot_2025-10-22_at_15.00.402x.png) ## Anatomy of a Decision Policy ### Required Slots Specify the slots that must be collected before evaluating the decision policy. These ensure the AI has the necessary data to make informed decisions. ![](https://files.readme.io/f7c5f2854641532a4ce3ab766ddf4d37f6564729d126e90f0b18474ca0edca2b-CleanShot_2025-10-22_at_15.08.29.png) ### Cases Each case defines a condition using a DSL expression. If the condition evaluates to true, the associated process blocks are executed. #### Example: Referencing Slot Values To evaluate a slot named `asana_project`, use the following DSL syntax: ```yaml DSL # data..vlaue == "" data.asana_project.value == "ProjectX" ``` This checks if the `asana_project` slot equals "ProjectX" and directs the workflow accordingly. #### Example: Flight Booking Policy ```yaml DSL # Case 1: Flight is ≥7 days away $PARSE_TIME(data.travel_date.value) >= $TIME().$ADD_DATE(0, 0, 7) # Case 2: Flight is <7 days but ≥3 days $PARSE_TIME(data.travel_date.value) < $TIME().$ADD_DATE(0, 0, 7) AND $PARSE_TIME(data.travel_date.value) >= $TIME().$ADD_DATE(0, 0, 3) # Case 3: Flight is <3 days $PARSE_TIME(data.travel_date.value) < $TIME().$ADD_DATE(0, 0, 3) ``` ![](https://files.readme.io/c3c40cd538aa9e5f3c9252404230d10e4654712e76b0046571f1b7e695166d2a-CleanShot_2025-10-22_at_15.18.02.png) ### Default The **Default** branch defines the process blocks to execute if none of the case conditions evaluate to `true`. This ensures the process always has a fallback path. #### Example: Default Branch ``` # If no conditions match, display a message Content Activity: "Sorry, your request cannot be processed. Please contact support." ``` # Exit Block The **Exit Block** terminates the entire plugin execution immediately. It is used to stop the workflow when a specific condition is met, preventing further processing. **Use Case**: Use an Exit Block in a decision policy branch to halt the plugin, such as when an invalid input is detected or a process cannot proceed. ![](https://files.readme.io/74baffb3ca2e4b5293041233c7a5120d0e4682a3c8a1c21e4c323e2d301f38c7-CleanShot_2025-10-22_at_15.00.402x.png) ``` # Decision Policy Case: data.priority == "High" -> Run Action Activity Case: data.priority == "Invalid" -> Exit Block (terminate plugin) Default: Content Activity: "Please specify a valid priority." ``` # Continue Block The **Continue Block** allows the plugin to proceed to the next process block in the conversation process, continuing execution without interruption. It is useful in decision policy branches where you want the plugin to move forward with subsequent actions rather than stopping. **Use Case**: Use a Continue Block in a decision policy branch to ensure the plugin continues processing after handling a specific condition, such as logging an event before proceeding. ![](https://files.readme.io/9699e9e8c6285547fed4d560d724de6d180d6e9ca38cc6e615e6594100fe83d3-CleanShot_2025-10-22_at_15.00.402x.png) ``` # Decision Policy Case: data.user_role.value == "admin" -> Run Action Activity -> Continue Block (proceed to next steps) Case: data.user_role.value == "guest" -> Content Activity: "Access denied." -> Exit Block Default: Content Activity: "Invalid role. Please try again." -> Continue Block ```