Search⌘ K
AI Features

Max Output Tokens: Preventing Runaway Responses and Keeping Runs

Understand how to manage max output tokens in AI workflows to prevent runaway responses and truncated outputs. Learn to set output limits tailored to each step, detect truncation reliably, and maintain predictable, bounded responses in support processes.

A support workflow produces different types of output at each step. A triage step should return a compact JSON object with a few fields, while a draft reply may need several paragraphs for the greeting, explanation, and next steps. Using one global output limit for both steps can either over-allocate tokens to triage or truncate the draft reply.

Max output tokens sets a hard cap on how much text a single run can generate, regardless of how open-ended the prompt is. That cap makes latency and spend more predictable because generation stops when the cap is reached, but it also creates a controllable failure mode when the cap is ...