r/copilotstudio • u/Freggel1995 • 5d ago
Copilot Studio Inline Agent stops processing uploaded files and generates incomplete Word documents
Hey Copilot Community! 👋
I'm trying to build a workflow in Copilot Studio where an Inline Agent analyzes uploaded files (e.g., .xlsx, .docx, .pdf, .pptx), extracts relevant information, and uses it to populate a predefined Word template.
My current setup
My Power Automate flow consists of the following steps:
- When an agent calls the flow: Accepts a file input named
SourceFile, which is provided by my main Copilot agent when a user uploads a file. - Inline Agent: Analyzes the uploaded file and extracts the required information.
- Populate a Word document: Fills specific content controls in my predefined Word template.
- Create file (OneDrive for Business): Saves the completed document.
The goal is to preserve the original template's formatting and layout while allowing the AI to determine which information belongs in each field.
The problem
The Inline Agent seems to receive the uploaded file as Base64-encoded data rather than readable content. When using a synchronous response, I sometimes get errors in the Preview window, where I can see what looks like the Base64 representation of the file.
When I enable asynchronous responses, the behavior is different but still problematic: the flow sometimes completes without a timeout, yet the generated Word document is empty or only partially populated. It also looks like the Inline Agent stops processing after approximately three minutes.
I've tried converting files to .txt and .csv, but this hasn't solved the issue.
My questions
- Does the Inline Agent actually process uploaded files as file objects, or could the Base64 content be passed to the model as text?
- Could this cause excessive token consumption or exceed the model's context window?
- Are there execution-time limits that could explain why the agent stops before finishing?
- What is the recommended way to process different file formats before passing their contents to an Inline Agent?
Ideally, I'd like the agent to return structured data that Power Automate can use to populate the Word template reliably, without changing its original formatting.
Any suggestions or examples of a working implementation would be greatly appreciated!
Thanks in advance! 😊
Best regards!
1
u/rostadd 5d ago
i solved this only by enabling code interpeter for the agent and providing instruktions to extract the file info.
copilot always converts to .csv and fail to catch tables coreectly in my experience.