> For the complete documentation index, see [llms.txt](https://docs.gradient.works/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gradient.works/kb/automation-builder-kit-abk/actions/flow-lifecycle/gwfxexecutesubflowaction.md).

# Execute Subflow

{% hint style="warning" %}
This is an advanced action. If your subflow is not optimized or this action is used repeatedly (e.g. in a loop), your Flow may run poorly or fail. Unless you specifically need the functionality provided here, use the native Subflow element.
{% endhint %}

Flow provides the ability to run a subflow natively through the [Subflow element](https://help.salesforce.com/articleView?id=sf.flow_ref_elements_subflow.htm\&type=5). This action provides additional capabilities such as the ability to schedule the subflow to run at a future date.

The native Subflow element also requires you to select the Flow from a list of known Flows, preventing you from using logic in the calling Flow to choose a specific subflow to execute. This action provides the ability to invoke a Flow using the value of a resource in the calling Flow. This allows you to dynamically execute a subflow based on the result of a decision or formula in the calling Flow.

Please note the following limitations:

* Subflows must be active and auto-launched without a trigger
* Only Text, Number and Boolean types are supported for inputs
* Subflow outputs are not currently accessible from this action

## Inputs

Please note that you will not directly interact with these input fields as you do with some Flow Actions. Instead the Gradient Works custom editor takes care of the heavy lifting.

| Name              | Required | Type    | Description                                                                                           |
| ----------------- | -------- | ------- | ----------------------------------------------------------------------------------------------------- |
| flowApiName       | Yes      | String  | The API name of the Flow to execute                                                                   |
| executionDelay    | No       | Integer | If Flow is scheduled, number of minutes to wait before invoking Flow                                  |
| executionSchedule | No       | String  | One of 'immediate' or 'scheduled'. Should the Flow be invoked immediately or scheduled to run later.  |
| flowInputData     | No       | String  | Data that describes the Flow inputs. See action overview for more information about supported inputs. |
| flowInterviewGuid | No       | String  | Automatically provided as `$Flow.InterviewGuid`.                                                      |

## Outputs

This action does not currently support retrieving output variables from the subflow.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gradient.works/kb/automation-builder-kit-abk/actions/flow-lifecycle/gwfxexecutesubflowaction.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
