Product documentation Docs
    • English
    • Deutsch
    • 日本語
    • 한국어
    • Français
  • More Sites
    • Now Community
    • Developer Site
    • Knowledge Base
    • Product Information
    • ServiceNow.com
    • Training
    • Customer Success Center
    • ServiceNow Support Videos
  • Log in

Product documentation

  • Home
How search works:
  • Punctuation and capital letters are ignored
  • Special characters like underscores (_) are removed
  • Known synonyms are applied
  • The most relevant topics (based on weighting and matching to search terms) are listed first in search results
Topics are ranked in search results by how closely they match your search terms
  • A match on the entire phrase you typed
  • A match on part of the phrase you typed
  • A match on ALL of the terms in the phrase you typed
  • A match on ANY of the terms in the phrase you typed

Note: Matches in titles are always highly ranked.

  • Release version
    Table of Contents
    • Now Platform capabilities
Table of Contents
Choose your release version
    Home Orlando Now Platform Capabilities Now Platform capabilities Flow Designer Getting started with flows

    Getting started with flows

    • Save as PDF Selected topic Topic & subtopics All topics in contents
    • Unsubscribe Log in to subscribe to topics and get notified when content changes.
    • Share this page

    Getting started with flows

    Create a sample flow with a trigger and base system actions that requires an approval.

    Before you begin

    Role required: admin
    Note: While Flow Designer is designed to use the flow_designer and delegated_developer roles in most scenarios, this tutorial uses the admin role to illustrate functionality without requiring additional roles to set up records and approve requests.

    The ITSM application is required to access the Task table.

    Watch this 11-minute video for an introduction to using the flow designer.

    About this task

    A flow can include these components:
    • Trigger: An activity that initiates the flow, such as a record created in a specified table or a scheduled job.
    • Conditions: Statements that determine when or how an action runs. For example, run an action only if a field is over a certain value.
    • Actions: Operations executed by the system, such as a field value updated, approval requested, or a value logged.

    To understand basic flows, create an expense approval flow. This flow:

    1. Runs when an Expenses record is created.
    2. Uses the total amount to determine which action to run.
    3. Approves the request if it is under the specified dollar amount.
    4. Requires manager approval if it is over a specified dollar amount. Another approver can be manually added.

    Procedure

    1. Create a custom application for the flow. Creating flows and actions within an application enables you to publish flows and actions to an application repository and deploy them on other instances. While this example does not use delegated development, you can optionally delegate action and flow designer development by assigning developers to the application.
      1. Navigate to System Applications > Studio.
      2. Create a custom application called Expenses Getting Started.
    2. In Studio, create an Expenses table.
      1. Click Create Application File.
      2. Under Data Model, select Table and click Create.
        A Table form opens.
      3. Complete the form with the following values.
        • Label: Expenses
        • Extends table: Task
      4. Save the form.
      5. Add three additional columns to the table.
        Column label Type Reference
        Amount Floating point number None
        Destination String None
        Requested for Reference User [sys_user]
    3. Add four records to the Expenses table to use in Flow Designer tests. When you test your flow in later steps, you can specify which record is used as the trigger, enabling you to test specific record values.
      1. On the Expenses table record, click the Show list related link.
      2. Click New.
      3. Configure the form to add the Amount, Destination, and Requested for fields, and the Approvers related list.
      4. Complete the Destination and Requested for fields. In the Amount field, add a value under 100.00.
        Make sure that the user in the Requested for field in the test record has a manager assigned in the system. If the user in the test record does not have a manager, configure the User form to add the Manager field, and assign a manager to the user.
      5. Submit the form.
      6. Add another record to the table with an amount under 100.00.
      7. Add two more records to the table with a value over 100.00 in the Amount field.
    4. In Studio, create a new flow.
      1. Click Create Application File.
      2. Under Flow Designer, select Flow and click Create.
      3. Select the Flow option, click Next.
      4. In the Flow Name field, enter Expense Approval.
      5. Click Submit.
        An Expense Approval flow is created in the Expenses Getting Started scope.
    5. Create a trigger that runs the flow when a record is created in the Expenses table.
      • Trigger: Created
      • Table: Expenses [x_expenses_getting_expenses]

      Record trigger in a flow.
    6. Add an if condition to the flow.
      1. Select Flow Logic > If.
      2. In the right-hand pane, expand the Trigger - Record Created category and the [Expenses Record] pill. Drag-and-drop the [Amount] pill into Condition 1. A data pill represents the value of a record or a field at a particular stage in your flow. Dragging the [Amount] data pill from the trigger populates the condition with the value of the field in the triggering record.
      3. Set Condition 1 to [Trigger->Expenses Record->Amount] [less than] [100.00].
      Example if condition in a flow.
    7. Underneath action 1, click + to add an action that runs when the If condition is met.
      Icon to add an action or flow logic within an If condition.
    8. Create an Update Record action that approves the request.
      • Action: Update Record
      • Record: Expand the Trigger - Record Created category and drag the [Expenses Record] data pill from the right-hand pane.
      • Table: Set to Expenses [x_expenses_getting_expenses].
      • Fields:
        • Approval: Approved
        • Work notes: Auto-approved. Amount less than $100.00

      Update Record action to approve the request.

    9. Add an else condition to the flow.
      1. Select Flow Logic > Else.
    10. Underneath action 2, click + to add an Ask for Approval action that runs when the Else condition is met.
      1. Complete the fields in the Ask for Approval step.
        • Action: Ask for Approval
        • Record: Expand the [Trigger - Record Created] category and drag the [Expenses Record] data pill from the right-hand pane.
        • Table: Set to Expenses [x_expenses_getting_expenses].
        • Approval Field: Set to Approval.
        • Journal Field: Set to Approval history.

        Add an Ask For Approval action that evaluates in the Else clause.

      2. Define the rules in the Ask for Approval step.
        • [Approve] when [Anyone approves] from the field [Trigger->Expenses Record->Requested for->Manager], [OR]
        • [Anyone approves] from the [Manual User(s)] list. Select Manual approvers icon to allow a manual approver to process an approval or rejection. A manual approver is a user manually added to the Approvers related list who can then approve the request. For example, you can manually add a subject matter expert to a task to approve the request. To learn more about adding manual approvers, see Generate approvals using the approvers related list.

        Select Add another OR rule set to define rejection rules. When defining approvals, make sure to include rejection rules to avoid creating flows that remain in a waiting state if there are no matching approval rules.

        • [Reject] when [Anyone rejects] from the field [Trigger->Expenses Record->Requested for->Manager], [OR]
        • [Anyone rejects] from the [Manual User(s)] list.

        Rules in the Ask for Approval step.

      3. Define a due date to automatically approve, cancel, or reject an approval if the request is not approved or denied by the designated time. Adding a due date ensures that the flow does not remain in a waiting state.
        • [Approve] if pending by [Relative date] [1][Days] from [Trigger->Expenses Record->Created].
        • Days schedule [8-5 weekdays excluding holidays].

        This due date automatically approves all requests that have not been approved or denied within one day from when the request was created.

        Due date in the Ask for Approval step.

    11. Click Save.
    12. Test the flow using a record with an amount below the designated limit.
      1. From the flow, click Test.
        The Test flow modal appears.
      2. In the Record field, select a record you created in earlier steps that has value in the Amount field under the 100.00 limit. This field is a reference to the table defined in the trigger.
        Note: Testing a flow bypasses the trigger conditions and immediately runs it. To test a flow with a record-based trigger, you must select a specific record to act as the trigger.
      3. Select Run Test.
      4. After the flow executes, click Flow has been executed. To view the flow, click here.
        The Execution Details open.
      Because the amount is less than 100.00, the first condition is met and the request is approved.

      Execution details showing the If clause evaluated and completed.
    13. Navigate back to the flow and run the test again using a record with an amount over the designated amount.
    14. After the flow executes, open the flow Execution Details.
      Because the amount is over the designated limit, the request must be approved. Until a manager or a manual approver approves the request, the state is Waiting.

      Execution details showing the Else clause evaluated and waiting for approval.

    15. Approve the request. In an active flow, a user from the Approvers list would approve or reject the request. However, because the flow is being tested, an admin can approve the flow.
      1. Navigate to the test record.
        The associated manager appears in the Approvers related list with Requested in the State field. Alternatively, you can edit the list to add manual approvers.
      2. Change the value of the State field in the Approvers related list to Approved.
      3. Navigate back to the flow Execution Details and refresh the browser.
        Because the request is approved, the flow completes.

        Execution details showing the Else clause evaluated and completed.

    What to do next

    Transform the Ask for Approval action into a reusable action using Action Designer. Actions enable flow designers to add complex actions to multiple flows with minimal configuration. See Getting started with actions.

    Tags:

    Feedback
    On this page

    Previous topic

    Next topic

    • Contact Us
    • Careers
    • Terms of Use
    • Privacy Statement
    • Sitemap
    • © ServiceNow. All rights reserved.

    Release version
    Choose your release version

      Getting started with flows

      • Save as PDF Selected topic Topic & subtopics All topics in contents
      • Unsubscribe Log in to subscribe to topics and get notified when content changes.
      • Share this page

      Getting started with flows

      Create a sample flow with a trigger and base system actions that requires an approval.

      Before you begin

      Role required: admin
      Note: While Flow Designer is designed to use the flow_designer and delegated_developer roles in most scenarios, this tutorial uses the admin role to illustrate functionality without requiring additional roles to set up records and approve requests.

      The ITSM application is required to access the Task table.

      Watch this 11-minute video for an introduction to using the flow designer.

      About this task

      A flow can include these components:
      • Trigger: An activity that initiates the flow, such as a record created in a specified table or a scheduled job.
      • Conditions: Statements that determine when or how an action runs. For example, run an action only if a field is over a certain value.
      • Actions: Operations executed by the system, such as a field value updated, approval requested, or a value logged.

      To understand basic flows, create an expense approval flow. This flow:

      1. Runs when an Expenses record is created.
      2. Uses the total amount to determine which action to run.
      3. Approves the request if it is under the specified dollar amount.
      4. Requires manager approval if it is over a specified dollar amount. Another approver can be manually added.

      Procedure

      1. Create a custom application for the flow. Creating flows and actions within an application enables you to publish flows and actions to an application repository and deploy them on other instances. While this example does not use delegated development, you can optionally delegate action and flow designer development by assigning developers to the application.
        1. Navigate to System Applications > Studio.
        2. Create a custom application called Expenses Getting Started.
      2. In Studio, create an Expenses table.
        1. Click Create Application File.
        2. Under Data Model, select Table and click Create.
          A Table form opens.
        3. Complete the form with the following values.
          • Label: Expenses
          • Extends table: Task
        4. Save the form.
        5. Add three additional columns to the table.
          Column label Type Reference
          Amount Floating point number None
          Destination String None
          Requested for Reference User [sys_user]
      3. Add four records to the Expenses table to use in Flow Designer tests. When you test your flow in later steps, you can specify which record is used as the trigger, enabling you to test specific record values.
        1. On the Expenses table record, click the Show list related link.
        2. Click New.
        3. Configure the form to add the Amount, Destination, and Requested for fields, and the Approvers related list.
        4. Complete the Destination and Requested for fields. In the Amount field, add a value under 100.00.
          Make sure that the user in the Requested for field in the test record has a manager assigned in the system. If the user in the test record does not have a manager, configure the User form to add the Manager field, and assign a manager to the user.
        5. Submit the form.
        6. Add another record to the table with an amount under 100.00.
        7. Add two more records to the table with a value over 100.00 in the Amount field.
      4. In Studio, create a new flow.
        1. Click Create Application File.
        2. Under Flow Designer, select Flow and click Create.
        3. Select the Flow option, click Next.
        4. In the Flow Name field, enter Expense Approval.
        5. Click Submit.
          An Expense Approval flow is created in the Expenses Getting Started scope.
      5. Create a trigger that runs the flow when a record is created in the Expenses table.
        • Trigger: Created
        • Table: Expenses [x_expenses_getting_expenses]

        Record trigger in a flow.
      6. Add an if condition to the flow.
        1. Select Flow Logic > If.
        2. In the right-hand pane, expand the Trigger - Record Created category and the [Expenses Record] pill. Drag-and-drop the [Amount] pill into Condition 1. A data pill represents the value of a record or a field at a particular stage in your flow. Dragging the [Amount] data pill from the trigger populates the condition with the value of the field in the triggering record.
        3. Set Condition 1 to [Trigger->Expenses Record->Amount] [less than] [100.00].
        Example if condition in a flow.
      7. Underneath action 1, click + to add an action that runs when the If condition is met.
        Icon to add an action or flow logic within an If condition.
      8. Create an Update Record action that approves the request.
        • Action: Update Record
        • Record: Expand the Trigger - Record Created category and drag the [Expenses Record] data pill from the right-hand pane.
        • Table: Set to Expenses [x_expenses_getting_expenses].
        • Fields:
          • Approval: Approved
          • Work notes: Auto-approved. Amount less than $100.00

        Update Record action to approve the request.

      9. Add an else condition to the flow.
        1. Select Flow Logic > Else.
      10. Underneath action 2, click + to add an Ask for Approval action that runs when the Else condition is met.
        1. Complete the fields in the Ask for Approval step.
          • Action: Ask for Approval
          • Record: Expand the [Trigger - Record Created] category and drag the [Expenses Record] data pill from the right-hand pane.
          • Table: Set to Expenses [x_expenses_getting_expenses].
          • Approval Field: Set to Approval.
          • Journal Field: Set to Approval history.

          Add an Ask For Approval action that evaluates in the Else clause.

        2. Define the rules in the Ask for Approval step.
          • [Approve] when [Anyone approves] from the field [Trigger->Expenses Record->Requested for->Manager], [OR]
          • [Anyone approves] from the [Manual User(s)] list. Select Manual approvers icon to allow a manual approver to process an approval or rejection. A manual approver is a user manually added to the Approvers related list who can then approve the request. For example, you can manually add a subject matter expert to a task to approve the request. To learn more about adding manual approvers, see Generate approvals using the approvers related list.

          Select Add another OR rule set to define rejection rules. When defining approvals, make sure to include rejection rules to avoid creating flows that remain in a waiting state if there are no matching approval rules.

          • [Reject] when [Anyone rejects] from the field [Trigger->Expenses Record->Requested for->Manager], [OR]
          • [Anyone rejects] from the [Manual User(s)] list.

          Rules in the Ask for Approval step.

        3. Define a due date to automatically approve, cancel, or reject an approval if the request is not approved or denied by the designated time. Adding a due date ensures that the flow does not remain in a waiting state.
          • [Approve] if pending by [Relative date] [1][Days] from [Trigger->Expenses Record->Created].
          • Days schedule [8-5 weekdays excluding holidays].

          This due date automatically approves all requests that have not been approved or denied within one day from when the request was created.

          Due date in the Ask for Approval step.

      11. Click Save.
      12. Test the flow using a record with an amount below the designated limit.
        1. From the flow, click Test.
          The Test flow modal appears.
        2. In the Record field, select a record you created in earlier steps that has value in the Amount field under the 100.00 limit. This field is a reference to the table defined in the trigger.
          Note: Testing a flow bypasses the trigger conditions and immediately runs it. To test a flow with a record-based trigger, you must select a specific record to act as the trigger.
        3. Select Run Test.
        4. After the flow executes, click Flow has been executed. To view the flow, click here.
          The Execution Details open.
        Because the amount is less than 100.00, the first condition is met and the request is approved.

        Execution details showing the If clause evaluated and completed.
      13. Navigate back to the flow and run the test again using a record with an amount over the designated amount.
      14. After the flow executes, open the flow Execution Details.
        Because the amount is over the designated limit, the request must be approved. Until a manager or a manual approver approves the request, the state is Waiting.

        Execution details showing the Else clause evaluated and waiting for approval.

      15. Approve the request. In an active flow, a user from the Approvers list would approve or reject the request. However, because the flow is being tested, an admin can approve the flow.
        1. Navigate to the test record.
          The associated manager appears in the Approvers related list with Requested in the State field. Alternatively, you can edit the list to add manual approvers.
        2. Change the value of the State field in the Approvers related list to Approved.
        3. Navigate back to the flow Execution Details and refresh the browser.
          Because the request is approved, the flow completes.

          Execution details showing the Else clause evaluated and completed.

      What to do next

      Transform the Ask for Approval action into a reusable action using Action Designer. Actions enable flow designers to add complex actions to multiple flows with minimal configuration. See Getting started with actions.

      Tags:

      Feedback

          Share this page

          Got it! Feel free to add a comment
          To share your product suggestions, visit the Idea Portal.
          Please let us know how to improve this content

          Check any that apply

          To share your product suggestions, visit the Idea Portal.
          Confirm

          We were unable to find "Coaching" in Jakarta. Would you like to search instead?

          No Yes
          • Contact Us
          • Careers
          • Terms of Use
          • Privacy Statement
          • Sitemap
          • © ServiceNow. All rights reserved.

          Subscribe Subscribed Unsubscribe Last updated: Tags: January February March April May June July August September October November December No Results Found Versions Search preferences successfully updated My release version successfully updated My release version successfully deleted An error has occurred. Please try again later. You have been unsubscribed from all topics. You are now subscribed to and will receive notifications if any changes are made to this page. You have been unsubscribed from this content Thank you for your feedback. Form temporarily unavailable. Please try again or contact  docfeedback@servicenow.com  to submit your comments. The topic you requested does not exist in the release. You were redirected to a related topic instead. The available release versions for this topic are listed There is no specific version for this documentation. Explore products Click to go to the page. Release notes and upgrades Click to open the dropdown menu. Delete Remove No selected version Reset This field is required You are already subscribed to this topic Attach screenshot The file you uploaded exceeds the allowed file size of 20MB. Please try again with a smaller file. Please complete the reCAPTCHA step to attach a screenshot
          Log in to personalize your search results and subscribe to topics
          No, thanks Login