Flow Designer In ServiceNow

6806

Flow Designer is a ServiceNow feature that helps automate business processes in a single design environment without the need for any complex code.

  1. What is a Flow?
  2. How to Create A Flow?

 

 

Build A Complete Flow

1. Configure the flow Trigger condition

Every flow has a trigger specifying WHEN it should execute. When the trigger condition is met, the flow launches.

Once you done with setting properties, next step you have to configure trigger condition.

Click on (+) icon to configure the trigger condition.

  

Trigger Type: While configuring trigger condition, the first thing you have to identify the trigger type.

  • Record-Based: Flows run aftera record is created or updated. The flow can use the triggering record as input for actions.

Example: Created, Updated and Created or Updated

  • Schedule-based: flows run a flow at a specified time of day, week, or month. The flow can use the execution time as input for actions.

Example: Daily, weekly, Monthly etc..

  • Application-based: flows have a SLA Task, Inbound Email, and a Service Catalog

Example: Sla task, inbound email.

2. Configure Actions

Flows use them to identify WHAT should execute when the trigger condition is met. You can use ServiceNow provided Core Actions or create your custom action.

Note:

 By default system allow to have 50 actions in a flow but you can increase 
the number of actions using the

sn_flow_designer.max_actions

 System Property.

If you are increasing the number above then, performance may be impacted!

2.1 Core Actions

A core action is ServiceNow OOB option which cannot be edited and it is categorized as Core SystemGlobal, and Applications

      • OOB actions provide generic platform data handling and tasks.
      • Content and application scopes are called Spokes. A Spoke is a scoped application containing Flow Designer content dedicated to a particular application or record type.

Example: The ITSM Spoke contains actions for managing Task records such as the Create Incident action. Spokes are activated when their parent application is activated.

2.2 Add an Action to a Flow

Once you done with flow trigger condition, the next step is to create action. See the screenshot below to create an action in a flow.

Once you click on + icon below screen will appear. Now click on Action button.

Select the action from list

Use the data pills or “Data Pill Picker” to configure the action

 

2.3 Scripting

Data Pill’s drag and drop feature makes our life easy to configure the actions.

      • What if you needed to transform input data before it was added to a flow?
      • What if you needed a math operation?  Inline scriptsand Transform Functionsallow control over the data beyond just adding it to a flow.

Inline scripts: Code can be written within the flow or action to build values.  Format conversions, data transformations, or math operations are common examples.

      • It Enable simple data conversion or transformation without having to create custom actions or flows.
      • Identify which input data a script affects.
      • Restrict access to scripting features to users or groups who are knowledgeable with the available ServiceNow APIs.

 

Transform Functions provides a way to return a processed version of an input string.  Hover over a data pill within the flow to reveal the +fx icon.

 

Select the +fx icon to reveal the Transform Function.  Suggested Transforms are provided based on the input string.  To apply a Transform Function to a data pill select the transform function type, the transform function, enter any required information, and, if needed, select apply.  The selected transform function appears in the Applied Transforms list.  Multiple scripts can be applied.

3. Test Flows in the Designer

Once you done with action configuration you can test it in design environment.

Click on Execution button to review details such as what is the current state, actions run, and values produced.

Also you can open related records in the design environment or a new browser tab.

Steps to execute the Test.

      • Open the flow in flow designer and hit Test
      • Select the record to perform the test.
      • Click on Run Test.
      • Once the Flow process completes then select “Your test has finished running. View the flow execution details.”
      • The EXECUTION DETAILS opens in a new tab in the Designer. Watch this video for a demonstration.

 

4. Live Example

Scenario 1: System should auto create a demand task and approval based on below conditions.

Flow name: Demand Approval flow

      • If demand state move from draft to submit then create an approval for group “Demand Manager” with condition if any of group member reject then demand should move to deferred state.
      • If all members approves then create one demand task which should get assigned to group called “Demand Executive”
      • Post demand task completion move demand from submitted to screening.

 

5. Custom Action

There are several OOTB core actions and steps in ServiceNow Flow Designer but still we required to build our custom action to execute functions not satisfied by the core actions.

We will discuss the basic steps in creating a custom action in Flow Designer.

Custom Action. A reusable custom basically has three components: Inputs, Action Steps, and Outputs.

 

Action Input. An Action Input is data variable which we will be using in custom action.

Action Step. An action step is a reusable operation within our action. We will create an Action Step using a Script Step. A script step is as well a composite of input variables, script, and output variables.

Action Output. An Action Output is a data variable that represents the results of the action

Use Case 1: Create demand task for all group members if demand moves from Draft to Submit state and assignment group is “Demand Manager”.

Note:

 We can write directly in the scripts associated with the table to 
achieve this requirement. However, our purpose here is to enable process 
owners to define process automation without writing a line of code.

 

Use Case 2: Calculate the age of the ticket and store on the incident form.

   var start_date = new GlideDateTime(inputs.start_date); // created date

   var end_date = new GlideDateTime(inputs.end_date); // Updated

    outputs.ticket_age = GlideDateTime.subtract(start_date, end_date).getDisplayValue();

Use Case 3: Create a problem ticket from incident if incident has been created more than 5 time for same CI.

 

Thanks !!

LEAVE A REPLY

Please enter your comment!
Please enter your name here