# Response types

Response types define the **shape of flow output** when bound to a flow's start node.

Stored at `.fetchcatch/response-types/{slug}.json`.

## Document shape

```json
{
  "schemaVersion": 1,
  "id": "00000000-0000-0000-0000-000000000003",
  "slug": "approval-result",
  "name": "Approval result",
  "description": "Standard approve/deny payload",
  "properties": {
    "approved": { "type": "boolean", "required": true },
    "reason": { "type": "string", "required": false, "default": "" }
  }
}
```

| Field | Description |
|-------|-------------|
| `schemaVersion` | Must be `1` |
| `id` | Stable GUID |
| `slug` | Matches filename |
| `properties` | Map of field name → field definition |

## Property fields

| Field | Description |
|-------|-------------|
| `type` | `string`, `number`, `integer`, `boolean`, `object`, `array` |
| `required` | If true, must be set by a decision before `end` |
| `default` | Seeded into the response accumulator at start |

## Binding to a flow

On the start node:

```json
{
  "id": "start_1",
  "type": "start",
  "responseTypeId": "00000000-0000-0000-0000-000000000003"
}
```

Runtime behaviour:

1. Accumulator initialized from response type defaults.
2. Each `decision` node merges `responseValues`.
3. At `end`, output is validated against required fields and types.

## Editing rules

- Changing property names breaks existing `decision.responseValues` keys — update flows together.
- Apply response type **before** or **with** dependent flow changes in the same commit.
- Slug changes rename the file and require updating any hard-coded references (prefer stable slugs).
