Skip to content

Approval workflows

By default, Requests can be approved by any user which has the accept_request permission.

Approval workflows are a way to split the request accepting process in multiple step that can be reviewed by any user with a custom permission.

Approval workflow can be scoped to some organization or team so a same operation can be requested differently following who is asking it.

Each step may have a part of the required operation's survey.

approval

Workflows

An Approval Workflow is composed by one or multiple Approval Step. Approval Steps of the Workflow must be approved one by one following the order. After accepting the last one, the request switch to ACCEPTED state and can be processed.

Note

The auto-accept option can not be set in the Operation with an Approval Workflow. This need to be configured into the step auto accept condition

Configuration:

Name Description
Name Unique identifier of the Approval Workflow
Operation Service operation that will use the workflow
Restricted scopes List of organization or team which are going to be concerned by the workflow

Steps

Steps are the breakpoint of a Squest request. Each step need to be accepted in order to validate the request.

Configuration:

Name Description
Name Unique identifier of the Step
Permission Permission required to be allowed to accept or reject the request. By default set to approve_reject_approvalstep
Readable field Field from the survey that will be shown in the form but cannot be updated in the step
Editable field Field from the survey that can be filled or updated from a previous step
Auto accept condition An Ansible "when" like that enable auto accept on a Step (see below)

Warning

If the job template behind the operation has some mandatory fields in its survey then those fields need to be configured in at least in one step.

By default, Squest comes with a single permission named approve_reject_approvalstep that can be used in steps.

Custom permissions can be created and added to a role to avoid using the default one.

flowchart LR role --> permission step --> permission user/team/organization --> role

Auto accept

A step can be auto accepted on a condition placed in the "Auto accept condition" of the step configuration.

The condition is a Jinja string which is evaluated like an Ansible when condition. The available context is the request.

For example, to validate the step following the name of the instance:

request.instance.name == 'this_is_a_very_good_name'

Or testing a survey field

request.fill_in_survey['vCPU'] < 8

Full request object definition can be retrieved through the API documentation.

More example of jinja templating are available in the dedicated documentation section.

Warning

The auto accept process will not complete or update the survey. If a mandatory field is missing at the end of the approval, the executed job template may fail due to missing variable.