Agent Builder Output String Limited to 1024 Characters - Cannot Pass Full JSON to RPA Workflow Tool

Hello,

I’m working on an Agent Builder project and facing
a limitation with the output string length.

=== CONTEXT ===
I built an agent that:

  1. Receives an Excel file as input
  2. Calls Tool 1 (ReadExcelFile RPA Workflow)
    → returns Excel content as text
  3. GPT model analyzes the content
    → generates a JSON with financial baremes
  4. Should call Tool 2 (WriteToExcel RPA Workflow)
    → writes JSON data into an Excel file

=== THE PROBLEM ===
When the agent tries to return baremes_json as output,
I get this error:

“The field Result must be a string with a maximum
length of 1024”

My JSON contains almost 8400 characters
which exceeds the 1024 character limit.

  • The WriteToExcel workflow works perfectly when
    tested manually with with a part of my JSON
  • The agent calls WriteToExcel successfully BUT
    the output baremes_json exceeds 1024 chars

my qst is there a way to increase the 1024 char limit for Agent output or is there another recommended approach for passing large data between agent tools?

@Benhamou_Hassan

I don’t think there is any size limit for output or data passing.
But there is a token limit for each model used to build the agent.

If you can share the exact error message, model your are using for your agent, we can suggest better approach.

If the error is related to token limit the you may try different agent.
Example: Default model for agent will be GPT 4o which has token limit around 16K, so can use GPT 4.5 or GPT 5 or any other model with higher token limit.

@Rohit_More
Thank you for your comment Rohit!

Actually, I don’t think the error is related to
the agent token limit.

The error is related to the RPA Workflow Tool
input/output argument limit in Agent Builder.

To explain more clearly:

  1. The agent reads the Excel file via ReadExcelFile tool
  2. GPT generates a baremes JSON (~8400 characters)
  3. The agent calls WriteToExcel tool and passes
    the full JSON as input argument (in_baremes_json)
  4. This is where the error occurs

Error received:
{“errorCode”:1,
“errorMessage”:“The field Result must be a string
with a maximum length of 1024.”,
“traceId”:“00-644d0d1648473f7a7042a49ede1dc5f6-…”}

hi, @Benhamou_Hassan

For your scenario, the recommended approach is to avoid returning the full JSON in the agent output. Instead:

  • Write the data directly inside the WriteToExcel workflow (pass structured arguments rather than a large string), or
  • Store the JSON externally (e.g., file, Storage Bucket) and pass only a reference (path/ID) between tools

In short don’t pass large payloads via agent output pass references or handle the write inside the tool.

Hi, @arjun.shiroya

thank u for your comment,

actaully that’s what I did exactly I tried to avoid any playload but I got TimeOutError .. for that I chnaged the model then I got this error AGENT_RUNTIME.TERMINATION_LLM_RAISED_ERROR - JSON formatting error: Input string ‘…’ is not a valid number.
The JSON payload sent to the WriteToExcel tool contained an invalid number format (likely due to placeholder ‘…’ or malformed numeric values). All baremes must be fully extracted and formatted with valid numbers for every parameter. Please ensure the JSON contains only valid numeric values and all rows are included, then retry.
even that I strictly give hi a critical reules in prompt to respect like those

@arjun.shiroya do u know which model is the best for a large extraction from excel? thank uu

@Benhamou_Hassan

Ideally as your case is more straight forward instead of adding read excel and write to excel as tools

you can create an rpa flow that reads then calls and agent to analyze(or even a Gen AI activity would do here) and then get the output and write to excel in same flow

this would simplify and also no issues would be present

cheers

Agree with @Anil_G

Could you please let us know the reason you have to use Agent/GPT model to read write Data from an excel, and not a RPA workflow?

Regards,
Bishwajeet