Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.
Versions
  • London
  • Kingston
  • Jakarta
  • Istanbul
  • Helsinki
  • Geneva
  • Store
Close

Using workflow approval activities and rolling back workflows

Using workflow approval activities and rolling back workflows

When you work with approvals, you need to understand how approval activities interact with approval engines, how to correct a skipped approval workflow activity, and how rollbacks work.

Approval workflow activities and approval engines

Approvals can be managed by approval activities or approval engines, but not both. Approval activities can be used if approval engines are not turned on for the table associated with the workflow.

Approvals can be managed by approval activities or approval engines, but not both. Trying to use both can cause a range of issues. Approval activites are not available (greyed out) in the palette if approval engines are used on the specified table. If you hover over a greyed out approval activity in the palette, a comment with more information is provided. For more information about approvals and approval engines, see Approvals.
Figure 1. Unavailable approval activities
Approval activities are greyed out in the palette if approval engines are used on the associated table
To turn approval engines off for the table, navigate to the System Properties > Approval Engines and change the setting for the table to Turn engines off.
Figure 2. Turn off approval engines
To use approval activities, turn off approval engines for the table

Correct a skipped workflow approval activity

While a workflow is in an active context, an approval activity can skip to the next activity.

About this task

An approval activity might skip for the following reasons:
  • The approval user or group is missing or invalid (for example, sys_id).
  • The approval user or group became inactive after the approval record was created.
  • The activity is a dot-walked field, such as current.opened_by.department.manager, and it has a missing or invalid approval user or group.
  • The business rule on the table that is associated with the workflow is invalid.

To correct a missed approval activity:

Procedure

  1. Navigate to Workflow > Live Workflows > All Contexts.
  2. Click the date and time in the Started column for the workflow that is incorrectly processing approval activities.
  3. In Related Links, click Show Workflow.
  4. Review the portion of the workflow that executed, and then do one or more of the following:
    • Verify that after approval, the workflow progressed to the next activity. If a workflow failed to progress, check the business rules. For more information, see Debugging business rules.
    • Point to each processed approval activity to find activities where the State is Finished and Result is Skipped.
  5. Navigate to Workflow > Workflow Editor and open the workflow.
  6. Double-click the skipped approval activity.
  7. Click Users or Groups.
  8. Assign an active user or group for the approval activity. For more information, see Workflow error handling.

Rollback To activity

When conditions in a workflow trigger a Rollback To activity, the workflow moves processing backward to a specified activity in the workflow and resets certain activities that have already executed back to their original state. This is useful when handling an unexpected failure or as part of a programmed logical flow.

When an activity is reset during a workflow rollback, the following happens:

  • Approvals are reset to Not Requested.
  • Tasks are reset to either Open or Pending. A rollback workflow path cannot create new tasks.

Activities that perform external system operations, such as deleting a file or sending an email, are not rolled back. Only approval and task activity states are reset.

A workflow can contain a single rollback, multiple rollbacks, or nested rollbacks in more complex workflows. The Rollback To activity resets activities based on the actual workflow sequence (transition line attachments) of activities between itself and the transitioned to activity, rather than using the execution order to determine where processing should restart.

Rollback To behavior

The Rollback To activity transitions directly to the activity specified by the transition line arrow.

Use the Rollback To activity for all workflows that use multiple or nested rollbacks. Rollback To resets the targeted task (the direct transition) to Open. All tasks that have executed between the Rollback To activity and the targeted task (rolled back task) are set to Pending.

(0) Begin

(1) Log Message

(2) Task 1

(3) Task 3

(4) Task 2

(5) Timer

(6) Approval 1

(7) Roll back to first task

(8) Task 1

(9) Task 2

(10) Approval 1

(11) Log approval

(12) Join

(14) Send email

(15) End

Figure 3. Rollback to workflow

Transition history

The state of (3) Task 3 does not change, since this activity does not directly transition from the rollback target activity. To see what activities were rolled back, select the Workflow Transition History related list and look at the Rolled back column.

The Rollback To activity (7) updates the following activities:

(8) Task 1: reset to Open

(9) Task 2: reset to Pending

(10) Approval 1: reset to Not Yet Requested

Figure 4. Rollback To workflow transition