Using a Flow and Creating a Trigger | MuleSoft Documentation
# Using a Flow and Creating a Trigger
You can use Composer to address integration problems in your organization by building and configuring flows. In Composer, a _trigger_ is the flow’s sequence of actions. This is the first step of a flow. Prior to creating a trigger, you must first create, clone, or import a flow.
## Create a Flow
You can create a new flow (from scratch or from template) or clone an existing flow.
### Create a New Flow From Scratch
To create a new flow from scratch:
  1. From the Composer **Home** page, click **Create new flow > Create Flow from Scratch**. Your flow is named automatically.
  2. To change the name automatically created for your new flow, click the pencil icon next to **Untitled Flow** and create a custom name using any of the characters A-Z, a-z, 0-9, space, hyphen ( - ), dot ( . ), and underscore ( _ ).
  3. Click **Save**.


Now you are ready to create a flow trigger.
### Create a New Flow From Template
To create a new flow from template:
  1. From the Composer **Home** page, click **Create new Flow > Create Flow from Template**.
  2. Explore the template options and select the template you want to use.
  3. Ensure you meet the prerequisites and if so, click **Use this Template**.
  4. Configure your connections and information required by the flow.
  5. Click **Create flow**.


Now you are ready to use your flow. For more information about templates, refer to Build a Flow Using Templates.
### Clone an Existing Flow
To clone an existing flow:
  1. From the sidebar, click **Flows**.
  2. On the **Flows** page, click the name of the flow you want to clone.
  3. Click **Clone**.
Composer copies the existing flow and opens the copy in the Flow Details page. Notice that the flow is named **Copy of _original flow name_**.
  4. If you want to rename the flow, click the pencil icon next to **Copy of _original flow name_** and use any of the characters A-Z, a-z, 0-9, space, hyphen ( - ), dot ( . ), and underscore ( _ ).
  5. Click **Save**.


## Export a Flow
To export a flow as a JSON file:
  1. Open an existing flow. The **< Flow Name>** page appears.
  2. Click **View**.
  3. Click the wrench icon > **Export**. The flow is exported as a JSON file.


## Import a Flow
To import a flow as JSON file:
  1. Create a new flow or open an existing flow. The **< Flow Name>** page appears.
  2. Click **View**. The **< Flow Name>** page appears.
  3. Click the wrench icon > **Import - Beta**. The **Select Flow** dialog box appears.
  4. Click **Select flow**. Your files appear.
  5. Navigate to and select the JSON file that you want to upload and then click **Open**. The selected file appears in the **Select Flow** dialog box.
  6. In the **Connect with <Connector Name>** drop down, choose an existing connection or create a new one:
     * Click an existing connection to select it.
     * Click **Add new <Connector Name> Connection** to create a new connection and select it.
  7. Click **Import Flow**. Note that importing a flow will replace the existing flow. The flow is imported and appears on the **< Flow Name>** page.
  8. Click **Save**. The flow is imported.


## Refresh a Flow
When building a flow, you may need to refresh the flow to view updated data at either the object level or the field level.
To refresh a object:
  1. Open the flow.
  2. Click the refresh icon in the upper right corner of the trigger or action card that you want to refresh.
The cache for the object type is cleared and the new data is retrieved.


To refresh a field:
  1. Open the flow.
  2. Click the refresh icon in the bottom left corner of the trigger or action card.
The cache for the field is cleared. The new value providers for the field are retrieved.


## Create a Flow Trigger
After you create or clone a flow, define the trigger: the event or time interval that starts the flow. A trigger step is required to test or activate your flow.
To define a trigger based on an event:
  1. Open a flow if it is not already open. The **What Should Start This Flow?** dialog is displayed.
  2. Select the connector where the triggering event occurs. Your existing connections are displayed.
You can choose an existing connection or create a new one:
     * Click an existing connection to select it.
     * Click **Add new _connector name_ Connection** to create a new connection and select it. You can rename or delete connections from this dialog by clicking the gear icon.
  3. After you choose a connection, the trigger step displays:
Your trigger is named automatically. All triggers are named by combining the event or operation with the system name. For example, "On new record in Salesforce".
     * Optionally, you can rename the trigger. Valid characters: A-Z, a-z, 0-9, space, hyphen ( - ), dot ( . ), and underscore ( _ ).
     * Choose an event that starts the flow. Supply additional information as requested.
     * Click **Save**.


## See Also
  * Mulesoft Composer: Overview
  * MuleSoft Composer: Getting Started
  * Composer Connector Reference
  * Knowledge Articles