---
schema_version: "1"
id: c0106b3f5b475a43e6f0f5cbf4d0789128b7eed5537a101dcb00bd0505b6e60b
title: Create Event Invites with a Subflow in Prompt Flow Example
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_ref_elements_suflow_prompt_flow_example.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_suflow_prompt_flow_example.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: dfbb7469c6cf1b55e2421182e2d38179159ab5466016a65597bb7a365c91d125
description: Use a referenced flow to create meeting invites for each marketing event generated by a sales email template-triggered prompt flow.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Create Event Invites with a Subflow in Prompt Flow Example

Use a referenced flow to create meeting invites for each marketing event generated by a sales email template-triggered prompt flow.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">This feature requires the Einstein for Sales, Einstein for Service, or Einstein Platform add-on. To purchase, contact your Salesforce account executive.</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d338011e74">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d338011e74 ">To open, edit, create, activate or
              deactivate a flow using all flow types, elements, and features available in Flow
              Builder, including Einstein and Agentforce for Flow:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d338011e74 ">Manage Flow</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d338011e74 ">To create and manage prompt templates in Prompt Builder:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d338011e74 ">Prompt Template Manager permission set</td>

          </tr>
        </tbody>
      </table>

Template-triggered prompt flows aren't compatible with prompt templates created in Winter '24.

Let's say you're a Salesforce admin. You create a flow that sends instructions to the prompt template to get Marketing events in the same city and state where your contacts live. Now, you can add a prompt flow as a referenced flow in the parent flow. This new flow creates a meeting invite for your contacts for each marketing event.

Before creating your parent flow, you create a flow that retrieves a list of marketing events. See [Example of Sales Email Template-Triggered Prompt Flow](https://help.salesforce.com/s/articleView?id=platform.flow_concepts_trigger_prompt_template_capability_sales_email_example.htm&release=264.0.0&type=5 "This example creates a flow that integrates with a sales email prompt template to automatically gather and present relevant events for your contacts.").

1. Open the Flows list view.
    
    - From the Automation app, select the **Flows** tab.
    - From the **Flows** tab in any Lightning app, click the actions menu and select **Open Flow**.
    - From Setup, in the Quick Find box, enter Flows, and then select **Flows**.
    
    Note that the Automation app and Flows tab options don't require Setup access.
2. Create the flow.
    - From the Automation app, click **New** | **Autolaunched** | **Template-Triggered Prompt Flow**.
    - From Setup, click **New Flow** | **Autolaunched** | **Template-Triggered Prompt Flow**.
3. Configure the flow.
    
    1. Select **Automatic Inputs**.
    2. For Prompt Template Type, select **Sales Email Template**.
        
        Each prompt template type is associated with its prompt template type in Prompt Builder.
    3. For Recipient, select **Contact**.
    
    ![Start element of a template-triggered prompt flow, where you select prompt template type and set input data types.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/platform_automation/images/flow/flow_subflow_prompt_template.png)
4. Add a Subflow element and configure it.
    
    1. Click ![Add element](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/resources-global/_corporate/images/flow_plus_icon.png), and then click the **Subflow** element.
    2. For Label, enter Event Details, and use the default API name Event\_Details.
    3. For Recipient, select **Prompt Template Input > Contact**.
    4. For Sender, select **Prompt Template Input > User**.
    
    ![Get Marketing Events flow Subflow element window](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/platform_automation/images/flow/flow_subflow_get_marketing_events.png)
5. Add the Add Prompt Instructions element and configure it.
    1. Click ![Add element](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/resources-global/_corporate/images/flow_plus_icon.png), and then click the **Add Prompt Instructions** element.
    2. For Label, enter Meeting Invite, and use the default API name Meeting\_Invite.
    3. For Prompt Instructions, enter Send a meeting invite to {!$Input.Recipient.Name} with {!Event\_Details.Prompt}.
6. Save your flow.
    1. For Flow Label, enter Send Marketing Events Invite, and use the default API name Send\_Marketing\_Events\_Invite.
    2. Save your work.
7. Before activating the flow, click **Debug** to troubleshoot for any flow errors.
8. Set the debug options and input variables.
    
    If you want to run the flow as another user, ensure that **Let admins debug flows as other users** is enabled in **Process Automation Settings**.
9. Click **Run**.
    
    The debug details for the run appear in a panel on the right.
10. To see the results, review the debug details. If the flow fails, [troubleshoot the flow errors](https://help.salesforce.com/s/articleView?id=platform.flow_troubleshoot_email.htm&release=264.0.0&type=5 "Learn how to troubleshoot and resolve flow errors and unexpected behavior in your flows that occur after activation. Interpret error emails, and use best practices to identify and resolve issues quickly.").
11. Activate the flow.

Now that you completed the flow, you create a sales email prompt template in Prompt Builder. You add the parent flow to the prompt template. When you preview the prompt template in Prompt Builder, it triggers the parent flow, which then runs the referenced flow. The parent flow sends its prompt instructions to the prompt template.

#### See Also

- [Create a Sales Email Template-Triggered Prompt Flow Example](https://help.salesforce.com/s/articleView?id=platform.flow_concepts_trigger_prompt_template_capability_sales_email_example.htm&release=264.0.0&type=5 "This example creates a flow that integrates with a sales email prompt template to automatically gather and present relevant events for your contacts.")
- [_Trailhead_: Run a Flow Within a Flow](https://trailhead.salesforce.com/content/learn/modules/flow-build-logic/run-flow-within-flow?trail_id=build-flows-with-flow-builder)
- [Process Automation Settings](https://help.salesforce.com/s/articleView?id=platform.automation_about_settings.htm&release=264.0.0&type=5 "Salesforce provides various settings for platform automation to help customize and streamline business processes.")