# Classify
URL: /reference/blocks/ai-classify
Type: reference
Description: Classify content into predefined categories using AI
Keywords: classify, ai/classify, ai, block, workflow builder
`ai/classify` — Classify content into predefined categories using AI.

Where it appears [#where-it-appears]

The **Classify** block lives in the **AI** group of the Workflow Builder.

Fields [#fields]

| Field             | Type                                   | Required | Default | Description                                                                                                                                     |
| ----------------- | -------------------------------------- | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `prompt`          | text (multi-line, supports references) | Yes      | —       | Text the model should classify. Include the content to evaluate (e.g. ticket subject, customer message) using \<StepName.field> references.     |
| `categories`      | categories                             | Yes      | —       | Define the possible classification outcomes. Each category has an ID used in downstream references and a label shown in the UI.                 |
| `defaultCategory` | text                                   | No       | —       | Category ID to select when the model cannot confidently match any defined category. Leave empty to return no category on low-confidence inputs. |

Inputs and outputs [#inputs-and-outputs]

Inputs are the configurable fields above. The block produces these outputs:

**Outputs**

Reference an output downstream with `<Classify.field>`.

| Name            | Type    | Description                      |
| --------------- | ------- | -------------------------------- |
| `success`       | boolean | Whether classification succeeded |
| `category`      | string  | Selected category ID             |
| `categoryLabel` | string  | Selected category label          |
| `reasoning`     | string  | AI reasoning for the selection   |
| `error`         | string  | Error message if failed          |

Example [#example]

A minimal configuration for this block:

```json
{
  "type": "ai/classify",
  "config": {
    "prompt": "<PreviousStep.field>",
    "categories": "..."
  }
}
```

Limits and failure modes [#limits-and-failure-modes]

* Required fields (`prompt`, `categories`) must be set, or the block fails validation before it runs.
* On failure the `error` output is populated; downstream blocks that reference other outputs may not receive values.

Related [#related]

* [All workflow blocks](/reference/blocks)
* [Workflow Builder overview](/workflow-builder-overview)