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 Studio Agent q...
Copilot Studio
Answered

Copilot Studio Agent query when using Power Automate Flow

(1) ShareShare
ReportReport
Posted on by 6
Hi everyone,
I am building an automation where a user uploads a PDF to a Copilot Studio Agent. This triggers a Power Automate flow that:
Extracts the report date using AI Builder.
Checks a SharePoint list to see if a report for that date has already been processed.
The Requirement:
If the report date already exists in SharePoint, I need the flow to stop immediately and the Agent to tell the user: "This report has already been processed."
The Challenge:
I am struggling with the best way to "Send a message" back to the chat from inside a specific branch of the flow.
Multiple Respond Actions: I tried adding a 'Respond to the agent' action inside the 'True' (Duplicate Found) branch, but I keep getting Schema Errors because I also have a 'Respond' action at the end of the success path.
Terminate Action: If I use a 'Terminate' action to stop the flow, the Agent often shows a generic system error instead of my custom "Duplicate Found" message.

My Questions:
  • What is the standard practice for sending a "Short-circuit" or "Validation Error" message from a Flow to a Copilot Agent?
  • Do I need to use a specific Variable strategy to pass a StatusMessage back to the Agent?
  • How can I ensure the Agent speaks the error message before the flow completes or terminates?
  • Any guidance on how to properly map these validation messages back to the chatbot interface would be a huge help!
I have the same question (0)
  • Suggested answer
    Arild Aarnes Profile Picture
    565 Super User 2026 Season 1 on at
     
    I think I would just set a variable in the flow inside the different branches, and then just return that value using the one "Respond to the agent" action.

    But it would be helpful to see a screenshot of your flow.

    Regards,
    Arild
  • Verified answer
    deepakmehta13a Profile Picture
    369 on at

    Hi @CU23030920-0,

    I have faced similar things while working with Copilot Studio, I used Variable for the Workaround, I will try to answer your questions based on my knowledge:

    1. The recommended approach is to handle all outcomes inside the flow but return a single response at the end.
      Instead of exiting early, you capture the result (e.g., duplicate found) and return it through one Respond to the agent action.

    2. Yes, this is the most reliable approach.
      You can use a variable like StatusMessage or IsDuplicate:

    • If duplicate found → set StatusMessage = “This report has already been processed.”

    • Else → set StatusMessage = “Report processed successfully.”

    This keeps your logic clean and avoids schema issues.

    1. Do not use Terminate or multiple Respond actions.
      Instead:

    • Let the flow complete normally

    • Use conditions, Like in True just Set the variable and in else perform full operations and then set the Variables.

    • Return the message via a single Respond to the agent action

    In Copilot Studio:

    • Map the returned output

    • Add a Message node after the flow/tool to display it

    1. In your flow:

    • Define a clear output schema (e.g., StatusMessage as string)

    In Copilot Studio:

    • Call the flow

    • Use the returned field (StatusMessage)

    • Display it using a message node

    So the pattern becomes:

    Agent → Call Flow → Flow sets result → Respond (once) → Agent displays message

    If you need more Assistance in this, or still facing some issues you can mention me and ask again, If you solve the issue with any other thing try to give solution here also, so that we can also get knowledge of how you have find the Workaround.

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Hope this helps.

    If this helps resolve your issue, please consider marking the response as Verified so it can help others facing a similar scenario.

    If you found this helpful, you can also click “Yes” on “Was this reply helpful?” or give it a Like.

  • Suggested answer
    RichAI Profile Picture
    26 on at
     
    You cannot use multiple “Respond to Copilot” actions inside a single flow because Copilot Studio only accepts one response per execution. Create a Copilot Topic for file upload with a flow Trigger which accepts a file as input. Get the content-type and content of file and use it in AI Builder OCR. Extract full Text and extract date. You can use SharePoint Get Items for duplicate check. Use Scope for duplicate check, set message and Terminate if condition succeeds. Else continue with the process and respond to Copilot with a single output. The best way to return a validation or “short‑circuit” message from Power Automate to a Copilot Studio Agent is to use a single response pattern. Below is a screenshot of the scope part where I perform the duplicate checks.
     
     
     
    Hope this helps!
  • CU18031236-0 Profile Picture
    17 on at
     
    Hi Everyone , 

    Thanks for your valuable reponse and It was really helpful

    I have successfully implemented the "Variable Strategy" (initializing a StatusMessage variable and setting it in different branches) to avoid schema errors when responding to the agent. This works great!
     

    The Scenario:
    My flow checks a SharePoint list to see if a report for a specific date has already been processed.

    • If True (Duplicate Found): I set the variable to "This report has already been processed."
    • If False (New Report): I perform AI extraction, update SharePoint, and send a summary email via Outlook

    The Issue:
    Currently, my  action is at the bottom of the flow. Even when the condition is  (Duplicate Found) and the variable is set to the error message, the flow continues to the bottom and sends the email anyway.
     

    The Constraint:
    I want to stop the flow from sending the email in the  branch, but I . Every time I use 'Terminate', the Copilot Agent throws a generic SystemError or BadGateway error because it breaks the response contract before the 'Respond to the agent' action is reached.

    My Question:
    What is the best architectural approach to ensure the email is  sent during the "False" path, while still allowing the flow to reach the final 'Respond to the agent' action at the absolute bottom so the bot can display the status message?

     

    Should I be moving all "Work" actions into the False branch , or is there a "Skip" logic or "Go to End" pattern recommended for Agent-led flows?

    Thanks in advance for your guidance!


     

    Screenshot 2026-03-25 152839.png
  • Suggested answer
    frago Profile Picture
    226 on at
    A flow triggered by a Copilot must always reach exactly one “Respond to the agent” action.
    If you use Terminate or stop the flow early, Copilot throws SystemError / BadGateway.
    The right solution (and yes, it’s simple)
    Move all “work” actions into the False branch.
    That means:
    True (duplicate found)
    → only set StatusMessage
    → do nothing else
    False (new report)
    → AI extraction
    → update SharePoint
    → send the email
    → set StatusMessage
    At the very bottom:
    → one single “Respond to the agent”
    The flow always finishes cleanly, but the email is sent only when it should be.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 302

#2
Vish WR Profile Picture

Vish WR 240

#3
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 223 Super User 2026 Season 1

Last 30 days Overall leaderboard