---
sourceDocument: Yokohama Build or modify applications
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/yokohama/application-development

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama Build or modify applications

ft:clusterId :

    - cadev

bundleId :

    - cadev

workflow :

    - Development, Data, and Analytics


---

# Add a flow from scratch

# Add a flow from scratch {#ariaid-title1}

* Release version: Yokohama
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 minutes to read

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: sn_app_eng_studio.user or delegated_developer. For more information, see [Delegate developers using AES](https://servicenow-prod.fluidtopics.net/7nGx8ej0_uG1DIiyMPiwOA "Delegated development enables designated users without a system admin role to develop or deploy applications on the ServiceNow AI Platform. This enables administrators and delegated developers to work together to deliver custom applications through App Engine Studio (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](https://servicenow-prod.fluidtopics.net/sEhOTNf9Egx2Nc1AtphF1w "Use a pre-built flow to quickly automate manual work in the app you're building in App Engine Studio (AES).").

## Procedure

1. Navigate to AllApp EngineApp Engine Studio.
2. From the My Apps page, open your application.
3. In your application, in the Logic and Automation section, select Add.
4. Select the card for Flow.
5. Select Build from scratch.  
   Figure 1. Build from scratch
6. On the form, fill in the fields and then select Continue.  
   {#create-scratch-flow__table_qf3_nxp_b4b__entry__2}

   | 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](https://servicenow-prod.fluidtopics.net/lGBiWQYGFF~Ys_U2gG0NFw "Control who is permitted to use or edit your application by configuring roles in App Engine Studio (AES)."). |
   [ ]

   {#create-scratch-flow__table_qf3_nxp_b4b}
7. On the summary screen, select Edit this flow to open your flow.  
   Figure 2. Flow Designer

   For an example of how to build a flow, see [Build your first flow in Flow Designer](https://www.servicenow.com/docs/access?context=build-your-first-flow&version=yokohama&pubname=yokohama-build-workflows&ft:locale=en-US).
8. Add a trigger to your flow.
   1. Under the TRIGGER section, select Add a trigger.
   2. From the Trigger list, select a trigger that will start running your flow.  
      For more information on trigger types, see [Workflow Studio flow trigger types](https://www.servicenow.com/docs/access?context=flow-triggers&version=yokohama&pubname=yokohama-build-workflows&ft:locale=en-US).  
      The system displays a set of fields depending on the type of trigger that you've selected.
   3. 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.
   4. Click Done.
   {#create-scratch-flow__substeps_elr_yzb_d5b}
9. To add actions, flows, subflows, or flow logic, select Add an Action, Flow Logic, or Subflow.
   1. Select an option.  
      {#create-scratch-flow__table_smq_3ys_tcb__entry__2}

      | Option | Description |
      |-|-|
      | Action | Select the desired action. Workflow Studio includes [Workflow Studio actions](https://www.servicenow.com/docs/access?context=flow-actions&version=yokohama&pubname=yokohama-build-workflows&ft:locale=en-US) 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](https://www.servicenow.com/docs/access?context=integrationhub&version=yokohama&pubname=yokohama-integrate-applications&ft:locale=en-US) and [Spokes](https://www.servicenow.com/docs/access?context=spokes&version=yokohama&pubname=yokohama-build-workflows&ft:locale=en-US) 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 Workflow Studio. |
      | 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. |
      [ ]

      {#create-scratch-flow__table_smq_3ys_tcb}

      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.
   2. To configure the action, flow logic, or subflow, fill in the fields.
   3. Select Done.
   4. Repeat adding actions until complete.
   {#create-scratch-flow__substeps_fqw_rhr_mcb}
10. 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](https://www.servicenow.com/docs/access?context=flow-error-handler&version=yokohama&pubname=yokohama-build-workflows&ft:locale=en-US).
11. Select Save.  
    The ServiceNow AI Platform saves a draft of the flow, trigger, and actions.

## What to do next

Test your flow until you're ready to activate it. For more information on testing and editing flows, see [Activate a flow](https://www.servicenow.com/docs/access?context=flow-activate&version=yokohama&pubname=yokohama-build-workflows&ft:locale=en-US).  
Note:  
Your application can trigger only activated flows.
* **[Modify a flow](https://servicenow-prod.fluidtopics.net/hEpDi0uiOV~1ZKWPHxi~mg)**   
  To update or change an existing flow for an app you built in App Engine Studio (AES), edit it.

*[\>]: and then


