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 / Passing Agent Response...
Copilot Studio
Answered

Passing Agent Responses to Flows

(3) ShareShare
ReportReport
Posted on by 44
Hello group!
 
I am new to this forum. I am not a developer, and that has caused me to rely too heavily on the Copilot bot to help me solve an issue I'm having. I seem to be in a *loop Copilot cannot break.
 
I created an Agent that searches my company intranet for obsolete or outdated content and returns some details I ask for; URL, owner, reasoning, etc. It works great!
I merely want to add the functionality that the results also be handed off to a Flow that will export the results into an Excel spreadsheet and email it to me as an attachment.
 
Copilot helped me create the flow, and it works - independently. It seems like it should be such a small task to get my agent to trigger my flow and pass along the payload, but I have spent far too much time troubleshooting with Copilot and my test results either provide a *JSON error in the Parse JSON node of my flow, or my flow doesn't trigger at all. This is the loop I am in.

Here is the Parse JSON node error I get from my flow prior to the last time the flow didn't trigger at all. I don't know if anyone can help me, but I am trying to look outside of the Coplilot bot for help. Thank you in advance to anyone that is willing to help!

Parse JSON node error: Action 'Parse_JSON' failed: Unable to process template language expressions in action 'Parse_JSON' inputs at line '0' and column '0': 'Required property 'content' expects a value but got null. Path ''.'.
 
