# Generate Text
URL: /reference/blocks/ai-generate-text
Type: reference
Description: Generate text using AI models
Keywords: generate text, ai/generate-text, ai, block, workflow builder
`ai/generate-text` — Generate text using AI models.

Where it appears [#where-it-appears]

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

Fields [#fields]

| Field          | Type                                   | Required | Default | Description                                                                                                                                                                                                                                                    |
| -------------- | -------------------------------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `format`       | select                                 | No       | `text`  | Use 'Structured JSON' when you need fields the model must populate. For pick-from-list cases, use the Classify block instead. Options: `text`, `object`.                                                                                                       |
| `system`       | text (multi-line, supports references) | No       | —       | Who the model is and what rules always apply. Cached across runs by the model provider. The per-run task and data belong in 'Prompt'.                                                                                                                          |
| `prompt`       | text (multi-line, supports references) | Yes      | —       | The task and data for this execution. Per-run context belongs here (not in the system prompt). Use \<StepName.field> to inject upstream values.                                                                                                                |
| `outputPreset` | select                                 | No       | `none`  | Apply a canonical output contract for a downstream channel. Injects a system prompt prefix and cleans the model output (e.g. strips stray code fences). Options: `none`, `zendesk-comment`.                                                                    |
| `files`        | text (multi-line, supports references) | No       | —       | File URLs or an upstream attachment collection for AI analysis. Pass \<Get Ticket Context.context.attachments> to analyze Zendesk attachments; secure downloads are authenticated automatically. Supports images, audio, PDFs, Word documents, and text files. |
| `schema`       | JSON schema                            | No       | —       | Define the fields the model should populate. Add properties manually, paste an example, or import a JSON file.                                                                                                                                                 |
| `tools`        | dynamic-checkbox-list                  | No       | —       | Tools this step may call — knowledge search, managed APIs, and custom tool packs configured for your org. None are available unless selected.                                                                                                                  |

Inputs and outputs [#inputs-and-outputs]

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

**Outputs**

Reference an output downstream with `<Generate Text.field>`.

| Name      | Type    | Description                           |
| --------- | ------- | ------------------------------------- |
| `success` | boolean | Whether generation succeeded          |
| `text`    | string  | Generated text (for text format)      |
| `object`  | json    | Generated object (for object format)  |
| `enum`    | string  | Selected enum value (for enum format) |
| `error`   | string  | Error message if failed               |

Example [#example]

A minimal configuration for this block:

```json
{
  "type": "ai/generate-text",
  "config": {
    "format": "text",
    "prompt": "<PreviousStep.field>",
    "outputPreset": "none"
  }
}
```

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

* Required field (`prompt`) 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)