Handle Large Task Results
When a Task Studio task returns a very large payload (for example, a big list of contacts or rows pulled from an external API), the result can exceed the maximum size a task run is allowed to return inline. When that happens the run still completes successfully, but the oversized payload can’t be returned or previewed directly, and you’ll see a message like:
This task returned too much data to display or pass along directly.
This guide shows the two ways to work around that limit by persisting the full output as a reusable asset.
Option 1: Save the result as an asset (no code changes)
The quickest fix requires no changes to the task itself — just ask the agent to re-run the task and save its result as an asset. For example:
Re-run that task and save the result as an asset.
The agent re-runs the task, stores the complete output as a tool_result
asset, and returns an asset_id instead of the raw payload. That asset_id
can then be handed to other tools — for instance, to bulk-load the rows into a
database — without the data ever being re-typed or truncated.
Saving only works on a fresh run. Once a run has already reported that its result was too large, the full payload is no longer available to save — the task has to be run again with saving enabled.
Option 2: Update the task to write an asset itself
For a task that reliably produces large outputs, the durable fix is to have the task create an asset and return a reference to it rather than returning the raw data. You can ask the agent to update the script for you, or edit it directly.
Instead of returning a large array:
…create an asset from the SDK and return its id plus a small summary:
The task now returns a compact response that always fits inline, while the full dataset lives in an asset that downstream tools and the agent can open and reuse later.
See Create Assets for the full asset-creation API and Build with Agents for how tasks and agents work together.
