Overview
Enhance your case management process by customizing state transitions with Torq workflows. This guide explains how to assign workflows that automatically verify and execute state transitions, ensuring all procedural requirements are met before the case state is updated. This feature is particularly useful for maintaining compliance with organizational protocols during case investigations.
How to use
Create and publish two workflows. The first workflow requests information from the analyst in order to manually close a case. The second workflow assigns the first workflow to all cases upon case creation.
A workflow triggered by a manual state change, and only performs the change if the requirements are met.
A workflow that assigns the first workflow to a case and a specific state transition (this can be done in a workflow triggered by the case creation).
Workflow 1: Define the behavior upon manual state changes
Implement logic to check whether the state transition can be performed.
Set the workflow trigger:
Use the On-demand trigger, or
Use the Torq Interact trigger to collect user input or display messages.
Implement logic: Determine the conditions under which the state transition can occur. Examples include:
Allow a state transition only if the case was in a specific state (e.g., allow closure only if the case was "In Progress").
Authorize the state transition exclusively for specific users.
Collect user input to decide on the state transition.
Perform the state transition: Once the requirements are met, use the Change case state step to execute the transition.
Notify analysts: We recommend using Torq Interact to inform users of the outcome and to provide reasons if the state change was unsuccessful.
Publish the workflow: Finalize and publish the workflow before moving on to the next step.
Workflow 2: Assign workflow to relevant cases
The workflow created in the previous section must be assigned to a case and mapped to a particular state transition. Use Workflow 2 to assign Workflow 1 to relevant cases.
Use case: Analyst justification for case closure
In the example use case below, when an analyst attempts to close a case, they are prompted to provide information about the investigation.
Use the two workflows together to present questions, evaluate responses, and determine whether to update the case state to Closed.
A template for this use case is available in our Templates library.
Workflow 1: Collecting user input for state change decisions
Start a workflow: Use the Torq Interact trigger to initiate the workflow. Add interaction elements to collect user input and make it available in the trigger event context.
Implement the logic: Based on the input collected, decide whether to proceed with the requested state change. Use the Change case state step to determine the state to which the case will transition. When changing the case state to Resolved or Closed, a resolution reason must be provided. The example below demonstrates how to use the user input provided earlier as the reason for the resolution.
Notify the user: Use Torq Interact to notify the user about the state change outcome and provide reasons if the change didnât occur.
Publish: Publish the workflow.
Workflow 2: Assign a workflow to a case state transition
Build a workflow with a New case created trigger to apply the Assign workflow to state change step to all new cases in the workspace.
Set logic for customizing the state transition: Define how the workflow will be assigned to specific cases. For instance, you can assign the workflow for all new cases.
Assign the workflow: Use the Assign workflow to state change step. Specify the case ID, the target state for the transition, and the name of the workflow (which is automatically translated to the workflow ID).
Other available steps are: Get assigned workflow for state change and Unassign workflow from state change.Publish the workflow: Publish the workflow to ensure it is active and functioning.
Make sure the state specified in the Assign workflow to state change step matches the state in the Change case state step in the first workflow.




