> 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/ontwinchange.md).

# On twin change

> Start a flow when a digital twin is trained or updated.

Starts a flow when a digital twin is trained or updated.

This is what keeps derived work downstream of a model honest: re-score, re-forecast or re-fill a scenario store the moment the twin behind it moves.

## At a glance

|                          |                        |
| ------------------------ | ---------------------- |
| Module type              | `OnTwinChange`         |
| Category                 | Events                 |
| Default tier             | `durable`              |
| Runs on                  | `durable`              |
| Starts a flow            | yes                    |
| Holds a body             | no                     |
| Keeps state between runs | no                     |
| Available in             | every application type |

## Parameters

### `concurrency`

`"replace" | "skip" | "queue"` · required · defaults to `"skip"`

What to do when the previous run is still going.

### `topics`

`("digitalTwin.trained" | "digitalTwin.updated")[]` · required · defaults to `["digitalTwin.trained"]`

Whether a train, an update, or both count as a change.

### `twinIds`

`string[]` · required · defaults to `[]`

The digital twins to watch.

## Inputs

*None.*

## Outputs

| Port     | Kind             | Connects to                        | Description                                                            |
| -------- | ---------------- | ---------------------------------- | ---------------------------------------------------------------------- |
| `event`  | `event`          | `event`, `json`                    | The event envelope: `{kind, at, payload}`.                             |
| `twinId` | `scalar<string>` | `scalar`, `json`, `text`, `signal` | Which twin changed.                                                    |
| `twin`   | `json`           | `json`, `scalar`, `signal`         | The twin version that resulted, resolved and ready to wire into a sim. |

***

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