> This page is for version v8.3.0 (default).
> For other versions, use one of these documentation indexes:
> - v8.3.0 (default): https://docs.workflows.com/v-8-3-0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.workflows.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.workflows.com/_mcp/server.

# Simulations Resource

> Run and manage simulations.

# Simulations

Simulations allow you to interact with a Mind.

## Run a Simulation

Send a scenario to a mind and receive a response.

```typescript
const result = await mindsim.simulations.run({
  mindId: "mind-id-uuid",
  scenario: {
    message: "A client is asking for a refund outside of the policy window. How do you respond?"
  },
  runInBackground: false
});
```

### Parameters

| Parameter          | Type      | Required | Description                                                               |
| :----------------- | :-------- | :------- | :------------------------------------------------------------------------ |
| `mindId`           | `string`  | Yes      | The ID of the mind to simulate.                                           |
| `scenario.message` | `string`  | Yes      | The prompt, question, or context for the simulation.                      |
| `runInBackground`  | `boolean` | No       | If `true`, returns immediately with a queued status. Defaults to `false`. |

### Response

```json
{
  "message": "I would empathize with the client but firmly explain the policy..."
}
```

---

## Get Simulation Details

Retrieve the full transcript and metadata of a past simulation.

```typescript
const details = await mindsim.simulations.get("simulation-id-uuid");
```

### Parameters

| Parameter      | Type     | Required | Description                 |
| :------------- | :------- | :------- | :-------------------------- |
| `simulationId` | `string` | Yes      | The UUID of the simulation. |

### Response

Returns a `GetSimulationResponse` object containing the simulation metadata and the message history.

```json
{
  "simulation": {
    "id": "123e4567...",
    "title": "Simulation with Sarah",
    "createdAt": "2023-11-16T10:00:00Z"
  },
  "messages": [
    {
      "id": "msg-1",
      "role": "user",
      "content": { "text": "What is the plan?" },
      "createdAt": "2023-11-16T10:00:01Z"
    },
    {
      "id": "msg-2",
      "role": "assistant",
      "content": { "text": "We stay hidden." },
      "createdAt": "2023-11-16T10:00:05Z"
    }
  ]
}
```

---

## List Simulations

Retrieve a paginated list of past simulations.

```typescript
const history = await mindsim.simulations.list({
  limit: 20,
  offset: 0
});
```

### Parameters

| Parameter | Type     | Required | Description                      |
| :-------- | :------- | :------- | :------------------------------- |
| `limit`   | `number` | No       | Max number of records to return. |
| `offset`  | `number` | No       | Number of records to skip.       |

### Response

```json
{
  "count": 50,
  "simulations": [
    {
      "id": "123e4567...",
      "title": "Strategy Meeting",
      "userId": "961b1800..."
    }
  ]
}
```

---

## Delete Simulation

Remove a simulation from history.

```typescript
await mindsim.simulations.delete("simulation-id-uuid");
```

### Parameters

| Parameter      | Type     | Required | Description                           |
| :------------- | :------- | :------- | :------------------------------------ |
| `simulationId` | `string` | Yes      | The UUID of the simulation to delete. |

### Response

```json
{
  "message": "Simulation deleted successfully",
  "simulationId": "123e4567..."
}
```