> ## 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.

# output

> Terminal nodes. Each defines a named end state and the decision schema written to the audit record.

`output` nodes mark the end of a path through a workflow. A workflow can have many — typically one per resolution class (`APPROVED`, `IN_REVIEW`, `REJECTED`, `REPORTED_TO_REGULATOR`, …).

## Configuration

```jsonc theme={null}
{
  "id": "out-approved",
  "type": "output",
  "data": {
    "label": "APPROVED",
    "returnAllFields": false,
    "description": "Happy-path terminal state. Client is notified asynchronously.",
    "schema": [
      { "name": "case_id",          "type": "string",  "required": true, "nullable": false },
      { "name": "decision",         "type": "string",  "required": true, "nullable": false },
      { "name": "risk_score",       "type": "integer", "required": true, "nullable": false },
      { "name": "risk_band",        "type": "string",  "required": true, "nullable": false }
    ]
  }
}
```

| Field             | Notes                                                                                                             |
| ----------------- | ----------------------------------------------------------------------------------------------------------------- |
| `label`           | Human-readable terminal name. Surfaced in the queue and audit log.                                                |
| `returnAllFields` | If `true`, the entire run context is persisted with the decision. If `false`, only fields declared in `schema`.   |
| `schema`          | Explicit list of fields to extract from the context into the decision record. Same type system as `input.schema`. |
| `description`     | What this terminal means in business terms.                                                                       |

## When to use `returnAllFields: true`

* **Sub-flows** that pass their entire output downstream.
* **Audit-heavy terminals** that benefit from the full evidence pack on the decision (KYB approvals, regulator submissions).

Otherwise prefer an explicit `schema` — the decision record stays compact and the audit export bundles read better.

## Common terminal labels

| Workflow type              | Typical terminals                                         |
| -------------------------- | --------------------------------------------------------- |
| Onboarding (KYC / KYB)     | `APPROVED`, `IN_REVIEW`, `REJECTED`, `PENDING_DOCS`       |
| Transaction monitoring     | `APPROVED`, `BLOCKED`, `REPORTED_TO_REGULATOR`            |
| Lifecycle webhook consumer | `case_updated`                                            |
| Sub-flow                   | Single named outcome (`link_delivered`, `case_closed`, …) |
