Skip to main content
Version: Tokyo

Part 3 – Create a Workflow

  1. Back to the App Engine tab, Click on the Return to my application button

    relative

  2. In the "Logic and automation" section, click the Add a process or third-party integration link

    relative

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

  3. Click "Flow"

    relative

  4. Click Build from scratch to create a new workflow

    relative

    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.

  5. Create the flow with the following information:

    1. Name: Main

    2. Description: Manage the Telework flow of work

    3. Click on the Continue button

  6. Click the Edit this flow button to begin the configuration process

    relative

  7. Since this is the first time we've launched Flow Designer, we're given the opportunity to go through the Flow Designer product tour.

  8. 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.

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

    relative

    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. and select our Telework Case table

    3. Click Done to close the trigger

    relative

    Note that 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.

    relative

  10. Now we'll add the actions to execute when this flow fires.

    1. Click Add an Action, Flow logic, or Subflow

    2. Choose " Action"

    relative

  11. 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" relative

  12. 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" relative

  13. In the Rules section, let's configure the approval rule. Click

    1. Choose "Anyone approves" for the Approval rule. relative

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

      relative

    3. Click "Trigger - Record created"

      relative

    4. Click on the chevron to access the list of fields

      relative

    5. Locate the "Opened by" field and click on the chevron next to it

      relative

    6. Select Manager

      relative

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

    7. Click Done

  14. 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"

      relative

    3. Select "If"

      relative

  15. Let's define the condition

    1. Give it a name in the Condition field " Manager approves"

    relative

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

    2. Click "1 – Ask for Approval"

    3. Click "Approval State"

    relative

    1. Set drop-down to "Approved"

    relative

    1. 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.

  16. We'll 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 relative

    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) relative

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

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

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

      This is how the Field Values should look:

      relative

    9. Let's add an annotation and set it to Request Remote Access Token

      relative

    10. Click Done

  17. 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 "If Create Task" click the small + to add a step

      relative

    2. Select " Action"

    3. Select " ServiceNow Core"

    4. Select " Send Email"

      relative

    5. Let's add an annotation and set it to Notify Requester

      relative

    6. For the Target record, use the Data Pill Picker to select " Trigger - Record created" -> " Telework Case Record"

      relative

    7. 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"

      relative

    8. For the " Subject", enter "Your Telework application is approved"

    9. For the " Body",

      1. Start by entering: "Dear" followed by a whitespace

      2. Use the record picker to select the " Opened by – Name" field

      relative

      1. Hit Enter to move to the next line.

      2. Type "Your application for:"

      3. Use the Data Pill Picker to select the " Arrangement –> Code" field

      relative

      1. Type "is approved" after the data pill.

      2. The Body should look like this

      relative

  18. Click Done

  19. Your flow should look like this:

    relative

  20. Click on the Toggle view to visualize the flow as a Diagram

    relative

  21. in the top right corner of the screen, Click Save

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

  22. Click Activate on the left of the Save button

  23. 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.