Ok, this one's having me tearing my hair out. I've got one workflow (wf1) that calls another (wf2). I have verified from the run logs that wf2 executes exactly as expected when called from wf1 with the final step being a Response block with a 200 status code and a body of JSON data.
However, over in wf1, the output of the workflow wf2 is an empty object. What's going on?!
This is my recursive workflow for fetching all email account data from the MS Graph API. This works a treat, with the output from one run being passed in as the input for the next and being merged with the latest page of data in either consolidateData or finallyConsolidate data, as appropriate.
The return from fetchAllEmailUsers has an empty object when I execute this. Even if I force the return block in the sub-workflow to be a simple hard-coded object it still only returns an empty object.
I have inspected the run history for the sub-workflow and it appears to have run to completion exactly as I would expect - minus it not returning the data correctly.
Hope this adds context. Happy to expand on any additional element.
For the fetchAllEmailUsers, are you certain it is looking at the data in the Return block? And, how are you connecting the first workflow to the second workflow?
As far as I can tell, the only thing it should do is run that workflow and pass the output along to the next block of this parent workflow in the Inputs collection.
Without being embedded in your app, I am sorry but it is difficult for me to say what is happening...the Inputs I guess seems to be the culprit.... so perhaps walking through the workflow in every single step may help (yes I am sure you have done that) but it always helps to try again....perhaps in the end, it may be a bug....
Thanks @ScottR. I am starting to wonder if it's a bug. I initially posted in the hope it was a simple gotcha that someone would point out but seems like it might actually be deeper than that.
Just for fun, and completeness, here's the child workflow run history from just now after being triggered from the parent workflow. Note the several successful recursive executions followed, finally, by the one shown which is returning the full consolidated list of 1731 users to the parent workflow.
Well, the good news is that I have reproduced the issue with a very simple parent/child workflow that has none of my company's stuff in. So, if anyone from Retool wants to take a look I'd be very happy to share it.
I've narrowed it down to it being related to the recursive nature of the workflow in that running the child only once returns the expected value to the parent. However, even a single self-call causes the final Response block to be empty.