web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Copilot Agent Not Read...
Copilot Studio
Suggested Answer

Copilot Agent Not Reading Attachments Sent via Direct Line API

(1) ShareShare
ReportReport
Posted on by 14

Hello Everyone,

I have been testing an approach to send prompts and attachments to an agent using REST APIs via Postman, and I wanted to share my observations to see if anyone else has experienced the same behavior.

We are sending JSON payloads that include the prompt along with attachment binaries (Base64 encoded). The API endpoint being used is:

https://directline.botframework.com/v3/directline/conversations

After testing multiple payload structures and scenarios, we noticed that the APIs work correctly when sending simple prompts. However, when attachments are included in the payload, the agent does not seem to process them correctly.

Scenarios tested and observed outcomes:

Simple agent with one tool to retrieve an account record
Working as expected.

Agent to read a document and update values in Dataverse
Returns a response stating that the attachment was not provided, even though the attachment is included in the payload.

Agent to read a document without updating Dataverse
Returns generated/made-up values and presents them as if they were read from the document.

Additional observations:

• Attachments are passed in the payload as Base64-encoded content.
• The same behavior occurs when calling the API directly via Postman and when triggering the agent through Cloud Flow.
• The issue only appears when attachments are involved. Prompt-only scenarios work correctly.
• We also tried a few other payload structures and combinations, but they only work when attachments are not included in the request.

Has anyone successfully processed document attachments through the Direct Line API with an agent?
If there are any specific requirements, recommended payload formats, or configuration steps for handling attachments in document-processing scenarios, I would really appreciate any guidance.

Thank you!

