Manual Approvals workflow activity

  • Release version: Washingtondc
  • Updated February 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 Manual Approvals Workflow Activity

    The Manual Approvals workflow activity is designed to monitor and manage user-initiated approvals outside the standard workflow process. It specifically targets approvals in the "Not requested" state and is applicable only for workflows operating on tables that extend the Task table. If no manual approvals are pending when this activity is executed, it concludes immediately with an "approved" result.

    Show full answer Show less

    Key Features

    • Approval Management: The activity pauses the workflow until the manual approval is resolved.
    • Result Values: The outcome of the activity can be set using activity.result, with possible results including Approved, Rejected, Deleted, Cancelled, or Error.
    • Input Variables: Users can configure how the activity responds to approvals or rejections, including waiting for any or all approvals before proceeding.
    • Conditions: The outcome of the activity can be based on defined conditions that dictate the workflow's next steps.
    • Activity States: The activity can be in various states such as Executing, Waiting, Finished, Cancelled, or Error, which inform the workflow engine about its status.

    Key Outcomes

    By utilizing the Manual Approvals activity, ServiceNow customers can effectively manage approval processes, ensuring that workflows pause appropriately for manual input and resume based on user decisions. This activity enhances workflow flexibility and control, crucial for enterprise operations. Customers can expect a streamlined process for handling approvals that integrates seamlessly into their existing workflow systems.

    The Manual Approvals activity watches and manages any approvals that users add manually outside of the workflow process. This activity only selects approvals that are in the Not requested state.

    Note:
    This activity is only available when the workflow runs on a table that extends Task.

    If there are no pending manual approvals when this activity executes, the activity immediately completes with a result of approved. This activity does not create approval records. Use this activity to pause the workflow when a user adds a manual approval to a record with an associated workflow, and it is in the Not requested state. The workflow waits for the approval to be closed before proceeding.

    Results

    The workflow designer can assign a result value using activity.result from within a script field of the activity. By default, the result value of the activity is the final approval disposition determined by the approval actions take by the approvers. Possible result values are:
    • Approved
    • Rejected
    • Deleted
    • Cancelled
    • Error

    Input variables

    Input variables determine the initial behavior of the activity.

    Table 1. Manual Approvals activity input variables
    Field Description
    Wait for
    Indicate what to wait for to indicate that the approval activity is approved or rejected. Options are:
    • Any manual user or group approval: Any user can approve and the first approval causes the activity to complete with a result of approved.
    • All manual user or group approvals: All users must approve (see below for how a rejection is handled).
    • The first response from any manual approval: The first approval or rejection from any user causes the activity to complete.
    When anyone rejects
    Indicate what happens when any user rejects their approval request. Options are:
    • Reject the approval: Immediately complete the activity with a result of rejected.
    • Wait for other responses before deciding: Wait until we get other responses before making an approval or rejection decision. This allows users to change their mind until a decision is made.

    In addition, if Wait for is set to Anyone to approve then a single approval will cause the activity to complete with a result of approved even if one or more users reject.

    Conditions

    The conditions determine which transition runs after this activity.
    Note:
    Approval activities run as the user whose actions match the approve or reject conditions the workflow was waiting for and advances the workflow.
    Table 2. Manual Approvals activity conditions
    Condition Description
    Approved The users from the groups have approved the request based on the Wait for rules.
    Rejected The users from the groups have rejected the request based on the Wait for rules.

    States

    The activity state tells the workflow engine what to do with the activity.
    Table 3. Manual Approvals 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.