servicenow workflow

1219

ServiceNow workflow automates IT operations and streamlines them with common updates. Workflow helps to enhance the employee’s productivity through its recent advancements. Workflow can change the work environment for both management and employees. Workflow reduces human errors by generating accurate results.

Workflow provides a drag-and-drop interface for automating multi-step processes across the platform. Each workflow consists of a sequence of activities, such as generating records, notifying users of pending approvals, or running scripts.

Things to remember about workflow

    • Each workflow comprises one or more activities, which are executed in sequence, beginning from the Begin activity and ending when it reaches the End activity.
    • A workflow usually executes when a record in the table it is attached to is either inserted or updated and the start condition defined in the workflow properties evaluates to true.
    • Workflows can also be executed based on an event or from scripts.
    • Workflow editor can be used to design, modify, and validate the workflows.
    • Workflow editor is a graphical tool that is used to design workflows by arranging and connecting activities to automate a process.
    • Each activity in a workflow has its own variable scope and can output objects that can be used by subsequent activities.
    • Activities defined within a workflow can also access workflow-level variables referred to as workflow scratchpad variables.
    • A workflow executes only when it is in published state.
    • A workflow executes only when it is in published state. We can publish a workflow using the Publish option in the actions menu.
    • The status of the workflow is always visible in the title bar.
    • If a workflow is in published state, we cannot modify its properties or make any changes to any of its activities.
    • Incident, change, problem, service-level management, and service catalog, rely heavily on workflows.
    • If there are multiple workflows defined in a table, we can specify the order in which workflows are executed.

How to create new workflow

    • Navigating to Workflow -> Workflow Editor

Note Workflow Editor opens up in a new browser window. Make sure to allow pop-up windows from your ServiceNow instance URL as it may cause problems when pop-up blockers are active.

    • Click on New Workflow button.
    • Fill out the form and save.
    • Name: A unique name for the workflow that can be used to distinguish it from other workflows.
    • Table: Name of the table on which the workflow will be applied.

    • If condition matches: This property can be used to define when and how the workflow will execute. There are three possible options:
    • Run the workflow: If this option is selected, the workflow will execute when the workflow’s condition field evaluates to true.
    • Run if no other workflows matched yet: If this option is selected, the workflow will execute when the workflow’s condition field evaluates to true and no other workflows are running on the record.
    • None: This option can be used to ignore the condition filed and use a subflow or script to execute the Workflow

Workflow :

Workflow actions menu

The workflow actions menu, as shown in the following screenshot, in the title bar of the canvas, can be used to perform many different actions related to the current workflow. It can be used to publish, copy, or delete the workflow. It can also be used to validate the workflow and access workflow contexts that are currently associated to any record.

Parts of a workflow

Lets discuss part of workflow which are very important to understand the concept of each part.

1. Workflow properties

2. Version:

Versions of each workflow are stored in the Workflow Versions [wf_workflow_version] table.

3. Context:

When a task matches the criteria set up for a workflow, that workflow will execute against that task, and perform activities on it. This relationship between one workflow version and one task, is called a Context. Contexts are stored in the Workflow Context [wf_context] table.

4. Transitions:

Specify the conditions under which to run an activity.

5. workflow activities

5.a Join activity

An activity can also have multiple lines drawn from a single exit condition, pointing to multiple activities. If this is the case, these activities will execute simultaneously.

In a situation like this, it’s possible to save a workflow where one of these branches doesn’t have an exit condition (a transition to another activity), but it isn’t recommended. Instead, ServiceNow provides a Join activity, which you can use to merge the divergent paths back into a single transitionflow.

5.b. Switch

An If condition activity is perfect in the event that there are only two exit states: true and false, or yes and no. If you want your workflow to follow a separate path based on a particular field’s value, such as the impact of a given ticket, you might find it more advantageous or convenient to use a Switch

Workflow life cycle

A workflow starts when event occurs. Common way to triggers an event is insert a record or update a record into a specific table, or a particular field in a table being set to a specified value.

For example, you might create a workflow that runs whenever a user requests approval for an item (Ex Laptop) they want to order from the catalog. You can also schedule workflows to run periodically or call them from scripts such as business rules.

