---
schema_version: "1"
id: 713b6a1f623efab013b9cbfc7567ac5910c56b0288d3b74069fd12f54e70db72
title: Using a Flow and Creating a Trigger
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/composer/ms_composer_using_a_flow_and_creating_trigger.md
canonical_url: https://docs.mulesoft.com/composer/ms_composer_using_a_flow_and_creating_trigger
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 4c030633d26b073f5f5061f8118524f053217eff702cd34791ce40cefb80409f
description: MuleSoft Documentation Site
latest: true
---
---
product: Composer
---

# Using a Flow and Creating a Trigger

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

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](https://docs.mulesoft.com/composer/ms_composer_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](#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.

    ![Refresh button for objects](/mulesoft/current/en-us/composer/_images/images/composer_refresh_card.png) 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.

    ![Refresh button for fields](/mulesoft/current/en-us/composer/_images/images/composer_refresh_field.png) 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:

    ![Trigger definition step](/mulesoft/current/en-us/composer/_images/images/trigger-definition.png)

    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](https://docs.mulesoft.com/composer/ms_composer_overview)

- [MuleSoft Composer: Getting Started](https://docs.mulesoft.com/composer/ms_composer_prerequisites)

- [Composer Connector Reference](https://docs.mulesoft.com/composer/ms_composer_reference)

- [Knowledge Articles](https://help.salesforce.com/s/)