I have the same question (0)
  • Nivedipa-MSFT Profile Picture
    Microsoft Employee on at

    Hello  - Base64-encoded attachments in the Direct Line JSON payload are not supported for agent document processing. The agent framework interprets the content field as structured content, such as Adaptive Cards, rather than binary file data. As a result, the agent may ignore the attachment or misinterpret its values.

    How to Resolve

    Option 1 — Use the multipart upload endpoint:

    POST https://directline.botframework.com/v3/directline/conversations/{conversationId}/upload
    Content-Type: multipart/form-data

     

    Attach the file as a form part along with the activity JSON.

    Option 2 — Use contentUrl instead of Base64:

    {
      "type": "message",
      "from": { "id": "user1" },
      "text": "Read this document",
      "attachments": [{
        "contentType": "application/pdf",
        "contentUrl": "https://storage.blob.core.windows.net/docs/file.pdf",
        "name": "file.pdf"
      }]
    }

    Store the file in Azure Blob Storage or SharePoint, and provide a publicly accessible or SAS-token URL.

    For Cloud Flow: First upload the file to SharePoint or Blob Storage, then use the generated URL as the contentUrl in your Direct Line request.

  • AS-11030538-0 Profile Picture
    14 on at

    Thanks for your reply.

    I tried the approach you suggested, and it works well. The system is able to read the document from the URL and extract the required information.

    However, we are now facing a different issue. After several attempts, we noticed that when we use document extraction together with the Dataverse tool to save the summary in Dataverse, we receive the following error:

    Sorry, something unexpected happened. We’re looking into it.
    Error code: SystemError
    Conversation ID: C3nRnbJB0tGA3XkMCECVy4-in
    Time (UTC): 3/13/2026 8:55:42 AM

    We also tested a few other scenarios:

    • If we use the Dataverse tool without an attachment, it works correctly.

    • If we use the attachment without the tool, it also works fine.

    The issue only occurs when we try to use both together.

    Could you please confirm whether this combination is supported, or if there is any configuration we might be missing?

  • Suggested answer
    Valantis Profile Picture
    5,202 on at
    • The file delivery is fine now (contentUrl/upload). The failure occurs when the agent passes the extracted content into the Dataverse step. Large or verbose payloads and longer-running flows commonly trigger a generic SystemError/timeout.

     

    • Keep the write payload small

     

    • Summarize/truncate the extracted text and pass only what you persist (e.g., title, key fields, short summary). Store the full document in SharePoint/Blob and save only the URL in Dataverse.
    • Write to Dataverse
      • If you use a Power Automate flow: make sure it returns within platform limits and only returns minimal outputs to the agent. Check the flow run history for failures/timeouts; fix and republish.
      • If you use a Dataverse connector step: pass only required columns and avoid large text blobs in a single turn.
    • Validate
      • Test with a tiny constant string (e.g., “hello”) into the Dataverse step after extraction. If it succeeds, gradually increase the summary length until you find a safe ceiling, then keep the summarizer below it.
      • Recheck connection references (Dataverse/Flow), re‑authenticate if prompted, republish the agent, and retry.

    Quick checks

    • If you see SystemError again, reduce the text passed between actions or split the operation across turns (save URL + short summary now, add details later).
    • Always keep Direct Line activities small; use URLs/attachments for large content.

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

  • AS-11030538-0 Profile Picture
    14 on at

    Hi @Valantis


    Thank you for the detailed suggestions.


    Following your guidance, we performed additional testing today focusing specifically on the Direct Line API scenario using Postman.


    To eliminate the possibility of large payloads causing the issue, we modified our setup for testing purposes:

    • In the Dataverse update tool, we hardcoded the Row ID of an existing record.
    • Instead of passing any dynamic content, we used a simple hardcoded string value ("Hello") for the field being updated.
    The goal was to verify whether the Dataverse update step would succeed when the payload size is minimal.

    Test Flow
    The request was executed through Direct Line API via Postman using the following flow:
    • Send a message to the agent via Direct Line with a PDF attachment using contentUrl
    • The agent processes the attachment
    • The agent then executes the Dataverse update tool
    The Dataverse update uses:
    • Hardcoded Row ID
    • Hardcoded value ("Hello")
    This ensures that no dynamic content is passed to Dataverse, keeping the payload extremely small.

    Result
    Despite using a minimal payload, the request still fails when both steps occur in the same execution.

    The Direct Line response returns the following error:

    Sorry, something unexpected happened. We’re looking into it.
    Error code: SystemError

    The trace activity returned by Direct Line also shows:
    "valueType": "ErrorCode",
    "value": {
      "ErrorCode": "SystemError"
    }

    Observation
    From today's testing through Direct Line API, we observed:
    • Attachment processing works correctly
    • Dataverse tool execution works correctly when tested independently
    • However, when attachment processing and Dataverse execution are triggered together in the same Direct Line interaction, the request fails with SystemError

    Since the Dataverse payload in this test was only a small constant string, it appears the issue may not be related to payload size.
    Could you please confirm whether there are any known limitations or configuration requirements when combining attachment processing with Dataverse operations in the same Direct Line request?


    Thank you again for your guidance.

  • Suggested answer
    Valantis Profile Picture
    5,202 on at

    Thanks for testing.

    Based on the latest results, this does not look like a payload-size issue anymore. Since the attachment is processed correctly on its own, and the Dataverse update also works correctly on its own, the failure seems to happen specifically when both are executed together in the same Direct Line interaction.

    From the Microsoft documentation I could find, I’m not able to confirm a supported pattern where a Copilot Studio agent processes an uploaded attachment and then performs a Dataverse update in the same Direct Line turn.

    Microsoft documents file handling by capturing the attachment from System.Activity.Attachments and passing it into a flow/tool, which suggests the safer design is to handle the file processing and Dataverse update inside that flow/tool, then return only a small success/failure result back to the agent.

    There is also a current Microsoft-documented limitation around attachments in Copilot Studio channels, including Direct Line, unless the message is sent to a supported skill. Because of that, this may be a channel/orchestration limitation rather than a configuration issue in your payload.

    My recommendation is:

    • keep the current attachment upload approach

    • move the document processing + Dataverse update into the flow/tool itself

    • return only a minimal response to the agent

    • if this same pattern is required in a single Direct Line interaction, raise a Microsoft support case with the repro details and trace IDs, as this now looks more like a platform limitation than a payload problem

    here also few links to check if you havent already: 

     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 671

#2
Vish WR Profile Picture

Vish WR 266

#3
Haque Profile Picture

Haque 265

Last 30 days Overall leaderboard