> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/more-details/applications/application-modules/interventionsim.md).

# Intervention

> Simulate the effect of interventions on a Digital Twin.

Asks a digital twin what happens if you change something: set a lever, hold the rest, read the effect.

The scenario may be saved on the module or arrive per run on the `scenario` port, in which case the two are merged with the run's values winning. Wiring `entities` scopes one run to many environments at once, one row each, with `settings.entityColumns` naming which columns carry what.

## At a glance

|                          |                        |
| ------------------------ | ---------------------- |
| Module type              | `InterventionSim`      |
| Category                 | Intelligence           |
| Default tier             | `reactive`             |
| Runs on                  | `reactive`, `durable`  |
| Starts a flow            | no                     |
| Holds a body             | no                     |
| Keeps state between runs | no                     |
| Available in             | every application type |

## Parameters

### `digitalTwinId`

`string` · required · defaults to `""`

The twin to run against.

### `digitalTwinName`

`string` · optional

Its name when it was chosen, for the node's label.

### `digitalTwinVersionIds`

`string[]` · optional

Pin the run to specific twin versions; empty means the latest.

### `scenario`

`Record<string, unknown>` · optional

The saved scenario. Anything arriving on the `scenario` port is merged over this.

### `scenarioDraft`

`Record<string, unknown>` · optional

What the inspector is editing, before it is applied to `scenario`.

### `scenarioValidationErrors`

`string[]` · optional

What was wrong with the draft the last time it was checked.

### `entityColumns`

`object` · optional · defaults to `{"id":null,"target":null,"constraints":null,"levers":null}`

Which columns of the `entities` frame carry what: `id` the environment id, and `target`, `constraints` and `levers` the optional per-row overrides. Any may be null.

## Inputs

| Port       | Kind        | Required | Description                                                                                                                           |
| ---------- | ----------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `on`       | `event`     | no       | Implicit on every module that does not itself start a flow: wire an event here to make this module the start of what that event runs. |
| `scenario` | `json`      | no       | Per-run overrides, merged over the saved scenario.                                                                                    |
| `entities` | `dataframe` | no       | One row per environment to run for; `entityColumns` maps its columns.                                                                 |
| `baseline` | `dataframe` | no       | Rows to intervene on; unconnected, the twin's own baseline is used.                                                                   |

## Outputs

| Port         | Kind        | Connects to                | Description                                                                                                                                                                        |
| ------------ | ----------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `results`    | `dataframe` | `dataframe`, `signal`      | One row per version, environment and **metric**: `baseline`, `intervention`, `delta`, `delta_pct`, plus `higher_is_better` when the scenario declared a direction.                 |
| `timeseries` | `dataframe` | `dataframe`, `signal`      | Baseline against intervention over the horizon, one row per version, environment, variable and step. Only a temporal twin has it, and the cross-environment aggregate is left out. |
| `summary`    | `json`      | `json`, `scalar`, `signal` | The run's identity, not its findings: `{runId, status, outputs}`, where `outputs` is the simulator's raw per-version result. The numbers a reader wants are in `results`.          |

***

[← All application modules](/more-details/applications/application-modules.md)
