Skip to main content
Navigator | Tier 3
September 12, 2025
Solved

Child bot output variable doesn't go to a mapped Parent bot variable

  • September 12, 2025
  • 21 replies
  • 390 views

Hi to all! This is my first post here. I’m new in this platform but I’m I have been working on other platforms such as UiPath and BluePrism for years.

 

I’m not sure is this a bug or that’s how it works because it doesn’t makes sense to me:

  1. I have PARENT bot and a CHILD bot.
  2. In CHILD bot I defined an output variable ‘out_childVar_str’ (output checked)
  3. I have mapped this variable with an appropriate variable in the PARENT bot (parentVar_str).
  1. In a Child bot I assign a value to a variable ‘out_childVar_str’.
  1. After that assign action, I simulate an error with a throw then bubble that error to a Parent bot
  2. NOW...my problem is that parent variable (parentVar_str) has not getting the value from the mapped Child bot variable (out_childVar_str)

 

When I go through the child bot without a simulated error, the parent variable gets populated with the value from the child bot variable as it should be.

But with the simulated error this just not working. Please help me with this one!

 

Thank you!

 

Best answer by Aaron.Gleason

@dean.hubak The Catch action allows you to assign error information to an “Error Message” string and an “Error Line Number” integer. Those values can be assigned to variables that can be marked as output.

Then, when flow returns to the parent, you can check if the “Error Line Number” value is greater than zero. If so, an error occurred. 

Here’s my parent bot:
 

I used your variable naming scheme for clarity

Here’s my child bot:

When I run the parent bot, it displays a message box with 123 in it.

I hope this clarifies things.

21 replies

Aaron.Gleason
Automation Anywhere Team
Automation Anywhere Team
September 13, 2025

@dean.hubak Every platform and programming language has its quirks. This is one of ours. Another is that we can have a Try block without a Catch!

Please feel free to tag me for any other questions you may have. Enjoy your weekend!

Navigator | Tier 3
September 13, 2025

@dean.hubak This does not seem intended, try recreating fresh parent child file and their mapping.

Other option is to pass dictionary as input and update the key-value - they are passed by reference.

https://github.com/A360-Tools | https://botstore.automationanywhere.com/vendor/botdev
Navigator | Tier 3
September 14, 2025

@dean.hubak This does not seem intended, try recreating fresh parent child file and their mapping.

Other option is to pass dictionary as input and update the key-value - they are passed by reference.

Hi ​@Bot Dev,

I also thought that this is some kind of a bug. But as ​@Aaron.Gleason said..thats one of the quirks of AA. If you want to pass Child variable to a mapped Parent variable (in case of Child error), you must properly handle that error in Child bot or it’s output variables will not be passed to a mapped Parent. Strange and at the same time very unpractical, as you can see.

 

Regarding your proposition to use a a Parent dictionary and pass it to a Child...what is the purpose to pass a dictionary variable from Parent to Child, collect the Child values and pass them into Child’s dictionary when it is not get passed back to Parent in case of Child error if its not properly handled in it’s own Try/Catch block…

 

So...the only way to pass output variables from Child to Parent (when error in Child occur) is to properly handle the Child’s error in it’s own Try/Catch block:

 

 

Navigator | Tier 3
September 15, 2025

@dean.hubak 

Yes, it seems we need to put each task in try catch to ensure, the output mapping code runs internally😶.

I always used Try-catch-finally in all my tasks, log error details in catch, and throw from finally if error has occurred and let parent handle it(or it gets rethrown again in similar fashion.) I remember getting error thrown and output variables getting mapped as well.

 

Without using try catch in child: you can still pass value, by using reference variable types like dictionary. This would remove the need of output mapping step which internally does not run in case of errors.

Child:

 

Parent:

 

https://github.com/A360-Tools | https://botstore.automationanywhere.com/vendor/botdev
Pravin 3017
Navigator | Tier 3
September 16, 2025

calling subtask from Main task

Throwing business exception

Run from Main task - output
 

 

Pravin
Navigator | Tier 3
September 16, 2025

calling subtask from Main task

Throwing business exception

Run from Main task - output
 

 

 

Thank you ​@Pravin 3017 . Thats the only way to pass Child output variables (sampleString, errorMessage). We came to this conclusion already before. Only with a help of Try/Catch block in Child, it’s output variables are passed to a mapped Parent’s variables.

 

