Summary of my problem: I call a SmartObject to get a list of items. I want to trigger a workflow launch for each item. The option to launch multiple sub workflows fires one workflow when my list comes back empty.
Details:
The K2 workflow designer has a step called "Call Sub Workflow". It can be configured to call multiple sub workflows based on a list provided by a SmartObject call.
It is documented here: https://help.k2.com/onlinehelp/K2Cloud/UserGuide/Update_9/default.htm#How-Tos/CSWMultiple/Create-workflow-containing-multiple-sub-workflow.htm
And also here: https://help.k2.com/kb002670
My issue is that it's firing even when my SMO returns an empty list, but since there's no list it passes a null value to my sub workflow.
We want to run this as a schedule every day and sometimes there isn't data for it to run on so an empty list is normal for this situation.
I think my workaround is going to be to check the null value on the subworkflow and terminate it when that value is null, but I'd prefer to avoid this becuase if that value is ever null because of some other issue I'd like ot see the error. I'm potentially hiding a bug with this workaround.