> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getflowpilot.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Actions reference

> Every ComponentAction kind, its fields, and the setVariable operations by type.

Actions are what a component does when an interaction fires (a tap, a change, an appear). An interaction holds an ordered list of actions. This page lists every action kind and its fields.

Every action is a `ComponentAction` with a `kind` plus its own fields, and may carry an optional `delay`.

## Scheduling: `delay`

| Field   | Type                  | Notes                                                                                                                                                     |
| ------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `delay` | number (ms, optional) | Absolute offset from when the interaction's event fired, **not** a cumulative wait after the previous action. Omitted or `0` runs the action immediately. |

Because each action schedules independently, `[setVariable @0, setVariable @1000]` walks a variable through two values one second apart.

## Action kinds

### `navigate`

Go to a specific node.

| Field          | Type   | Notes                                                         |
| -------------- | ------ | ------------------------------------------------------------- |
| `targetNodeId` | string | The destination node ID. A fixed target, not a dynamic value. |

### `goNext`

Go to the next screen (follows the default edge). No fields.

### `goBack`

Go to the previous screen. No fields. Used by the Back Button chrome preset.

### `closeFlow`

Dismiss the entire flow. No fields. Used by the Close Button chrome preset. The `closeFlow` action ends the flow with the `completed` outcome. A system dismissal (swipe-to-dismiss or programmatic) ends it with the `dismissed` outcome instead. See [Results and outcomes](/ios-sdk/results-and-outcomes).

### `setVariable`

Apply an operation to a variable. The primary way to mutate state.

| Field         | Type                       | Notes                                                           |
| ------------- | -------------------------- | --------------------------------------------------------------- |
| `variableKey` | string                     | The variable to modify. Must be a writable Flow State variable. |
| `operation`   | `VariableOperation`        | The operation (see the table below).                            |
| `value`       | `VariableValue` (optional) | Operand, if the operation needs one.                            |

Operations by variable type:

| Type    | Operations (schema value)                                           | UI label                                                                                |
| ------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| Boolean | `set_true` / `set_false` / `toggle`                                 | Set ON / Set OFF / Toggle                                                               |
| Number  | `set` / `increment` / `decrement` / `multiply` / `divide` / `reset` | Set to value / Increment by / Decrement by / Multiply by / Divide by / Reset to initial |
| String  | `set` / `append` / `prepend` / `clear`                              | Set to value / Append / Prepend / Clear                                                 |
| List    | `add` / `remove` / `toggle` / `clear` / `set`                       | Add item / Remove item / Toggle item / Clear list / Set list                            |

For boolean operations, `value` is unused (the operation is self-contained). For `list`, `value` is the item to add/remove/toggle, or the new array for `set`.

### `assign`

Set one or more variables from expressions. Each assignment runs an expression through the SDK's evaluator.

| Field         | Type                                                    | Notes                           |
| ------------- | ------------------------------------------------------- | ------------------------------- |
| `assignments` | `{ variableKey: string; expression: FlowExpression }[]` | Each entry writes one variable. |

The expression subset is documented in [Conditions and expressions](/reference/conditions-and-expressions). An expression that cannot be evaluated is skipped (the variable is left unchanged), never written as empty or zero.

<Note>
  `assign` exists in the schema and the SDK evaluates it, but the editor does not expose it as a pickable action. It is used internally to compile payload bindings (for example `{{payload.height}}` from a custom component output). For everyday state changes, use `setVariable`.
</Note>

### `trackEvent`

Emit a custom analytics event.

| Field        | Type                                                 | Notes                                                 |
| ------------ | ---------------------------------------------------- | ----------------------------------------------------- |
| `eventKey`   | string                                               | The event name (shown as "Event Name" in the editor). |
| `properties` | `Record<string, FlowExpressionOrLiteral>` (optional) | Extra properties.                                     |

### `openUrl`

Open a URL.

