I’m working on an Agent Builder project and facing
a limitation with the output string length.
=== CONTEXT ===
I built an agent that:
Receives an Excel file as input
Calls Tool 1 (ReadExcelFile RPA Workflow)
→ returns Excel content as text
GPT model analyzes the content
→ generates a JSON with financial baremes
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?
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.
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:
The agent reads the Excel file via ReadExcelFile tool
GPT generates a baremes JSON (~8400 characters)
The agent calls WriteToExcel tool and passes
the full JSON as input argument (in_baremes_json)
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-…”}
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
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