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 / How to pass variable f...
Copilot Studio
Answered

How to pass variable from Parent agent to its connected Agent ?

(2) ShareShare
ReportReport
Posted on by 294
Hi guys,
 
When creating a multi-agent, I found some difficulties to passing variables from an agent that act as parent to another agent that act as it's connected agent.
 
The story is:
1. I'm creating a global variable with named "global_str_ware" in the parent agent's CoversationStart.
2. As I want to pass this into my 2nd agent which I'm adding it into the 1st agent, in setting, basically I already added the Input and specify it is a custom and put that "global_str_ware"
3. In 2nd agent, I also create same name (which not sure whether it need to be same name), because if not, since this is 2 different agent, the variable from 1st agent is not recognize. 
 
I'm not sure this is the right way, because when testing, I noticed that the variable from parent became "globalStrWare".... the underscore is stripped and it became Camel case.
 
Anyway this effort has not worked. I have tried many way, but it looks like the variable that I created in 2nd agent is still null. whereby during test, I can see my 2nd agent being called and there is a variable  globalStrWare filled correctly.
So, during testing, the flow look like this:
Parent agent
     Global.global_str_ware = "62"
     ↓
     Passes to connected agent as input
     ↓
     Connected agent receives
          globalStrWare = "62" ← visible in test panel inputs
     ↓
     Connected agent conversation context
    Agent knows "warehouse 62"
        → used correctly in auto-orchestration
        → Task string shows "warehouse 62"

BUT
Global.global_str_ware inside connected agent = Blank
 
 
Well I can see it is obvious, although it is questioning as of why the variable passed to the 2nd agent (connected agent) becoming stripped underscore like that.
 
Anyone have an idea what happened and how exactly the "work" to pass variable between agents ?
 
Thanks,
 
 
 
 
I have the same question (0)
  • Suggested answer
    Valantis Profile Picture
    5,581 on at
    Hi @Voltes,
     
    The camelCase renaming (global_str_ware → globalStrWare) is confirmed expected behavior. Copilot Studio normalizes variable names to camelCase when they are passed as input/output parameters between agents. Underscores are stripped and the next character is capitalized. This is by design in how the agent-to-agent parameter schema is serialized.
     
    The reason the variable is null in the connected agent is that you're reading Global.global_str_ware but the value was passed in as an input parameter named globalStrWare. These are two different things. The input parameter isn't automatically mapped to a global variable with the same name in the connected agent.
     
    The correct pattern from Microsoft docs: when you define input parameters on the connected agent, those inputs arrive as topic-scope or local variables inside the connected agent, not as global variables. You need to explicitly map the input parameter to a global variable inside the connected agent if you want it available globally.
     
    To fix this:
    1. In the connected agent, create a topic that runs at startup (or is triggered via OnConversationStart equivalent)

    2. In that topic, use a Set variable node: set Global.global_str_ware = the input parameter value (which will be named globalStrWare in the parameter list)

    3. This copies the incoming input into the global variable so it's accessible everywhere in the connected agent
    Alternatively, just use the input parameter directly in the connected agent's topics instead of reading a global variable. Reference the input parameter by its camelCase name in the topic where it's needed, without going through a global variable at all.
     
     

     

    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/

    💼 LinkedIn

    ▶️ YouTube

  • Voltes Profile Picture
    294 on at
    Thanks, TBH, I'm still confuse.
     
    but first, I need to inform that the connected agent that being called by the parent agent, is using MCP for it's later usage. So in the Task while execute, it looks like the connected agent ran directly executing the MCP tools. It's difficult for me to trace, but it looks like it doesn't pass-through Topic such as ConversationStart.

    And during Topic development, I cannot use this globalStrWare (variable undefined), seems like this variable only exist at runtime.
     
    for the why "globalStrWare", same as what you mentioned that it is by design, I think I know now where it can look or refer to, it is actually showing in Input section at parent agent's setting for that connected agent.
     
    Thanks again.
  • Verified answer
    Anton Tjiptadi Profile Picture
    16 on at
    Hi Voltes,
     
    For orchestration between Parent agent to its connected agent, Topic ConversationStart may not be called.
     
    But the logic will stay the same as what @Valantis describe, you need to have a topic that make sure will be called by the agent. And in that agent need to have section for InputType to declare the parent's variable being passed. Then put it into your variable.
     
     
    The normal structure is like this:
     
    kind: AdaptiveDialog
    beginDialog:
      kind: OnRecognizedIntent
      id: main
      actions:
        - kind: SetVariable
          id: SetVariable
          variable: Var1
          value: =parentVar
    inputType:
      properties:
        parentvar:
          displayName: parentvar
          type: String
    outputType: {}
     
     
     

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