Workflow scripts
Workflows use a number of activities to build up a process in ServiceNow. These activities can often be used on a basic level, without the need for scripting. However, to build a more advanced workflow, we can use code to enhance the workflows we build.
Scripts can appear in a number of workflow activities, including approvals and task creation. For approvals, it is possible to add users and groups to approval activities using script. In task creation, we can use script to set values on our task before it is created.
The main area for scripting in a workflow, though, is in the Run Script
 Workflow Activity
. This activity allows the developer to run any server-side script they like at a point in the workflow. This can be used to manipulate records, kick off integrations, or perform other outcomes using scripts.
The other area of workflows in which you often come across scripts is in setting up approvals. A simple approval workflow activity will simply pick a user or group to...