Add a flow from scratch
- UpdatedAug 3, 2023
- 4 minutes to read
- Vancouver
- Building applications
If an existing automation template doesn't fit your application goal, define custom automation in App Engine Studio (AES) by building a new flow.
Before you begin
Role required: App Engine Studio user role and delegated developer permissions. For more information, see Delegate developers using AES.
About this task
If a pre-built flow already exists, you can easily add its template to your app and then customize it. For more information, see Add a pre-built flow using a template.
Procedure
- Navigate to All > App Engine > App Engine Studio.
- From the My Apps page, open your application.
- In your application, in the Logic and Automation section, select Add.
- Select the card for Flow.
-
Select Build from scratch.
Figure 1. Build from scratch -
On the form, fill in the fields and then select
Continue.
Field Description Name Name to identify your flow. Description Description of your flow. Protection Access settings for the flow. You can select one of the following options: - -- None --
- Option to enable other users to edit the flow.
- Read-only
- Option to enable other users to view the flow but not edit it.
Run as Selection to specify if the flow runs as a system user or the user who initiates the session. If updates should come from the user who triggered the flow, select User who initiates session. For example, when you want incident record comments to come from the current user, or approval emails to originate from the approver. Run with roles Roles that the flow runs with. This option is available only when Run as is set to User who initiates session.
To use a custom role for your flow, you must create one in Security first. For more information, see Add application security.
-
On the summary screen, select Edit this flow to open
your flow in Flow Designer.
Figure 2. Flow Designer For an example of how to build a flow, see Build your first flow in Flow Designer.
-
Add a trigger to your flow.
- Under the TRIGGER section, select Add a trigger.
-
From the Trigger list, select a trigger that will start running your
flow.
For more information on trigger types, see Flow DesignerWorkflow Studio trigger types.The system displays a set of fields depending on the type of trigger that you've selected.
-
Set up your trigger by filling in the fields.
For a record-based trigger, for example, select a table and set field conditions that, when met, will start running your flow.
- Click Done.
-
To add actions, flows, subflows, or flow logic, select Add an
Action, Flow Logic, or Subflow.
-
Select an option.
Option Description Action Select the desired action. Flow Designer includes Flow DesignerWorkflow Studio actions that are available to flows and subflows. Alternatively, a user with the action_designer role can create additional actions to add to flows. The Integration Hub and Spokes plugins install additional actions.
To add draft actions from the More Actions menu, set Show draft actions to true.
To view spokes that are available in the ServiceNow Store, set Show store spokes to true from the More Actions menu.Note: Under Not Installed Spokes, the system displays spokes that are available in the ServiceNow Store based on compatibility with the ServiceNow version and application dependency on Flow Designer.Flow Logic Select an option to specify conditional or repeated operations. Subflow Select a published subflow and define the input values. In addition to adding a subflow as a flow action, you can enable the Show triggered flows option from the More Actions menu to select an activated flow and define the required inputs. Running a triggered flow ignores its trigger conditions and runs all actions. To change the order of an action in a flow, drag the handle on the left side of the action to the desired location.
The system displays a set of fields depending on the option that you selected. - To configure the action, flow logic, or subflow, fill in the fields.
- Select Done.
- Repeat adding actions until complete.
-
Select an option.
-
To specify how the app will handle errors, enable the ERROR
HANDLER switch and fill in the fields.
For more information on configuring how errors are handled in flows, see Flow error handler.
-
Select Save.
Flow Designer saves a draft of the flow, trigger, and actions.
What to do next