When an activity completes, the workflow transitions to the next activity. An activity might have several different possible transitions to various activities, depending on the outcome of the activity.

Continuing the example above, if the user’s request is approved, the activity might transition to an activity that notifies someone to order the item or if item present in the store, then hand over to requester. If the user’s request is denied, the activity might transition to notifying the user that their request has been denied.

At each step in a workflow:

      1. An activity is processed, then action occurs which defined by that activity.
      2. Post completion of an action by an activity, the workflow checks the activity’s conditions.
      3. For each matching condition, the workflow follows the transition to the next activity.
      4. When there is no activities left to execute then the workflow marked as complete.

 

Notes
  1. The Workflow Contextstores the execution history of the activities and transitions run.
  2. The Workflow Versionstores the design history of the activities, transitions, and exit conditions available to run.

 

Troubleshoot workflows

Troubleshooting tools for workflows enable administrators to isolate execution paths, compare contexts, and track incomplete activities.

The workflow timeline provides a visual representation of the workflow, including transitions and the elapsed time for each activity. A troubleshooting tool for highlighting execution paths helps users perform forensics on a workflow. The highlighting feature can group multiple execution paths in various colors and can isolate rollback processing. Use the workflow highlighter to isolate incomplete tasks and approvals. You can also enable a workflow performance timing feature to troubleshoot slow workflows.

Execution history table

Highlight execution paths and rollbacks to locate activities that may have been left in an unresolved state.

Example

Rollbacks, cancels, and deletions during the execution of a workflow can prevent some activities from fully completing. Use highlighting in the execution history table to determine which activities in the workflow were left in an unresolved state.

Procedure

      1. Run the workflow.
      2. Navigate to Workflow> All Contexts.
      3. Select a context to troubleshoot.
      4. In the Workflow Context form, select the Workflow Activity Historyrelated list.
      5. Right-click an activity and select Workflow Debug> Toggle Execution Path Highlighting from the context menu.

All activities in that execution path are highlighted in a color selected by the platform. The debug path shows all activities that completed successfully during the workflow.

      1. Right-click a rollback activity and select Workflow Debug> Toggle Rollback Highlighting from the context menu.

The platform highlights the rollback path (restarted activities) in a different color. Each color represents a group of activities that were part of the same rollback execution. The highlighting includes the activity that initiated the rollback. If you right-click an activity that was not part of a rollback, no rows are highlighted.

The rollback activity itself appears in both execution path and rollback highlighting.

      1. To remove highlighting, right-click in the list and select an option to clear execution path or rollback highlighting. You can clear individual rollback paths or all rollback highlighting.

FAQ

How to create new workflow

1. Navigating to Workflow -> Workflow Editor
2. Click on New Workflow button.
3. Fill out the form and save.

What is workflow in servicenow

ServiceNow workflow automates IT operations and streamlines them with common updates. Workflow helps to enhance the employee’s productivity through its recent advancements. Workflow can change the work environment for both management and employees. Workflow reduces human errors by generating accurate results.

Workflow life cycle

A workflow starts when event occurs. Common way to triggers an event is insert a record or update a record into a specific table, or a particular field in a table being set to a specified value.

Troubleshoot workflows

Troubleshooting tools for workflows enable administrators to isolate execution paths, compare contexts, and track incomplete activities.

The workflow timeline provides a visual representation of the workflow, including transitions and the elapsed time for each activity. A troubleshooting tool for highlighting execution paths helps users perform forensics on a workflow. The highlighting feature can group multiple execution paths in various colors and can isolate rollback processing. Use the workflow highlighter to isolate incomplete tasks and approvals. You can also enable a workflow performance timing feature to troubleshoot slow workflows.

workflow activities

Join activity

An activity can also have multiple lines drawn from a single exit condition, pointing to multiple activities. If this is the case, these activities will execute simultaneously.

In a situation like this, it’s possible to save a workflow where one of these branches doesn’t have an exit condition (a transition to another activity), but it isn’t recommended. Instead, ServiceNow provides a Join activity, which you can use to merge the divergent paths back into a single transitionflow.

LEAVE A REPLY

Please enter your comment!
Please enter your name here