Call Sub Workflow step - multiple workflow option launching on an empty list

  • 30 September 2019
  • 3 replies
  • 127 views

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.

 

 


3 replies

Badge +9

Hi Dustinaleksiuk


 


See the link below:


https://help.k2.com/onlinehelp/k2five/userguide/5.3/default.htm#K2-Workflow-Designer/Use/Toolbox/Basic/CallSubWorkflow/Call-SubWorkflow.htm


 


https://help.k2.com/onlinehelp/k2five/userguide/5.3/default.htm#K2-Workflow-Designer/Use/Toolbox/Basic/CallSubWorkflow/Call-SubWorkflow.htm


 


Regards


Elvis

Hi Elvis,

 

You posted documentation to the single workflow option. I had already posted the documentation to the multi-workflow option which pertains to my issue.

 

Is there something in your links that answer the question I posted, which is about the multi-workflow option firing the subworkflow even on an empty list? I skimmed what you posted but I couldn't see anything relevant.

 

 

Hi dustinaleksiuk,


 


Please have a look at the following link below. 


https://help.k2.com/onlinehelp/k2five/userguide/Current/default.htm#How-Tos/CSWMultiple/Create-workflow-containing-multiple-sub-workflow.htm


 


Regards,


Kevin

Reply