I'm sure there is a lot more detail missing that needs to be provided for actionable help to be given, but I'm just waiting to see what details you need.
I have the same question (0)
  • Prasad-MSFT Profile Picture
    Microsoft Employee on at
    Why This Happens
    • The agent is not passing the results to the flow, or
    • The flow is not receiving the data in the expected format, or
    • The trigger or input variable in the flow is not set up to receive the data from the agent.
    How to Fix
    1. Ensure the Agent Passes Data to the Flow
    In Copilot Studio, when you call the flow, make sure you are passing the results (the data you want in Excel) as an input parameter to the flow.
    Example: If your agent stores results in a variable called SearchResults, pass SearchResults to the flow.
    2. Set Up the Flow Trigger Correctly
    Use the “When a Power Virtual Agents calls a flow” trigger in Power Automate.
    Add an input parameter (e.g., “results”) of type text or array, depending on your data.
    3. Parse the Input in Power Automate
    In your flow, the first step after the trigger should be to use the input parameter.
    If you’re using Parse JSON, make sure you are parsing the correct dynamic content (the input from the agent).
    To get the correct schema for Parse JSON:
    Run the flow once with sample data.
    Copy the output from the run history.
    Use it to generate the schema in the Parse JSON action.
    4. Handle Nulls
    Add a condition before Parse JSON to check if the input is not null.
    If it is null, send an error message or skip the step.
     
  • Suggested answer
    deepakmehta13a Profile Picture
    369 on at

    Hi,

    The error you're seeing usually occurs when the Parse JSON action receives a null input. In Copilot-to-Flow integrations, this typically means the agent is not passing values correctly into the flow trigger.

    Make sure you're using the "When an action is called from Copilot" trigger and have defined input parameters (like URL, owner, etc.). Then map those variables properly from your agent.

    If you're already passing structured inputs, you actually don’t need the Parse JSON action at all—you can directly use the dynamic values in your flow.

    Also, ensure both the agent and flow are published after making changes, as the flow may not trigger otherwise.

    If you still face issues, sharing your trigger configuration and how you're passing inputs from the agent would help troubleshoot further.

    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
    Admin.Nick2 Profile Picture
    43 on at
    In your flow, make sure you are returning the right value. I'd recommend to test directly in the flow. The agent hides the info you need to debug.
     
     
  • razor7tech Profile Picture
    44 on at
    Thank you all for your valuable input! I am going to utilize all of your advice and see if that helps. After I repair my agent that the Copilot bot had me break yesterday, if I still get JSON configuration errors, I am going to share my trigger configuration that's being passed from my agent with you to see if a deeper dive will help.
     
    Some forums never get responses. I really appreciate yours!
  • razor7tech Profile Picture
    44 on at
    Hello All--
     
    Well, I have learned at least two things since my last post:

    1) I am 'vibe coding'
    2) The Copilot bot that is baked into Edge browsers is not capable of solving my integration challenge - at least not within my timeframe. Even after I included your recommendations from your post replies.
     
    So, I am looking into other developer resources to help me with my hybrid design strategy as a community developer.
     
     asked me to provide my trigger configuration. Here's what I have that wasn't working with the agent as the trigger:

    The trigger for my flow (works independent of the agent) is When an agent calls the flow = Code View
     
    {
      "type": "Request",
      "kind": "Skills",
      "inputs": {
        "schema": {
          "type": "object",
          "properties": {
            "text": {
              "description": "text",
              "title": "text",
              "type": "string",
              "x-ms-content-hint": "TEXT",
              "x-ms-dynamically-added": true
            }
          },
          "required": [
            "text"
          ]
        }
      },
      "metadata": {
        "operationMetadataId": "b8f61c18-7224-4f8a-9c5f-72fbce5df764"
      }
    }

    Please let me know what more you need to help. Thank you all!
  • Suggested answer
    deepakmehta13a Profile Picture
    369 on at

    Hi,

    Thanks for sharing the trigger configuration, that makes things much clearer.

    Your trigger setup looks correct, but the key issue here is that your schema has "text" as a required field, and from the error you shared earlier, it seems the agent is not passing any value (or passing null). That’s why the flow fails before even reaching your logic.

    A couple of things you can try:

    1. Ensure the agent is actually passing a value
      In Copilot Studio, when you call the flow, make sure you are explicitly mapping a value to text. Even a simple test like passing a fixed string (for example "test") will help confirm if the trigger is working correctly.

    2. Check the structure being sent from the agent
      The flow expects:
      {
      "text": "your value"
      }

    If the agent is sending just raw text or a different structure, the trigger won’t bind it correctly, and it will be treated as null.

    1. Remove Parse JSON (if still used)
      Since you are already defining the schema in the trigger (“When an agent calls the flow”), Power Automate automatically parses the input.
      Using Parse JSON again can actually cause errors like the one you saw.

    2. Try making the field temporarily optional
      For testing, you can remove "text" from the required array in your schema. This helps confirm whether the issue is purely due to missing input.

    3. Validate end-to-end with a simple payload
      Start with a minimal setup:

    • Pass a static value from the agent

    • Use it directly in the flow (no parsing)

    Once that works, you can expand to your actual payload (URL, owner, reasoning, etc.).

    Based on what you’ve shared, this doesn’t look like a flow issue, it’s more about how the agent is passing the payload to the flow.

    If you can share how you’re mapping the flow inputs inside the agent (the action call configuration), that would help pinpoint it further.

    If you need any further assistance, feel free to @mention me and I’ll be happy to help.

    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.

  • razor7tech Profile Picture
    44 on at
     
    Thank you for showing an interest in my issue. I went back to test my flow that used to produce desired results, but in the process of using Copilot to try to help me with the payload handoff issue, I now realize my flow is broken as well. The below schema from my Parse JSON node is used in my flow that used to produce the desired results = export results to an Excel spreadsheet and email it to me.

    I built my flow in just a couple of hours, from what I recall. Now I'm wondering if it would be a better use of time to ditch my flow and start from scratch now that my agent is working again. That way I can build a new flow with the agent payload handoff integration configuration from the beginning.
     
    It's possible that part of the issue I'm having is that the flow was not configured correctly. I was jive coding with Copilot when I built it.

    Here's the schema that used to work:
     
    {
        "type": "object",
        "properties": {
            "auditName": {
                "type": "string"
            },
            "runUtc": {
                "type": "string"
            },
            "items": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "url": {
                            "type": "string"
                        },
                        "percentOutdated": {
                            "type": "number"
                        },
                        "owner": {
                            "type": "string"
                        },
                        "reason": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "name",
                        "url",
                        "percentOutdated",
                        "owner",
                        "reason"
                    ]
                }
            }
        },
        "required": [
            "auditName",
            "runUtc",
            "items"
        ]
    }

    It's a fairly basic flow, or I wouldn't suggest starting over with it.


     
    What are your thoughts?
  • Suggested answer
    Admin.Nick2 Profile Picture
    43 on at
    Most of the time, it's a variable that is not read correctly. Try to run in debug with the Test button and check the outputs. I have struggled a lot when doing similar flows. What I learned is to read the output of each node and find the correct value. The designer will let you choose from a limited set of variable but there's always more.
     
    You can copy any variable and paste them into the Expression tab, like this: @{outputs('Today')}
     
    Then clean the brackets and get the field you want, like this: outputs('Today')['field']
  • deepakmehta13a Profile Picture
    369 on at

    Hi,

    Sorry for the late response, but if this issue has not been resolved yet here is my suggestion:

    Honestly, based on what you described, starting fresh might actually be the better option, especially since:

    • The flow was built with Copilot initially

    • The schema + payload handoff is now unclear

    • And even the previously working flow is now broken

    When schema + trigger mapping gets out of sync, it can take more time to fix than rebuild.

    That said, your schema itself looks perfectly fine, the issue is likely not the structure, but how the agent is passing data into the flow.

    Here’s what I would suggest:

    1. Rebuild with a clean structure (recommended)
      Create a new flow with:

    • Trigger: When an agent calls the flow

    • Define a single input (Text or Object)

    • Pass the full payload from the agent

    Then:

    • Use Parse JSON with your schema

    • Continue with your existing logic (Excel + email)

    1. Validate payload before Parse JSON
      Before Parse JSON, add a Compose and pass the incoming input.
      Check run history to confirm:

    • The payload actually matches your schema

    • Especially that items array is present

    1. Avoid over-complicating the trigger
      Instead of multiple parameters, pass one structured payload and parse it, this is more stable with Copilot.

    2. Your schema usage
      Your schema is good
      Just ensure:

    • The agent sends data in the same format

    • Property names match exactly (case-sensitive)

    1. Why your current flow broke
      Most likely:

    • Input schema changed

    • Agent mapping changed

    • Parse JSON no longer matches actual payload

    This is very common when iterating with Copilot.

    So overall:
    Rebuilding is a good call here
    Your schema is correct
    Focus on clean payload handoff from agent → flow

    If the issue has been solved already, you can share how it has been solved and which approach you followed, so it would help other in community,

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

    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.

  • razor7tech Profile Picture
    44 on at
    Thanks again everyone! My issue has not been resolved. I started leaning towards ditching the flow that was vibe coded with Copilot, and now that I have confirmation that's not a bad idea, I am going in that direction.
     
    I do want to clean up my agent a little bit from what Copilot did to it before I start creating my new flow. I wanted to see if the below would leave my agent in a condition that would not interfere with passing its payload off to a flow. The below are my agent instructions. Nothing in here is confidential or sensitive, so I was hoping I could paste it for your review to see if you can ID anything that could potentially interfere with successfully handing off its payload to a yet to be created flow. Or, if there is anything left out that should be there. Copilot created all of this, and the bot I was vibe coding with added some of the "handoff" language - so I'm concerned it's not formatted properly for my desired results.

    I do want to add that my primary goal is a dual-purpose agent that responds to queries with results in the agent chat bubble AND triggers a flow that will handoff the agent's responses into a flow that creates an Excel spreadsheet and emails it to me. The chat response and the Excel spreadsheet should contain the same data. IF the dual-purpose is too complicated for a citizen developer like me, I will ditch the dual-purpose for just the flow running an Excel report and emailing it to me.
     
    Instructions

    # Purpose
    The purpose of this agent is to scan the company intranet, identify outdated or obsolete content, and produce a report listing the content name, URL, what percentage of content on the page is outdated or obsolete, who is listed as the page owner, and reasoning for why it should be archived.

    # General Guidelines
    - Maintain a professional and objective tone.
    - Ensure accuracy when determining outdated or obsolete content.
    - Provide clear reasoning for each recommendation.

    # Skills
    - Ability to search and retrieve intranet content.
    - Analyze metadata such as last updated date, relevance, and usage metrics.
    - Generate structured reports.

    # Step-by-Step Instructions

    ## Step 1: Gather Intranet Content
    -
    Goal: Collect all relevant pages and documents from the company intranet.
    -
    Action: Use the intranet search API or connector to retrieve a list of pages with metadata (title, URL, last modified date, author or owner, percentage deemed obsolete, and usage statistics).
    -
    Transition: Once the list is retrieved, proceed to analysis.

    ## Step 2: Analyze Content for Obsolescence
    -
    Goal: Determine which content is outdated or obsolete.
    -
    Action: Apply the following criteria:
    - Last modified date of a site page exceeds a defined threshold of 24 months.
    - Any dates listed in site page that exceeds a defined threshold of 24 months.
    - Last view of a site page exceeds a defined threshold of 12 months.
    - A page text includes the words Flash or Sandisk.
    - Low or zero usage metrics.
    - Content references outdated policies, products, or events.
    -
    Transition: Mark each item as "Current" or "Outdated" with reasoning.

    ## Step 3: Generate Report
    -
    Goal: Create a structured report summarizing findings.
    -
    Action: For each outdated item, include:
    - Name (title of the page)
    - URL
    - Percentage of text outdated
    - Owner's name
    - Reasoning (e.g., "No updates in 18 months and zero views in last 6 months.")
    -
    Transition: Compile the report into a shareable format (CSV or PDF).

    ### Output + Presentation Rules (Dual-Mode)

    The agent MUST always produce a structured array named OutdatedItems.

    OutdatedItems must be an array of objects. Each object represents one outdated or obsolete intranet page and MUST include these fields:
    - Name (title of the page)
    - URL (full URL)- PercentOutdated (number 0–100)
    - Owner (owner’s name or responsible team)
    - Reasoning (why it is outdated)
    Mode behavior:
    1) User Query Mode (human asks in chat)
    - Return results in the current human-friendly format (summary + readable list).
    - Also ensure OutdatedItems is generated internally with the required fields.

    2) Automation Mode (called by an action/flow)
    - Return ONLY the structured OutdatedItems array (no prose, no report formatting).
    - Do NOT generate CSV or PDF.
    - Do NOT send emails or post Teams messages.

    Empty results rule:
    - If no outdated content is found, return OutdatedItems = []
    - Do not omit OutdatedItems.

    Example (Automation Mode):

    OutdatedItems = [  {   

    "Name": "VPN Access Page",    "URL": "https://intranet/pages/vpn",    "PercentOutdated": 65,    "Owner": "IT Operations",    "Reasoning": "No updates in 18 months and zero views in the last 6 months."  }


    # Error Handling and Limitations
    - If intranet access fails, notify the user and retry after a short delay.
    - If metadata is incomplete, flag the item for manual review.

    # Feedback and Iteration
    - After delivering the report, ask for feedback on accuracy and usefulness.

    # Interaction Example
    - User: "Run an audit for outdated content."
    - Agent: "I have scanned 500 pages and identified 120 as outdated. Here is your report."

    # Follow-up and Closing
    - Offer to schedule regular audits (e.g., monthly or quarterly).

     

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
Vish WR Profile Picture

Vish WR 238

#1
Valantis Profile Picture

Valantis 238

#3
Romain The Low-Code Bearded Bear Profile Picture

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

Last 30 days Overall leaderboard