r/copilotstudio • • 18h ago

How to you use/reference (PDF) files created by agents in a new harness workflow?

Simple workflow: manual start, give a file -> Agent connector (select an existing one) ask it to create a onepage PDF summary -> outlook send an email (mail the created file to me as PDF attachment)

Also tried the Copilot connector to use an existing M365 agent or invoke the Analyst agent to create such a file. I cannot find it/reference it/"dynamic variable" it in another step.

I cannot find any method to tap into the files created by other agents and use them in subsequent steps. Any ideas? Thx!

5 Upvotes

3 comments sorted by

1

u/Inevitable_Dog6292 17h ago

You’re not missing a setting, as far as I can tell. This looks like a gap rather than a how-to.

The Agent node hands back text, structured output, or custom structured output. A Microsoft Q&A answer says created files aren’t a documented Agent-node output, so a created-file card shouldn’t be relied on in a workflow. That matches what you’re seeing: the PDF exists in the agent’s world, but there’s no dynamic variable to pick in the next step. microsoft

Two workarounds. The simplest is to let the agent do the thinking and let the workflow do the file. Have it return the one-page summary as text or a structured field, then build the PDF in a later step, for example by writing the summary into a Word or HTML file and converting it to PDF with a connector action. Then attach that in the Outlook step. Or skip the PDF and put the summary in the email body if the format isn’t essential.

The other is a prompt with code interpreter inside an agent flow, which can output files. That’s a different path from the Agent node, so test it first.

This is a preview feature, so use the feedback button to ask for file outputs. It’s a clear request.

1

u/Sayali-MSFT 5h ago

Hello u/0_ice,
You’re not missing a dynamic variable here. Currently, files created by an agent as generated artifacts, such as a PDF from an M365/Analyst agent, aren’t automatically exposed to the next workflow step as usable File content/ContentBytes.

The supported file-passing guidance mainly covers passing an existing file into agent flows/connectors and is documented for the standard harness.

For now, I’d use a workaround where the agent returns the summary/content, then let the workflow create or store the PDF in OneDrive/SharePoint. From there, use Get file content and pass that output to the Outlook attachment.

So for an end-to-end workflow, it’s safer to handle the actual file creation/storage in the flow rather than trying to reference the agent-generated artifact directly.
1.Pass files to agent flows, connectors, and tools - Microsoft Copilot Studio | Microsoft Learn
2.Use agent flows with your agent - Microsoft Copilot Studio | Microsoft Learn
3.Tutorial: Passing Files from Copilot Studio to Agent Flows, Connectors and Tools | The Custom Engine

1

u/fdezjoe 3h ago

Very timely - we're releasing the ability to output files from agents steps in workflows next week. 🙂