Skip to main content

3.1 Create the Workflow

  1. From the App Home tab, in the "Logic and automation" section, click Add.

From the Add Automation Screen, we are provided with a variety of process automation templates we can use to speed creation of common activities.

  1. Click "Flow".
  1. Click Build from scratch to create a new workflow.

A Flow is a sequence of actions to automate processes on the Now Platform.

Logic and automation use computers to manage repeatable processes instead of using people. Logic and automation can reduce human error and speed up processes. App Engine Studio allows creators to add process flows to their applications.

  1. Create the flow with the following information:

    FieldValue
    NameMain
    DescriptionManage the Telework flow of work.

    Click on the Continue button.

  1. Click the Edit this flow button to begin the configuration process.
  1. You may see a tour popup. Let's skip the tour for now, by clicking the Skip tour button.

The first thing we'll do is set up our trigger to define when this flow will run.

  1. Click on Add a trigger in the upper left of the flow designer screen.

    Flow designer provides different options for triggering a workflow. You can kick off a flow based on a record being created or updated, , run on a scheduled basis, or based on a unique application component like an SLA task being triggered or an inbound email being received by the instance. For our use case we are going to:

    1. Select Created from the Record section.
    2. Select the Telework Case table.
    3. Click Done to close the trigger.

    note

    There might be circumstances under which we need to have a particular flow to execute. In this case we can use the "Add filters" option to define conditions that must be met for this flow to execute. This helps making flow easier to maintain and reuse. For example, we could use a flow specific to new request, one for renewal or request.

  1. Now we'll add the actions to execute when this flow fires.
    1. Click Add an Action, Flow logic, or Subflow.
    2. Choose Action.
  1. The first step in the process we want to automate is managing the approvals across departments.
    1. In the search field, type "approval".
    2. Select Ask for Approval.
  1. The first thing we need to configure is the record we'll be working with for this action.
    1. Click on the data picker.
    2. Select Trigger – Record Created.
    3. Select Telework Case Record.
  1. In the Rules section, let's configure the approval rule.
    1. Choose Anyone approves for the Approval rule.
    2. Click on the Data Pill Picker button (the magic wand button).
    3. Click Trigger - Record created.
    4. Click on the chevron to access the list of fields.
    5. Locate the Opened by field and click on the chevron next to it.
    6. Select Manager.

    We just configured an approval request to the manager of the person who submitted the form.

    1. Click Done.
  1. Now let's configure what happens when the manager approves:
    1. Under the Ask for Approval, click on the "Add an Action. Flow logic or Sub flow.
    2. Select Flow Logic.
    3. Select If.
  1. Let's define the condition:
    1. In the Condition Label field type "Manager approves".
    2. Click on the Data Pill Picker (magic wand button).
    3. Click 1 – Ask for Approval.
    4. Click Approval State.
    5. Set drop-down to Approved.
    6. Click Done.
info

We now have a branch where we can add actions or flow logic if the manager approves.

Let's save the team from sending tasks via emails or other systems.

  1. Next, we will configure the Flow to automatically request I.T. to assign a Remote Access Token to the employee.

    1. Under If Manager approves click the small + to add a step.

    2. Select Action > ServiceNow Core > Create Task.

    3. For Table, select "Ticket".

    4. Click Add field value.

    5. Search and select Parent.

    6. Click on the Data Pill Picker (magic wand button).

    7. Select Trigger - Record created > Telework Case Record.

    8. Click + Add field value and add two other fields:

      Field NameField Value
      Short descriptionRemote Access Token
      Assigned tofor testing assign it to yourself (System administrator)

    This is how the Field Values should look: 9. Let's add an annotation and set it to "Request Remote Access Token". 10. Click Done.

  1. First, let's take care of automating the notifications that take too much time right now.

    We'll send an email to the applicant's and let them know their application has been approved.

    1. Under 3 - Create Task click the small + to add a step.
    2. Select Action > ServiceNow Core > Send Email.
    3. Let's add an annotation and set it to "Notify Requester".
    4. For the Target record, use the Data Pill Picker to select Trigger - Record created > Telework Case Record.
    5. For the To field,
      1. Click on the record picker.
      2. Select Trigger - Record created.
      3. Click on the chevron to access the list of fields.
      4. Locate the Opened by field and click on the chevron next to it.
      5. Select Email.

    1. For the Subject, enter:
    Your Telework application is approved.
    1. For the Body:
      1. Start by entering: "Dear " (followed by a whitespace).
      2. Use the record picker to select the Opened by > Name field.
      3. Hit Enter to move to the next line.
      4. Type "Your application for ".
      5. Use the Data Pill Picker to select the Arrangement > Code field.
      6. Type " is approved" after the data pill (preceeded by a whitespace).
      7. The Body should look like this:
  1. Click Done.
  1. Your flow should look like this:
  1. Click on the Toggle view to visualize the flow as a Diagram.
  1. In the top right corner of the screen, Click Save.

Although the Flow is saved, it won't run until we activate it.

  1. Click Activate on the left of the Save button.
  1. In the Confirmation box click the Activate button.

Congratulations! 🎉

You've built a flow that takes care of managing tasks and communications across multiple departments.

info

Note that by default Personal Developer Instances have "sending email" turned off by default. If you want to receive the email, make sure that the user submitting the application has a valid email address on their user record.

Next, let's test our work and see it in action.