The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Sub-Flow Output Error in Flow?

Matthew Gill
Tera Expert

I am calling Sub-Flows within a Flow. The Sub-Flows return [status] which is a True/False variable. The Sub-Flow tests correctly, but when it is called from the Flow the Sub-Flow completes, returns the appropriate output when looking at the subflow execution details, but the Flow execution details show an error for the Sub-Flow task. 

It is as if the Sub-Flow output variable is not being passed back to the Flow. I have ensured that the variable types are the same, and the Sub-Flow is set to 'Wait for Completion). Any advice or guidance is appreciated. Thank you!

1 ACCEPTED SOLUTION

Matthew Gill
Tera Expert

Alright... Support figured out what the issue was.

 

Even though the error was being shown on the Sub-Flow call, the issue was actually failing on the Update Record Action. Specifically, updating the 'Actual Start' field. I was updating to " return ( new Date() ); "; however, that field requires a String, for some reason, and was not giving a good Error Code. The workaround is to update to " return ( new Date().toString() ); ". Not ideal, but it works...

 

Thanks everyone for helping!

View solution in original post

20 REPLIES 20

I would try to end your subflow with an

if (condition)
--> assign subflow output (true)
else
--> assign subflow output (false)

Just to make sure that the variable is Always set.


Generally I avoid setting the output within an if statement, because you risk ending the subflow without setting a required/expected value.

Good idea:

find_real_file.png

Unfortunately, exact same error. Not having an opposing 'Else' has bitten me before in another unrelated Flow. 

Just a hunch and maybe worth a try to rule something out regarding the true/false type.

Can you maybe flip the sub flow output type to a string. And just try passing back a string value. At least to see if it processes without error. 

 

Geoff

Good call Geoff, that would have been my next advice.

Create an additional output, a string, and assign it a value at the end of the subflow, just to make sure that something is returned at all.

I added an additional output variable as a string, and set the value to "0" or "1" depending on the outcome. It still failed; however, I noticed something. The Error ocurrs just a few seconds after the Sub-Flow is called from the Flow. The Sub-Flow is still running when the Error is thrown in the Flow. In fact, the Sub-Flow runs for an additional 3 minutes or so to finish it's tasks and sets the output variable. But by that time the Flow is already dead, so it can't receive the output variables.