Validate a workflow

You can manually validate a workflow from the Workflow Editor. You can generate a
workflow validation report from the Workflow Version form.

Before you begin

Role required: workflow_admin, workflow_creator, or
admin

About this task

Running a workflow on a new node automatically attempts to validate the workflow. If
validation is successful, the system updates the workflow version record to indicate
the workflow has been validated and marks the record as updated by the user who ran
the workflow.

Procedure

Open the workflow to validate in the Workflow Editor.

When the workflow is loaded, the workflow validator icon appears in the
toolbar.

Click the validator icon to run a series of validation tests on the current
workflow version and generate a report.

Complete the following steps to generate a workflow validation report from the
Workflow Version form

Publish a workflow

When a workflow is complete, publish the workflow so that it is available to all
users.

Before you begin

Before you publish a workflow, validate it to test it for issues that might cause it
to fail, such as missing subflows or disconnected transitions. For more information,
see Workflow validation.

About this task

To publish a workflow:

Procedure

Navigate to Workflow > Workflow Editor.

Open the workflow that you want to publish.

In the title bar, click the menu icon and select
Publish.

Result

If you published a new version of workflow, the changes are not applied to running
workflow contexts. Any currently running workflow context continues
using the workflow version that was available when the workflow started. The next
time the workflow runs, it uses the new version.

Determine whether a workflow can run

A workflow can run only if a checked out version is available to the user who has it
checked out, and a valid, published version is available for all users with permission to
run it.

Before you begin

Role required: workflow_admin, workflow_creator, or
admin

Procedure

In the navigation filter, enter wf_workflow.list, and
then open one of the workflows.

In the Versions related list, check for all of the
following conditions:

There is only one workflow version in a state of Checked
out and Checked out by.

There is only one version and it is not checked out. This version must
be both Active and
Published.

You may need to personalize the list and add the
Active column.

If there are multiple versions, only one is
Published.

These checks determine the only two conditions under which a workflow can
run:

A checked out version of a workflow is available for the user who has it
checked out.

A valid, published version of a workflow is available for all users who
have permission to run the workflow.

Main flows containing subflows that do not meet one of these two
conditions are not permitted to execute against a current record
transaction. Instead, a critical log entry detailing the subflow state is
added to the Workflow Context record. To enable the workflow to execute on
the next appropriate transaction, remove the subflow from the main flow or
modify the published and active states of the subflow.

Edit a published workflow

You can edit a published workflow after you check it out.

About this task

Note: You cannot check out or delete workflows that are associated with a read-only
application file.

If you are in a different domain than the published workflow, the new
workflow version is created in your domain.

What to do next

After you finish editing the workflow, validate and publish the workflow to make
the new version available to other users.

Copy a workflow between two application scopes

Application scoping protects applications by identifying and restricting access to
application files and data. You can copy a workflow created in one application scope (for
example, Test) to another (Production) as needed.

Before you begin

Role required: admin

Procedure

On the Home page, click (System Settings), located next to the logged in use
name.

In the Developer tab, in the
Application field, select the application scope (for
example, Test) in which you want to operate the ServiceNow
platform.

In the Application tab,
Application is set to the current application scope
selected in System Settings.

In Accessible from, select All application
scopes if the workflow is available to all application scopes,
or select This application scope only if it is only
available to, and accessible in the current application scope only.

Only those workflows that are accessible from all application scopes can be
copied to another application scope.

Go back to the Homepage, click .

In the Developer tab, in the
Application field, select the application scope (for
example, Production) to which you want to copy the workflow.

Navigate to Workflow > Workflow Editor.

Refresh the page, then open the same workflow you created.

An Out of scope workflow, workflow belongs to <scope name>
scope message appears, where <scope name> is the application
scope in which the workflow was originally created.

In the Workflow Editor, click .

Select Copy.

The Workflow Name dialog appears:

In Workflow Name, type the new name for the
copied workflow.

Click OK. The system creates a workflow in the
current application scope.

In the Workflow Editor, click .

In the Application tab,
Application is set to the current application scope.

In Accessible from, select This application
scope only if to make the newly copied workflow a private one
that cannot be accessed from outside current scope.

Click Update.

Result

A new workflow record is created in the selected application
scope and marked as private if designated as one in the Workflow Editor.