There is currently no documented supported mechanism for an unattended workflow Agent node to transfer a file created in its code workspace into an agent-flow File input; move file creation and persistence into a workflow/connector operation that owns the bytes rather than asking the model to supply contentBytes.
Current supported boundary
The documented file-to-tool contract applies to user-attached conversation files. The tool input must be populated with a Custom value referencing System.Activity.Attachments; Microsoft explicitly says file inputs do not work through Dynamically fill with AI.^1^
If(
IsEmpty(System.Activity.Attachments),
[],
[{
contentBytes: First(System.Activity.Attachments).Content,
name: First(System.Activity.Attachments).Name
}]
)
That contract does not document any equivalent variable for files generated inside an unattended Agent-node workspace. Consequently:
- A workspace path such as
file:///app/workspace/report.docx is not documented as a valid Copilot Studio agent-flow file value.
- The model should not place a complete base64 document in tool arguments.
- The test-chat result does not establish that the same attachment bridge exists in an unattended workflow invocation.
- The reported base64 validation error is consistent with the connector receiving a path string where it requires actual base64 content, but Microsoft documentation does not explicitly document that exact error or those workspace directories.
The path-to-base64 substitution documented for Copilot Cowork plugins is specific to the Cowork workspace. Cowork recognizes contentEncoding: base64, resolves workspace paths, and replaces them with bytes before invoking the server.^2^ It should not be treated as an available Copilot Studio Agent-node feature.
Recommended architecture
Keep the Agent node responsible for reasoning and return only the information needed to build the document:
- Have the agent return structured document data, such as the filename, sections, tables, and destination folder.
- After the Agent node, use a deterministic workflow action, connector, custom API, or flow to generate the DOCX.
- Let that same component create the SharePoint file while it still owns the binary content.
- Return the SharePoint item ID or URL to subsequent workflow steps.
For a new inline agent, the Agent node supports text, predefined structured output, and custom JSON-schema output. For an existing published agent, its response is exposed to later workflow steps. The documented output types do not include a file or binary output.^3^
If changing the generator is possible, another practical design is for the Python service or custom API to upload the DOCX directly to SharePoint and return only metadata to the agent. This avoids crossing the model/tool boundary with binary data.
Can the Agent node return created files?
Not as a documented Agent-node output. The available downstream outputs are:
- a text response; or
- fields from structured/custom structured output.^3^
The separate Files the agent creates preview feature surfaces files as downloadable cards in conversational experiences and stores them with the conversation. It documents a 10-MB per-file limit and 28-day conversation retention.^4^ It does not document exposing those files as Agent-node dynamic content, contentBytes, or a workflow file token. Therefore, a created-file card should not currently be relied upon as workflow output.
Roadmap status
No published item in the supplied Microsoft roadmap information explicitly commits to either:
- generated-workspace-file to tool-file handoff in unattended Agent-node runs; or
- binary/created-file output from an Agent node.
Microsoft directs customers to the Microsoft 365 Roadmap for released and upcoming Copilot Studio capabilities, but an explicit commitment or delivery date is not documented.^5^
For a production blocker, open a Microsoft support case and include:
- environment and workflow IDs;
- failed run ID, UTC timestamp, and conversation/run correlation ID;
- Agent-node configuration showing An existing agent;
- the agent-flow input schema;
- the exact generated tool arguments with document content removed;
- confirmation that interactive test chat succeeds but unattended execution fails.
Ask support to confirm whether generated-file attachment materialization is supported for existing-agent workflow invocations and whether a private roadmap item exists; no public documentation currently confirms either capability.
References
- Pass files to agent flows, connectors, and tools
- Build plugins for Copilot Cowork
- Add an agent node to a workflow - Microsoft Copilot Studio | Microsoft ...
- Files the agent creates (GitHub Copilot) (preview)
- What's new in Copilot Studio - Microsoft Copilot Studio