Please use docs.servicenow.com for the latest documentation.

This site is for reference purposes only and may not be accurate for the latest ServiceNow version

Defining a Service Catalog Workflow

From Wiki Archive
Jump to: navigation, search
Note
Note: This article applies to Fuji. For more current information, see Request Fulfillment Workflows at http://docs.servicenow.com

The ServiceNow Wiki is no longer being updated. Please refer to http://docs.servicenow.com for the latest product documentation.

Overview

Use the Graphical Workflow Editor to create service catalog workflows that drive catalog request fulfillment.

After creating a workflow, attach it to any catalog item in the Workflow reference field on the item form.

Creating a workflow involves:

  • Defining the new workflow fields.
  • Defining workflow activities.
  • Publishing the new workflow.

The two types of service catalog workflows are Request Level and Request Item Level.

Default Workflows

The two default service catalog workflows provided with the base system are:

  • Service Catalog Request: Always runs and automatically approves a request less than $1,000.
  • Service Catalog Item Request: Must be associated with a catalog item to run, and is only triggered if the requested item is approved.

Defining a Service Catalog Workflow: Example

This section defines an example of a Request Item Level service catalog workflow to fulfill a laptop request.

See the standard workflow documentation for more information about defining workflows.

Stage 1: Create a New Workflow

  1. Navigate to Workflow > Workflow Editor.
  2. Select New.
    SCWorkflowForm.png
  3. Fill in the New Workflow form (see the table for field descriptions).
  4. Click Submit.
    ServiceNow displays a graphical representation of the new workflow that shows an Activities pane on the right.
    SCWorkflowFormActivities.png
Field Input Value
Name Laptop Fulfillment
Table Requested Item [sc_req_item] Please keep the following information in mind:
  • Workflows on the Service Catalog Requested Item [sc_req_item] table should fulfill the request of a single catalog item. Each requested item can trigger its own fulfillment workflow, which runs when those specific items are ordered. We recommend you use this table for workflows for requested items.
Note: To enable approval-type workflows to operate smoothly, make sure that the appropriate users have the correct role, and that the role grants access to the necessary tables for users in all the relevant departments and domains.
  • Use caution when using before query business rules, as they can also restrict access to the sc_req_item record.
  • Workflows on the Request [sc_request] table always run when a service catalog request is made, regardless of what item was ordered. These workflows usually control the entire request process, which may involve delivering several parts (the request items). So Request table workflows are not usually assigned to a specific item from the maintain item form. If you do use the Request table for service catalog requests, you should add conditions to the workflow to make sure it only runs when the correct item is requested.
Expected time Days 7 Hours 00:00:00. Because workflows cannot calculate the end time (not all of the activities within the workflow have defined times), the Expected time on the workflow becomes the Delivery Time on the catalog request.

Note:When both Expected time and Schedule are filled in, the catalog delivery time is then calculated based on the combination of both. For example, if you put 2 days as Expected time, it is calculated as 48 hours. If you then add a schedule that define a work day as 8 hours, the delivery time becomes 48 / 8 = 6 days. If your schedule excludes weekends, the calculation will also add 2 days for the weekend, making the delivery time 8 days.

Schedule 8-5 weekdays. See Using Schedules for more information.
Timezone US/Pacific. The timezone that the schedule applies to.
Description A workflow for the fulfillment of laptop requests.

Stage 2: Add Activities

  1. In the Activities pane, expand Approvals and drag the activity Approval - User onto the arrow between Begin and End.
    This activity generates an approval from the manager of the person requesting the laptop.
  2. Fill in the form that appears with:
    • Name: Manager's Approval
    • Stage: Waiting for Approval
    • User: Click the lock icon (Locked.png), and then click the variable picker icon (Variable Picker.png). Select Request > Requested For > Manager.
    SCWorkflowForm1.png
  3. Click Submit.
  4. Expand Utilities in the Activities pane and drag the activity Set Values to the space below the approval.
  5. Drag from the yellow box beside Rejected on the Approval - User activity to the new Set Values activity.
  6. Drag again from the yellow box beside Always on the Set Values activity to End.
    This activity marks the request as rejected if the manager rejects the request and then ends the workflow.
  7. Fill in the form that appears with:
    • Name: Rejected
    • Stage: Completed
    • Set These Values: Approval and Rejected
    SCWorkflowForm2.png
  8. Drag the activity Set Values onto the the arrow between Approval - User and End, and the fill in the form.
    This activity marks the request as approved if a manager approves it.
    • Name: Approved
    • Stage: Fulfillment
    • Set These Values: Approval and Approved
  9. Drag the activity Create Task onto the arrow between Approved and End, and then fill in the form.
    This task tells Procurement to procure a laptop for the user.
    • Name: Laptop Procurement
    • Stage: Fulfillment
    • Task type: Catalog Task [sc_task]
    • Priority: 3 - Moderate
    • Fulfillment group: Procurement
    • Short description: Procure a Laptop
    SCWorkflowForm3.png
  10. Drag the activity Notification onto the arrow between Laptop Procurement and End, and then fill in the form.
    This task informs the requester that their laptop has been procured.
    • Name: Procurement
    • Stage: Fulfillment
    • To: Click the lock icon (Locked.png), and then click the variable picker icon (Variable Picker.png). Select Request > Requested For.
    • Subject: Your laptop has been procured.
    SCWorkflowForm4.png
  11. Drag the activity Create Task onto the arrow between Procurement and End, and then fill in the form.
    This task tells Hardware to configure the laptop and prepare it for use.
    • Name: Set Up Laptop
    • Stage: Fulfillment
    • Task Type: Catalog Task
    • Priority: 3 - Moderate
    • Fulfillment Group: Hardware
    • Short Description: Set Up Laptop
  12. Drag the activity Create Task onto the arrow between Set Up Laptop and End, and then fill in the form.
    This task tells the requester to come pick up the laptop.
    • Name: Pick Up Laptop
    • Stage: Delivery
    • Task Type: Catalog Task
    • Priority: 3 - Moderate
    • Assigned to: Leave this field blank. The Advanced script assigns this task to the user who requested the item.
    • Short Description: Pick Up Laptop
    • Advanced: Select the check box and set the Advanced Script value to: task.assigned_to=current.requested_for;
  13. Drag the activity Log Message onto the arrow between Pick Up Laptop and End, and then fill in the form.
    This leaves a message in the log to record the successful completion of the workflow.
    • Name: Delivered
    • Stage: Completed
    • Message: The laptop delivery workflow is complete.

See Approval and Rollback Activities for more information about activities.

Stage 3: Publish the Workflow

Open the Workflow Actions menu (Workflow Actions.png) and select Publish to publish the workflow.

The resulting workflow should look like this:

SCWorkflowExample.png