Skip to main content

I have an issue about task mail with the dynamic recipient, each receiver will receive different mail context.

 

My recipient gets from DB data, so I can not sure the exact number of receivers.

And each receiver will get their owned mail context, the mail context also gets from DB data.

 

I was using a loop to send the task mail, but I found that the task only sends to the first receiver, not all receivers in once. Only if the first receiver reply to the task, the workflow will keep going. (Please see the picture 1.) 

But if I use one task to send the whole receivers, I will get an issue that I don't know how to assign the single value to each task mail, looks like I only can put the whole smartobject field on the mail body?  (Please see the picture 2, 3.)  

 

Is there any good way to implement the requirement?

 

Thanks in advance!

 

pic 1

13558i35F109390CD71C3B.png

 

Hi,


 


You have to understand how the Task step works. When your workflow reaches the task step, your entire workflow will "pause" and wait for the user to action on the task. The workflow will only move ahead once the user performs the required action. This is the correct and intended behaviour.


 


If you have different groups of users you wish to assign the task, and you have different customized mail body for the task notification, then you have to split them out into separate Tasks. If you want the different groups of users to receive the Tasks at the same time, then you need to use another Split.


 


But here's the problem. If you do not have a fixed number of users right at the start, you cannot design the workflow as you do not know how many Task steps you need to add. The only way I can think of to solve this is to split up your workflow. Create a subworkflow, then call your subworkflow from the parent workflow. That way you can use a loop to call as many subworkflows as you want. And if you choose to call the subworkflow asynchronously, the loop will not pause and wait for the subworkflow to complete before proceeding.


 


Hi  @ms6930;

 

Other alternatives - Given the issue "Only if the first receiver reply to the task, the workflow will keep going", i think the workaround would be to use the escalation method https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/Escalation-Related-Issue/m-p/87893?nobounce=#M27337

In this way you wont need first receiver's before the workflow will continue, timer would be set to take action even if the first receiver doesn't action the task(that's indepent actions).

Note: It's best practice to state/know the number of task receivers.

 

Should you find additional information useful kindly mark as "Kudo and/or Accepted Solution", as this will assist other community memebers.

 

Kind regards;

Widson.

 

 

 


Thanks for answering!

I have tried your solution to create a sub workflow for calling and looks like it achieves what I need!


Reply