# Run action

The Run Action action node calls another action from within the current action. It is available in [apps](/reference/apps.md), [flows](/reference/flows.md), and [services](/reference/services.md).

### Usage

This action node is useful in the following cases:

* When logic should be reused across different parts of an app or flow. Common logic can be placed in a separate action and called from multiple places.
* When actions get complex. Splitting a long action into smaller actions makes them easier to understand and debug.
* In flows, where one flow action can call another flow action within the same flow using Run Action.

### Input mapping

When the target action is selected, its [action params](/reference/actions/action-params.md) are displayed on the action node. Each param can be bound to a value from the calling context — a data source property, an app variable, an action variable, or a function result. Params marked as required must have a value bound; optional params can be left unbound, in which case the action uses the param's default value.

If an action param has a [schema](/reference/platform-concepts/schemas.md) as its data type, click the three-dot menu on the param to open the data binding popover and select **Add schema**. This lets you bind data from the calling context directly to the individual properties of the action param's schema.

### Return mapping

When the target action completes, any [action variables](/reference/actions/action-variables.md) and [action data sources](/reference/actions/action-data-sources.md) that are marked as returned from the action are available for mapping back into the calling context. The return mapping determines where the output data lands and how it is applied.

Each returned item is mapped to a target in the calling context — either an app data source, an action data source, an app variable, or an action variable. The target must match the returned data: a returned data source must be mapped to a data source backed by the same object class, a returned action variable must be mapped to a variable of the same data type, and if the data type is a schema, the schemas must have a matching structure.

The mapping mode controls how the returned data is applied to the target:

* **Replace** replaces the contents of the target with the returned data.
* **Add to Data Source (merge duplicates)** appends the returned data to the existing contents of the target data source and merges any duplicates. This mode is only available when the target is a data source with cardinality many.

If the returned data contains properties that do not exist on the target, those properties are silently dropped.

### Properties

| Property                | Description                                                                                                                                                                |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Action**              | Select which action to run. In a flow, the list shows other flow actions within the same flow. In an app, the list shows other actions within the same app.                |
| **Action Params Input** | *Displayed if the selected action has action params.* Bind values from the calling context to each of the action's input params.                                           |
| **Return Data Mapping** | *Displayed if the selected action returns action variables or action data sources.* Map each returned item to a target in the calling context and select the mapping mode. |


---

# Agent Instructions: 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:

```
GET https://docs.appfarm.io/library/action-nodes/run-action.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
