Using Variables in Workflow Approvals
You can add predefined or user-defined variables in a Workflow Approval step. When the Workflow is deployed, these variables become available as inputs for logging and auditing and can be overwritten by approvers.
The available approval mechanisms are:
Before You Begin
Step 1: Add an Approval Step in a Workflow
- In your Workflow, click Add Step.
- Select Approval. You can search or click Flow Control and select Approval.
- Click Next.
The Add Step settings appear.
- In Configure Approval, enter Name.
- Select Harness UI in the Ticketing System.
- Select one or more User Group(s) to notify for the approval requests.
- Enter the time duration that Harness should wait for the approval or rejection before killing the deployment process. You can use
sfor seconds and
msfor milliseconds. For example, 1d for one day.
- Click Advanced Settings to set the additional settings.
- Click Add Variable to define variables. To define a new variable, enter a Name and a Default Value. You can use this variable combined with its parent variable name to reference the variable elsewhere.
- In Publish Variable Name, enter a parent name for the collection of subordinate variables that you can reference with its child variables (as you defined in the previous step). This parent name helps to avoid conflicts when there are subordinate variables of the same name within the same scope.
- Set the Scope for the variables that you defined in the previous step. You can choose, Phase, Workflow, or Pipeline.
- Click Submit to save this Approval step, along with its variables.
Step 2: Approve Workflows
Workflow uses the Approval variables as defined in the Add an Approval Step in a Workflow option, when it deploys. Deployment pauses at the Approval step.
- Click Approval step.
A user (in one of the User Groups configured as approvers) can click the Approval step. The Needs Approval settings appear.
- Enter your comments, and click Approve.
Once this step is approved, the Workflow can continue deployment.