Change Approval Policy workflow activity

  • Release version: Xanadu
  • Updated August 1, 2024
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Change Approval Policy workflow activity

    The Change Approval Policy workflow activity enables you to manage the approval process for change requests by creating user and group approvals based on a specified change approval policy record. It supports multiple instances within a workflow, each potentially referencing different policies, and evaluates approval requirements using inputs defined in the Policy Input script field. This activity is specifically designed to run on tables that extend or are thechangerequesttable.

    Show full answer Show less

    Key Features

    • Policy-driven approvals: Automates approval steps according to defined Change Approval Policy records and their matching decisions.
    • Multiple activity instances: Allows the use of multiple Change Approval Policy activities within a workflow for complex approval scenarios.
    • Input variables: Configure the policy to apply, add additional inputs, and define finish conditions to control activity completion behavior.
    • Result values: Outputs a clear result status including Approved, Rejected, Canceled, Skipped, or Finished to guide workflow transitions.
    • Condition handling: Defines transitions based on approval outcomes, including Approved, Rejected, Error, and Skipped conditions, ensuring accurate workflow routing.
    • State management: Tracks execution states such as Executing, Waiting, Finished, Cancelled, and Error to control workflow progression and error handling.
    • Restart capability: Supports workflow scenarios like putting a Change Request on hold and restarting the approval process when resumed by using finish conditions and activity restarts.

    Practical Application Example

    In workflows like the Change Request - Normal workflow, this activity can be used to check if the assigned group’s manager has approved the request by referencing a “managerapproved” policy input. It allows dynamic evaluation of approval statuses and adjusts the workflow accordingly.

    The Finish condition can be set to mark pending approvals as “No Longer Required” when the Change Request is placed on hold, effectively pausing the approval process. When the request resumes, the activity restarts, ensuring continuous and accurate approval tracking.

    What to Expect

    By implementing the Change Approval Policy workflow activity, ServiceNow customers gain fine-grained control over change request approvals, aligned with organizational policies. This ensures automated, consistent approval processes that adapt dynamically to workflow states such as on-hold or resumed changes, reducing manual intervention and improving change governance.

    Use the Change Approval Policy workflow activity to control the approval process for a change request by creating user and group approvals according to a change approval policy record. Multiple activities can be used in a workflow, where each activity can reference the same or different Change Approval Policies.

    Using the current change request and additional inputs defined in the Policy Input script field in the activity, you can evaluate the Change Approval Policy record, which applies the approval definitions from matching decisions.
    Note:
    This activity is only available when the workflow runs on a table that extends or is the [change_request] table.

    Results

    The activity assigns a result value according to the outcome of the applied policy. The possible result values are:
    • Approved
    • Rejected
    • Canceled
    • Skipped
    • Finished

    Input variables

    Input variables determine the initial behavior of the activity.
    Table 1. Change Approval Policy activity input variables
    Field Description
    Approval Policy The Change Approval Policy that you want to apply to the change request.
    Policy Input Policy Inputs that are defined on the Change Approval Policy record. Set additional policy inputs here.
    Finish condition Determine if the activity should complete while pending approvals remain. Use this condition if the workflow is configured to handle restarting the Change Approval Policy activity. For example, when the Change Request goes on-hold.

    Condition

    The following conditions determine which transition runs after this activity.
    Table 2. Change Approval Policy activity conditions
    Condition Description
    Approved Change request is approved when the criteria defined by applied Approval Definitions is met.
    Rejected Any rejection from applied Approval Definitions will result in the Rejected outcome.
    Error The event or condition that generates an error.
    Skipped If this condition is not configured on the activity, then the Approved condition is used. This outcome occurs for the following scenarios:
    • No decisions from the Change Approval Policy match
    • No approvals can be generated from matched decisions

    States

    The workflow engine uses the activity state to perform the next logical action on the activity.
    Table 3. Change Approval Policy activity states
    State Description
    Executing The workflow engine starts the execute function of the activity.
    Waiting The workflow engine ignores the activity until a specific event to restart the activity is fired.
    Finished The activity finished running. See the result value for the outcome of the activity.
    Cancelled This activity, or the workflow that contains this activity, was canceled.
    Error A JavaScript error occurred. Review the logs for error details.

    Example

    In this example, let us reference the Risk approvals activity in the Change Request - Normal workflow. In the workflow, the change approval policy factors if the assigned group's manager has already approved the Change Request.

    Example for Change Approval Policy Risk approvals

    You can use this activity to access the risk of the change request of a normal change policy. When this activity runs, the associated decisions executes the approvals that needs to be requested.

    Example policy input script for risk assessment
    Use the Policy Input field to set up additional inputs. In the given example, the activity defines the manager_approved property and performs the query to check if an approved record exists for the approved group's manager.
    Note:
    Ensure that the manager_approved policy input is defined in the Change Approval Policy record.

    The Finish condition field is used to complete the activity by marking pending approvals as No Longer Required. In this workflow example, when the Change Request is put on-hold, the Change Approval Policy activity is completed and the workflow disregards the pending approvals before waiting for the Change Request to resume. When the on-hold state is released, the Change Approval Policy activity is restarted.