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

# routing

> A single dynamic-routing entry: an optional condition (`if`) plus exactly one routing action. Attached to a step or test handler (`onPass`, `onFail`, `onWarning`, `onSkip`). For step-level handlers, `continue`, `stop`, `retry`, and `goToStep` are evaluated at runtime; `goToTest` is validated but not yet executed (deferred at step scope). For test-level handlers, `continue`, `stop`, and `goToTest` are evaluated at runtime (test scope; `goToTest` jumps to a test within the spec), while `retry` and `goToStep` are not applicable at test scope.

A single dynamic-routing entry: an optional condition (`if`) plus exactly one routing action. Attached to a step or test handler (`onPass`, `onFail`, `onWarning`, `onSkip`). For step-level handlers, `continue`, `stop`, `retry`, and `goToStep` are evaluated at runtime; `goToTest` is validated but not yet executed (deferred at step scope). For test-level handlers, `continue`, `stop`, and `goToTest` are evaluated at runtime (test scope; `goToTest` jumps to a test within the spec), while `retry` and `goToStep` are not applicable at test scope.

## Referenced In

* [Common](/reference/schemas/common)
* [test](/reference/schemas/test)

## Fields

| Field    | Type                                      | Description                                                                                             | Default |
| :------- | :---------------------------------------- | :------------------------------------------------------------------------------------------------------ | :------ |
| if       | one of: - string - array of string        | Optional. A condition expression, or an array of expressions combined with logical AND.                 | —       |
| continue | `true`                                    | Optional. Continue execution with the next step. Use to explicitly suppress a default handler behavior. | —       |
| stop     | string                                    | Optional. Stop execution at the given scope. Accepted values: `test`, `spec`, `run`                     | —       |
| retry    | object([Retry](/reference/schemas/retry)) | Optional. Retry the current step.                                                                       | —       |
| goToStep | string                                    | Optional. Identifier of the step to jump to. Minimum length: 1. Pattern: `\S`                           | —       |
| goToTest | string                                    | Optional. Identifier of the test to jump to. Minimum length: 1. Pattern: `\S`                           | —       |

## Examples

```json
{
  "continue": true
}
```

```json
{
  "stop": "test"
}
```

```json
{
  "if": "$$platform == windows",
  "goToTest": "cleanup"
}
```

```json
{
  "if": [
    "$$platform == linux",
    "$$outputs.exitCode == 0"
  ],
  "goToStep": "verify"
}
```

```json
{
  "retry": {
    "limit": 3,
    "delay": 1000,
    "backoff": "exponential"
  }
}
```

```json
{
  "retry": {
    "limit": 1
  }
}
```