| Field | Type                      | Notes                            |
| ----- | ------------------------- | -------------------------------- |
| `url` | `FlowExpressionOrLiteral` | The URL (literal or expression). |

### `haptic`

Trigger device haptic feedback.

| Field       | Type                             | Notes     |
| ----------- | -------------------------------- | --------- |
| `intensity` | `"light" \| "medium" \| "heavy"` | Strength. |

### `triggerAnimation`

Fire a reactive animation step on a target component.

| Field               | Type                                          | Notes                                                  |
| ------------------- | --------------------------------------------- | ------------------------------------------------------ |
| `targetComponentId` | string                                        | The component to animate.                              |
| `stepId`            | string (optional)                             | A specific step. Omit to fire the first reactive step. |
| `animation`         | `"enter" \| "exit" \| "attention"` (optional) | **Deprecated.** Use `stepId`.                          |

### `triggerParticle`

Fire a particle effect overlay. Extends the shared particle config.

| Field       | Type                                                                       | Notes                                                                                                 |
| ----------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `effect`    | `ParticleEffectType`                                                       | `confetti` / `sparkles` / `fireworks` / `snow` / `hearts` / `stars` / `emoji` / `bubbles` / `petals`. |
| `duration`  | number (ms, optional)                                                      | How long it plays.                                                                                    |
| `colors`    | `string[]` (optional)                                                      | Particle colors.                                                                                      |
| `emoji`     | `string[]` (optional)                                                      | For the `emoji` effect.                                                                               |
| `density`   | `"light" \| "medium" \| "heavy"` (optional)                                | Count.                                                                                                |
| `size`      | `"small" \| "medium" \| "large"` (optional)                                | Particle size.                                                                                        |
| `direction` | `"top" \| "bottom" \| "left" \| "right" \| "center" \| "edges"` (optional) | Emit direction.                                                                                       |
| `spread`    | number (optional)                                                          | Cone angle, 0 to 360.                                                                                 |
| `gravity`   | number (optional)                                                          | -2 to 2.                                                                                              |
| `speed`     | number (optional)                                                          | 0 to 2.                                                                                               |
| `haptic`    | `"none" \| "light" \| "medium" \| "heavy" \| "success"` (optional)         | Haptic on emit.                                                                                       |

See [Particle effects](/editor/particles) for details.

### `custom`

A named custom action.

| Field       | Type                                                 | Notes                  |
| ----------- | ---------------------------------------------------- | ---------------------- |
| `actionKey` | string                                               | The action identifier. |
| `params`    | `Record<string, FlowExpressionOrLiteral>` (optional) | Parameters.            |

<Warning>
  `custom` actions are defined in the flow JSON but there is **no public iOS API to register a native handler** for them today (the SDK's `registerCustomAction` is internal). A `custom` action with no matching handler does nothing on device. To run your own native code in response to a component event, use a [custom component](/ios-sdk/custom-components) and wire its output instead.
</Warning>

## SDK support and editor preview

| Action                                          | Renders on device                                  | Runs in editor preview                                     |
| ----------------------------------------------- | -------------------------------------------------- | ---------------------------------------------------------- |
| `navigate`, `goNext`, `goBack`, `closeFlow`     | Yes                                                | Preview-only navigation (does not affect editor selection) |
| `setVariable`, `assign`                         | Yes                                                | Preview-only state (not saved)                             |
| `trackEvent`, `openUrl`                         | Yes                                                | No (no analytics or external open in the editor)           |
| `triggerAnimation`, `triggerParticle`, `haptic` | Yes                                                | Yes                                                        |
| `custom`                                        | Only if a native handler exists (not public today) | No                                                         |

In the editor's preview mode, only `triggerAnimation`, `triggerParticle`, and `haptic` fire; navigation and state changes run as preview-only and are never persisted. See [Preview and live mirror](/editor/preview-and-live-mirror).

## Related pages

* [Interactions and actions (editor)](/editor/interactions-and-actions)
* [Conditions and expressions](/reference/conditions-and-expressions)