If we want to handle Child’s error message from Parent:

  1. That error message must be caught in Child’s Catch block,
  2. Then passed (as an output variable, ex. out_childErrorMessage) to a mapped Parent variable
  3. ReThrow it to the Parent’s Catch block (as shown in my previous post - image below) and handle it from a Parent.

    For all other Child’s output variables, also, they will be passed to Parent only if there’s a Try/Catch block in the Child bot.

Padmakumar
Premier Pathfinder | Tier 7
Premier Pathfinder | Tier 7
September 16, 2025

Hi ​@dean.hubak ,

 

Instead of throwing the error immediately after assigning the value, consider the following best practice/workaround:

Use a Dictionary or Status Variable to Capture Output Before Error Propagation

  1. Create a Dictionary Variable in the Child Bot:

    • Store all output values (e.g., out_childVar_str) inside the dictionary.
    • Include a status key like "errorOccurred": false.
  2. Assign Values Before Throwing Error:

    • Populate the dictionary with all necessary values.
    • Set "errorOccurred": true if an error condition is met.
  3. Return the Dictionary as Output:

    • Mark the dictionary as an output variable.
    • Do not throw the error directly. Instead, return the dictionary and let the Parent Bot inspect the "errorOccurred" flag.
  4. Handle Error in Parent Bot:

    • After receiving the dictionary, check the "errorOccurred" flag.
    • If true, log or handle the error accordingly (e.g., throw a custom error from the Parent Bot).
Padmakumar
Navigator | Tier 3
September 20, 2025

Hi ​@dean.hubak ,

 

Instead of throwing the error immediately after assigning the value, consider the following best practice/workaround:

Use a Dictionary or Status Variable to Capture Output Before Error Propagation

  1. Create a Dictionary Variable in the Child Bot:

    • Store all output values (e.g., out_childVar_str) inside the dictionary.
    • Include a status key like "errorOccurred": false.
  2. Assign Values Before Throwing Error:

    • Populate the dictionary with all necessary values.
    • Set "errorOccurred": true if an error condition is met.
  3. Return the Dictionary as Output:

    • Mark the dictionary as an output variable.
    • Do not throw the error directly. Instead, return the dictionary and let the Parent Bot inspect the "errorOccurred" flag.
  4. Handle Error in Parent Bot:

    • After receiving the dictionary, check the "errorOccurred" flag.
    • If true, log or handle the error accordingly (e.g., throw a custom error from the Parent Bot).

@Padmakumar

Thank you for the proposed solution. It is similar to the one suggested above by ​@Aaron.Gleason. – to catch the error in the child bot, handle it properly (put it in out_errorMessage variable), and then exit from the child bot to the parent bot in the regular way. The only deference is that he uses out_errorLineNumber (child’s output variable) as a signal in Parent that an error ocurred in Child and then throws an error in Parent with the text from mapped errorMessage variable.

Regarding the dictionary output variable...I dont want to have all the variables in dictionary. I would like to have an option to see the values of each variable in process and not to go to dictionary every time to see what values I picked up. Also, that dictionary would always be blank until It get’s populated with variables and I would not know which variable I’m using in the default list of variables on the left side of the Control Room so I always must go through code and inspect what’s happening...so that dictionary solution is definitely not as I expected to be.

 

Again..it is really frustrating that this kind of a simple thing must even been discussed on this forum and searching for all sorts of workarounds when the feature asked can not be more basic.

Once again...thank you all for your support.

 

Aaron.Gleason
Automation Anywhere Team
Automation Anywhere Team
September 20, 2025

Honestly, it is basic. If you let go of pre-conceived notions of how you think error handling should be, and allow yourself to simplify your thought process.

For example, we can use a Try with no Catch, Throw, or Finally. Most languages don't allow this. We do and it's quite useful for optional steps. 

Open your mind! 😏 

Navigator | Tier 3
September 20, 2025

Honestly, it is basic. If you let go of pre-conceived notions of how you think error handling should be, and allow yourself to simplify your thought process.

For example, we can use a Try with no Catch, Throw, or Finally. Most languages don't allow this. We do and it's quite useful for optional steps. 

Open your mind! 😏 

@Aaron.Gleason 

I guess I have to :) But explain this ‘Try with no Catch’ thing...what is the purpose of Try without Catch? I guess it is doing the same thing as an empty catch block...annul the error so the process can go further?

 

Thank you