Create a workflow
Caution: This feature is in technical preview. It currently supports only qTest Requirements in this technical preview. There are no controls in qTest Requirement module so workflow editable settings are ignored and routing and approved Requirements can be modified in qTest.
Workflows let you define and manage the lifecycle of a record using configurable state transitions. This tutorial guides you through creating a comprehensive workflow that includes states like Draft, Routing for Approval, Approved, Rejected, and Obsolete with their associated transitions.
Creating a custom workflow helps you standardize your approval processes and ensures records follow the correct approval path based on your organization's requirements.
Before you start
To create and use workflows in Vera, you need to:
-
Enable the feature by setting the environment variable
VERA_WEB_PORTAL_ENABLE_WORKFLOWStotruein the Web Portal container, or set theenableWorkflowsparameter totruein theconfig.yamlfile. -
Configure and run the Workflows API container and Worker service.
-
Have administrator access to the Vera web portal.
-
Have external routing rules that forward traffic on
/api/workflows/*to the Workflows API container.
For detailed information about workflows, check out Manage workflows.
Create the workflow
To create a workflow, follow these steps:
-
Sign in to the Vera web portal as an administrator.
-
From the left pane, select Workflows.
-
Select + Create workflow and complete the form:
-
Name: qTest Requirement Approval Workflow
-
Description: Workflow tutorial
-
Owner: your user account
-
-
Select Save.
Add workflow states
Add the required states for your workflow:
-
Navigate to the Workflow States tab.
-
Select Add State and create the Draft state:
-
Name: Draft
-
Editable: ON (Checked)
-
Type: GENERIC
-
-
Select Save workflow.
-
Select Add State and create the Routing for Approval state:
-
Name: Routing for Approval
-
Editable: OFF (Unchecked)
-
Type: ROUTE
-
-
Select Save workflow.
-
Select Add State and create the Approved state:
-
Name: Approved
-
Editable: OFF (Unchecked)
-
Type: COMPLETE
-
-
Select Save workflow.
-
Select Add State and create the Rejected state:
-
Name: Rejected
-
Editable: ON (Checked)
-
Type: GENERIC
-
-
Select Save workflow.
-
Select Add State and create the Obsolete state:
-
Name: Obsolete
-
Editable: OFF (Unchecked)
-
Type: COMPLETE
-
-
Select Save workflow.
Note: Transitioning from a COMPLETE state to a GENERIC state will increment the record revision number, such as Approved to Draft. While, transitioning from a COMPLETE state to another COMPLETE state will not impact the revision number, such as Approved to Obsolete.
Add workflow route
Create the approval route that defines how records transition through the workflow:
-
Navigate to the Workflow Routes tab.
-
Select Add Route and complete the form:
-
Name: Standard Approval Route
-
Meaning: Approval
-
-
Expand the Route Complete section and set:
-
State: Approved
-
-
Expand the Route Rejected section and set:
-
State: Rejected
-
-
Select Save workflow.
Add workflow triggers and actions
Configure the triggers and actions that define state transitions:
-
Navigate to the Workflow States tab.
-
Navigate to the Draft state section.
-
Select Add Trigger and set:
-
Name: Route for Approval
-
-
Select Add Action and set:
-
Type: Transition
-
Transition State: Routing for Approval
-
-
Select Save Workflow.
-
Navigate to the Routing for Approval state section and set:
-
Route Type: Standard Approval Route
-
-
Select Add Trigger and set:
-
Name: Withdraw
-
-
Select Add Action and set:
-
Type: Transition
-
Transition State: Draft
-
-
Select Save Workflow.
-
Navigate to the Approved state section.
-
Select Add Trigger and set:
-
Name: Revise
-
-
Select Add Action and set:
-
Type: Transition
-
Transition State: Draft
-
-
Select Save Workflow.
-
Select Add Trigger and set:
-
Name: Mark as Obsolete
-
-
Select Add Action and set:
-
Type: Transition
-
Transition State: Obsolete
-
-
Select Save Workflow.
-
Navigate to the Rejected state section.
-
Select Add Trigger and set:
-
Name: Rework
-
-
Select Add Action and set:
-
Type: Transition
-
Transition State: Draft
-
-
Select Save Workflow.
-
Select Add Trigger and set:
-
Name: Route for Approval
-
-
Select Add Action and set:
-
Type: Transition
-
Transition State: Routing for Approval
-
-
Select Save Workflow.
-
Navigate to the Obsolete state section.
-
Select Add Trigger and set:
-
Name: Reinstate
-
-
Select Add Action and set:
-
Type: Transition
-
Transition State: Approved
-
-
Select Save Workflow.
Set the default state
Configure the initial state for new records:
-
Navigate to the Workflow Details tab.
-
Set the Default State to Draft.
-
Select Save Workflow.
-
Select Activate to enable the workflow.
Apply the workflow to record types
To make records follow your custom workflow, you need to apply it to a Record Type or Records Management Policy (RMP):
-
From the left pane, select Workflows.
-
Select your qTest Requirement Approval Workflow.
-
Copy the ID from the URL (for example: a34ce640-8440-42aa-9f2f-e7a5ce97abce).
-
From the left pane, select Policies.
-
Select the Records Management Policy linked to your qTest Project Domain.
-
Download the latest revision of the policy.
-
Open the policy file in a JSON editor.
-
Navigate to the qTest Requirement Record Type section.
-
Add the workflow ID and name to the Workflow element:
-
"ID": "a34ce640-8440-42aa-9f2f-e7a5ce97abce", -
"Name": "qTest Requirement Approval Workflow"
-
-
Save your changes.
-
Upload the updated JSON file to create a new revision of the Records Management Policy.
Add the qTest Requirement type to an approval route:
-
Select the Approval Policy linked to your qTest Project Domain.
-
Download the latest revision of the policy.
-
Open the policy file in a JSON editor.
-
Navigate to an existing approval route or create a new one for qTest Requirements.
-
Add "qTest Requirement" to the
"Record Types"array in the approval route. -
Configure the approval levels and approvers according to your organization's requirements.
-
Save your changes and upload the updated JSON file to create a new revision of the Approval Policy.
Records created with this configuration will now follow the state transitions defined in your custom workflow.