> ## Documentation Index
> Fetch the complete documentation index at: https://docs.frayme.io/llms.txt
> Use this file to discover all available pages before exploring further.

# split

> Multi-way branch on a single variable. Outputs named handles that edges attach to.

`split` is the simplest router. It reads one variable and dispatches to a named handle. Each outgoing edge declares which handle it represents via `sourceHandle`.

## Configuration

```jsonc theme={null}
{
  "id": "sp-on-chain-band",
  "type": "split",
  "data": {
    "label": "Route on on-chain band",
    "splitVariable": "crystal_band",
    "branches": [
      { "id": "b-severe", "label": "Severe",        "condition": "crystal_band == 'severe'", "handleId": "severe"  },
      { "id": "b-high",   "label": "High",          "condition": "crystal_band == 'high'",   "handleId": "high"    },
      { "id": "b-medium", "label": "Medium",        "condition": "crystal_band == 'medium'", "handleId": "medium"  },
      { "id": "b-low",    "label": "Low (default)", "condition": "default",                  "handleId": "default" }
    ],
    "hasDefaultBranch": true
  }
}
```

## Branches

Each branch has:

* `id` — internal identifier.
* `label` — what shows on the canvas edge.
* `condition` — either a comparison against `splitVariable` (`"crystal_band == 'high'"`) or the literal `"default"` (catch-all).
* `handleId` — the source-handle name that edges target via `"sourceHandle": "<handleId>"`.

## Wiring edges

```jsonc theme={null}
{
  "id": "e-sp-band-high",
  "source": "sp-on-chain-band",
  "target": "ds-monitor-high",
  "sourceHandle": "high",
  "label": "High"
}
```

The edge's `sourceHandle` matches the branch's `handleId`. Without it, the engine doesn't know which path this edge represents.

## When to use split vs decisionTable

|              | split                                                | decisionTable                                    |
| ------------ | ---------------------------------------------------- | ------------------------------------------------ |
| Inputs       | One variable                                         | Two or more                                      |
| Branch count | 2–6                                                  | Often more                                       |
| Best for     | Risk band routing, channel routing, decision routing | Multi-factor routing where a table reads cleanly |
