I’ve run into what seems to be a bug when working with Workflows.
When I call a workflow that returns a simple response (e.g. a string or object via a return block), I can easily access the response data in the calling resource (e.g. workflow.data). That works as expected.
However, when the same workflow includes a function block that internally calls another workflow (nested workflow), I can no longer access the response data. The .data field remains undefined or empty, even though the nested workflow executes successfully and has a response of its own.
Is this expected behavior?
If not, is there a workaround to access the final response from workflows that include nested function blocks?
Thanks! Would love to know if others are experiencing the same.
When executing the chain the devug console states that the workflow has 'ran successfully'. When printing {{ improveWorflow.data }} in a text component it renders [object Object].
That is good that you are getting [object Object] as that has data inside of it, we just need to look into that as @khill-fbmc suggested to see if that data is what you expected.
In the screenshot above, can you mouse over the results of JSON.stringify() where it is green to see what the returned value of that method is giving us? My hope is that one of them is returning exactly what you are looking for
In your second screenshot, you are displaying that runFunction1 has a return block which is causing that function block to return the object that your second arrow is pointing at.
Is that data payload with status, hello, productURL, adArchiveId not what you are expecting to get back?
If you click 'edit function' on runFunction1 can you take a screen shot of the return block? I am imagining that you are passing in productURL, adArchiveId params, doing some logic and then want other data back, are you missing the other data that is defined in the return block?