
Demo
The simplest possible workflow in ServiceNow, is a straight line from Begin to End:
However, this workflow doesn't to very much for us. Instead, let's create a new Workflow for our virtual war rooms, to drive the generation of some war room tasks. To get started, open the Workflow Editor from Workflow | Workflow Editor in the Application Navigator.
The Workflow Editor should open in a new tab or window. When it does, click on the Plus icon at the top-right, under the Workflows tab, so we can create a new workflow for our Virtual War Room tickets:
On the New Workflow form, set the name to War Room, the Table to Virtual WarRoom [u_virtual_war_room], and fill out a description of your choice:
Leave the Conditions section blank, and click Submit. You'll be presented with the simplest possible workflow to start with, and it'll automatically be checked out by you. Workflows exists in the Workflow Versions [wf_workflow_version] table. When checked out, the Published [published] field in this table is set to false. The same is true for older versions of the workflow. Each time you check a workflow out and then check it back in (also known as publishing it), a new record in the Workflow Versions table is created:
If you publish a new version of the workflow while an existing published version exists, then the existing record has its Published field set to false, and the newly published record has its Published field set to true. Since we've only just created this workflow, there will only be one workflow version called War Room, and since we have not yet published it, the Published [published] field will be set to false:
In our imaginary company, Major Incidents are incidents with a high impact and priority. These incidents result in a Virtual War Room being created to validate the issue being raised, coordinate troubleshooting and resolution, and get the incident resolved as soon as possible. Once resolved, the major incident process will hand-off to the Problem Management process which, per ITIL methodologies, will be tasked with identifying a root cause for the major incident, and preventing future occurrences by creating new knowledge articles, performing a change request, or otherwise taking steps to prevent this major issue in the future.
Since we're building virtual war rooms to be a response to major incidents, let's make it so virtual war room tickets follow this process in our workflow:
- A validation task is created first, in which the service desk agent must ensure that the incident is indeed a major incident, and was not miscategorized. The workflow stage will be Validation for this task.
- After the validation task, a diagnostic war room task is created, and assigned to the Major Incident Response Team group, and the workflow stage is set to Diagnose.
- You can create this group from the Groups [sys_user_group] table by just specifying the name and leaving all other fields blank.
- Once the diagnostic task is completed, a Perform Fix task will be generated. During this task, the stage will be Fix. Once completed, the stage will be set to Complete before transitioning to the End activity.
In order for this process to work, we'll obviously need to create some task records. It's important to understand that tasks should never be created directly in the base Task [task] table; so let's create a new table, just like we did in a previous chapter. This new table will extend the Task [task] table, just like the Virtual War Room table does. Since we've done this once before, here are the bullet-points:
- In the application navigator, navigate to System Definition | Tables, and click on the blue New button at the top-left.
- On the New record form, enter War Room Task for the label, and press Tab. Once you've done that, the Name field should auto-populate.
- In the Extends table field, enter Task, and select Task [task].
- Leave Create module and Create mobile module checked. Set the Add module to menu option, to Virtual War Room.
- Move to the Controls form tab/section. Check the Live feed checkbox and the Auto-number checkbox, then enter WRT.
- Finally, right-click in the header and click Save.
Now that we have a table we can create War Room Tasks in, we can begin building our workflow. First, let's set up the stages for our workflow. Click on the hamburger menu at the top-left of the workflow editor, and click Edit Stages. Click New, and give the new stage a name of Validation, and a value of validation. Click Submit. Repeat this process to create Diagnose [diagnose], Fix [fix], and Complete [complete] stages.
Next, click on the Core tab on the right side of the Workflow Editor, and navigating to Tasks | Create Task. Make sure you don't have any other activity selected in the workflow, and double-click Create Task. In the corresponding form, set Name to Validation Task, and set the Stage field to Validation.
Next, under the Basics section, set the Task type to War Room Task [u_war_room_task], and make sure that the Wait for completion tick-box is checked.
Scroll down to the Populate task variables form section, and set the Task values from field to Values, and use the Set values section to set Short description to Validate Major Incident Priority and Impact:
Once that's all filled out, click Submit and a new workflow activity will be created at the top-left. Drag it into the middle of the workflow designer, then delete the transition line connecting Begin and End by clicking on it, and pressing the Delete button on your keyboard. Next, drag a line from the exit condition Always on the Begin activity, to the Create Task activity we just created:
To insert a new workflow activity in-between two others that are connected by a transition line, it is not necessary to delete and re-draw the transition. Instead, simply drag the new activity on top of the transition line so that it turns blue, and release!
Now repeat that process to create two more Create Task activities:
- Name: Diagnose Task
- Stage: Diagnose
- Task type: War Room Task [u_war_room_task]
- Wait for completion: true
- Task values from: values
- Set values: Short description - Diagnose the issue, and identify a possible solution
- Name: Fix Task
- Stage: Fix
- Task type: War Room Task [u_war_room_task]
- Wait for completion: true
- Task values from: values
- Set values: Short description - Fix the issue to resolve the major incident.
If you have a workflow activity selected while creating a new workflow activity, the new one may appear inside the selected one, as part of it. To avoid this, make sure that no other activities are selected when creating a new workflow task.
Next, create one more activity by double-clicking Set Values under the Utilities folder in the Core tab on the right of the workflow editor. Set the Name field to Close War Room, the Stage field to Complete, and in the Values section, set State to Closed Complete. Remember that this State field is on the Virtual War Room against which the workflow is running, not on the war room task!
Finally, complete the transition lines so that the workflow progresses from one activity to the next, in the order we defined on the previous page. It should look something like shown in the following screenshot:
Now, simply publish your new workflow from the hamburger menu on the workflow editor, and you've got yourself a functioning workflow!