Getting started with flows Create a sample flow with a trigger and base system actions that requires an approval. Before you beginRole 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. About this taskA 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: Runs when an Expenses record is created. Uses the total amount to determine which action to run. Approves the request if it is under the specified dollar amount. Requires manager approval if it is over a specified dollar amount. Another approver can be manually added. Procedure 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. Navigate to System Applications > Studio. Create a custom application called Expenses Getting Started. In Studio, create an Expenses table. Click Create Application File. Under Data Model, select Table and click Create. A Table form opens. Complete the form with the following values. Label: Expenses Extends table: Task Save the form. 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] 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. On the Expenses table record, click the Show list related link. Click New. Configure the form to add the Amount, Destination, and Requested for fields, and the Approvers related list. 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. Submit the form. Add another record to the table with an amount under 100.00. Add two more records to the table with a value over 100.00 in the Amount field. In Studio, create a new flow. Click Create Application File. Under Flow Designer, select Flow and click Create. Select the Flow option, click Next. In the Flow Name field, enter Expense Approval. Click Submit. An Expense Approval flow is created in the Expenses Getting Started scope. Create a trigger that runs the flow when a record is created in the Expenses table. Trigger: Created Table: Expenses [x_expenses_getting_expenses] Add an if condition to the flow. Select Flow Logic > If. 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. Set Condition 1 to [Trigger->Expenses Record->Amount] [less than] [100.00]. Underneath action 1, click + to add an action that runs when the If condition is met. 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 Add an else condition to the flow. Select Flow Logic > Else. Underneath action 2, click + to add an Ask for Approval action that runs when the Else condition is met. 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. 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. Allow manual users by selecting . A manual approver is a user manually added to the Approvers related list who can then approve the request. Allowing manual users enables a user to manually add a subject matter expert to a task who is able 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. 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] [Days] from [action->Request->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. Click Save. Test the flow using a record with an amount below the designated limit. From the flow, click Test. The Test flow modal appears. 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. Select Run Test. 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. Navigate back to the flow and run the test again using a record with an amount over the designated amount. 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. 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. 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. Change the value of the State field in the Approvers related list to Approved. Navigate back to the flow Execution Details and refresh the browser. Because the request is approved, the flow completes. What to do nextTransform 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.