Loading

Agentforce : Action Input Parameter and LLM Output Truncation in Agentforce

Udgivelsesdato: Jan 20, 2026
Beskrivelse

Customers may encounter situations where Agentforce-generated content appears incomplete or cut off. Common examples include partially generated email bodies, truncated action responses, or agent replies ending abruptly.These issues are typically caused by system-enforced size limits applied during Large Language Model (LLM) processing. Truncation can occur at multiple stages of the agent execution flow, depending on the size of the data being generated or returned. Understanding where truncation occurs and the applicable limits helps ensure more reliable agent behavior and better end-user experiences.

Løsning

Where Truncation Can Occur

Truncation may occur in one or more of the following areas during agent execution:

  1. Action Input Parameters
    When the LLM generates a large input for an action—such as a long email body or extensive structured text—the content may be cut off if it exceeds the completion token limit.

  2. Action Outputs
    If an invoked action returns a large payload (for example, a query with many records or verbose text fields), the result may be truncated before being passed back to the LLM.

  3. Agent Responses
    When the agent attempts to return a long response directly to the user, generation stops once the token limit is reached.

System Limits That Apply

ComponentLimitWhat This Means
LLM response generation (including action inputs)~2048 tokensThe agent can only generate content up to this size in a single response or action input
Action results returned to the LLM~65,000 charactersIf an action returns more than this limit, only the first 65,000 characters are retained

 


Action Output Size and Truncation Behavior

Output SizeTruncation?Impact
Less than 65,000 charactersNoThe full action output is passed to the LLM
65,000 characters or moreYesThe output is truncated to the first 65,000 characters; the LLM only processes this portion

Important:
When truncation occurs, the LLM has no visibility into the discarded content. Any reasoning, summarization, or follow-up actions are based solely on the retained portion of the data.


Impact of HTML Formatting on Token Limits

Agent output generation is subject to a completion limit of approximately 2048 tokens. Once this limit is reached, the model stops generating further output, resulting in truncated responses.

Using HTML formatting—particularly <table> tags—can significantly accelerate reaching this limit. HTML tables introduce substantial token overhead due to repetitive opening and closing tags, nested markup, and structural elements. As a result, even moderately sized datasets may cause truncation when rendered using HTML tables.

Recommendations for HTML Table Outputs

If HTML table formatting is required, use one or more of the following approaches to reduce the likelihood of truncation:

  • Limit the number of records returned per request
    Constrain the dataset at the source so the generated output remains within token limits.

  • Explicitly constrain output size in the user request
    Examples:
    “Output the first 10 records and their key fields in a table format using <table> tags.”
    “Output the first 20 records and selected fields in a table format using <table> tags.”

  • Use non-HTML table formatting when possible
    Avoid explicitly requesting <table> tags and instead use a simpler instruction such as:
    “Output the key fields in a table format.”

Best Practices to Avoid Truncation

  • Keep action inputs concise and avoid large free-text generation where possible
  • Filter, paginate, or summarize large action results instead of returning full datasets
  • Design prompts to extract key information rather than full raw content
  • Use multi-step flows for large data processing instead of a single response
Vidensartikelnummer

005298756

 
Indlæser
Salesforce Help | Article