- Introduce the Workflow Editor and the Workflow Engine
- Define the role of Workflow in the Platform
- Take a tour of the individual pieces of Workflow
About ServiceNow workflow
ServiceNow Workflow has two main components:
- The Workflow Editor is the part of the ServiceNow UI that process owners and designers use to design workflows that automate business processes. The Workflow Editor always opens in an adjacent browser tab. The main work area is referred to as the canvas.
- The Workflow Engine is part of the Glide Script Engine and is invoked with the insert, update, delete or cancel of a Glide record. Because of this, each workflow can be configured to run based on conditions. This is similar to how Business Rules determine when to run.
Log on to your training instance
- Log on with K14.WFAdmin/k14101 credentials.
The Workflow Admin role is required to design and publish in the Workflow Editor.
- In the Application Navigator Type filter text field, enter workflow to go to the Workflow Application.
The Workflow application is divided into these functions:
Accessing the Workflow Editor for creating and editing workflows.
Monitoring, running, and reviewing workflows.
Administering the Workflow Engine.
- Select the Workflow Editor.
In the rest of this article, these navigation steps will be abbreviated to Workflow > Workflow Editor.
Your browser loads the Workflow Editor in an adjacent browser. We also refer to the Workflow Editor as the canvas. Your screen should look like this:
- Select the blue question mark icon.
An adjacent tab opens to display the ServiceNow product documentation. Now there are 3 tabs open.
The ServiceNow product documentation is a rich source of educational articles relevant to creating, editing, and invoking workflows. Wherever you see the blue question mark in the Workflow Editor, you will be taken to the page most relevant to the form you clicked from.
Close the product documentation tab and return to the workflow canvas.
- Select the Gear Menu icon. This is sometimes referred to as the Workflow Actions menu.
On a blank canvas, the Gear Menu allows you to create or open a Workflow. Once there is a workflow loaded on the canvas, the Gear Menu provides many more editing features.
- Select New Workflow. The Workflow Properties form is used to set these values.
(1) Name to identify a workflow.
(2) Table association for the workflow.
(3) Order to determine processing order when there are multiple workflows for a table.
(4) The conditions under which the workflow will be invoked.
NOTE: The Name and Table fields are required fields.
The conditions are optional. If no conditions are specified, the workflow will run on every Glide insert into the table specified on the Workflow Properties.
NOTE: In subsequent labs we will discuss workflow conditions in detail.
- In the Name field type K14 First Workflow.
- For the Table setting, select Global [global]. All tables are listed using the format Friendly name [system name].
NOTE: Global is a generic setting and will not run on the insert or update of a Glide record.
- Click the Submit button.
Your first workflow
- There are two Activities in the workflow.
An Activity is a set of instructions that can include script, logging, approvals, record processing, timers, and wait time
- Activities can process inputs from other Activities
- Activities can provide output for other Activities to process
- Processing continues as the Activity determines which execution path to follow upon completing its work
- Every workflow has a Begin Activity and an End Activity. Know that these cannot be deleted and that processing cannot be started or ended when these Activities execute.
- The lines between the Begin and End determine the processing paths. If an Activity is not connected on a path, it will never execute.
- On the right side of the Workflow Editor a folder structure called the Activity Tree displays. This structure is also called the Application Menu. The Activity Tree is built based on the table setting. For the Global [global] table, the Activity Tree shows the base instance set of folders and Activities.
- Reselect the Gear Menu icon.
Notice how many more options are available in the gear menu, now that the workflow canvas is loaded. We will be referring to the gear menu throughout this lab.
- Click outside of the menu list to dismiss the list.
- In the upper right hand corner of the canvas tool bar select the right arrow icon. This control hides the Activity Tree so you have more canvas space.
When building large workflows, this is a way to get more viewable workspace.
- In the upper right hand corner of the canvas tool bar select the left arrow icon to display the Activity Tree again.
Work with the Activities Tree
- In the Activities Tree in the right pane of the canvas, expand the Utilities folder.
The Activities Tree lengthens and the Utilities folder expands to look like this:
Each folder in the Activities Tree is called a Category.
Each item in a folder is called an Activity.
Categories and the Activities within Categories are defined by Activity Definitions. The Activity Definition is the Configuration of Script and Variables that are needed to perform an atomic piece of work.Activity Definitions in the base instance perform work for ITIL processes. These Activity Definitions allow for seamless integration of a process specified within a workflow with the core applications such as Incident, Change Request and Service Catalog.
- Collapse the Utilities folder.
About connections, transitions, and lines
The purpose of a line in a workflow is to connect Activities to form processing paths. Lines are the transition to the next Activity. There is only one type of line in the Workflow Editor and when it is selected it turns blue in color. As you work designing a workflow you can move the Activities around to make room by placing the cursor on an Activity title and dragging it to another location on the canvas. The lines will automatically adjust so the Activities always stay connected.
There can be more than one line leaving and entering an Activity. A line starts from one of the conditions that are set for an Activity. Examples of Activity conditions are Always, Error, and Skipped.
QUESTION: How do I connect Activities?
There are 3 methods:
- You can select the Activity node, hold the right mouse button and draw a line to the next Activity.
- When you drag an Activity onto the Workflow Canvas hover over the line between Activities until it turns blue. The nodes will automatically connect.
- Right-click on the Activity condition that you want to connect. Select Link to… and a list of all the workflow Activities displays. Select the Activity you want to connect.
NOTE: Many workflows fail because Activities have not been connected. One way to verify that all Activities are connected is to use the Validate feature to check for unconnected Activities.
QUESTION: My workflow is growing. Is there an easy way to redraw the lines?
Yes. Use the Expand Activities menu item in the Gear menu to spread the lines.
QUESTION: How do I delete a line?
Hover over the line until it is selected (changes to blue). Click the delete button.
QUESTION: How do I copy an Activity?
Hover on the Activity title and right-click to select Copy Activity. Note that the copy Activity is sometimes put directly on top of the original Activity.
QUESTION: How do I delete an Activity?
Use the X in the upper-right corona of the Activity.
QUESTION: Can I make a custom Activity?
Yes! An Insert and stay operation can copy an existing Activity that is close to what you need and then you can customize it. Remember to make sure the Category places the Activity in the correct folder.
A Workflow is defined as a series of Activities that follow execution paths.
The Workflow Editor presents an unstructured area (usually referred to as the workflow canvas) that is used to create and edit workflows.Workflows are composed of Activities that are connected by lines. Each Activity represents a unit of work that is defined in an Activity Definition. Each line connects Activities to form processing paths. A line is also called a transition.