Return a value from Start a Workflow Action

  • 28 March 2017
  • 6 replies
  • 31 views

Badge +4

Gurus,

 

Let's say we have a workflow called GetApprovals.  The GetApprovals workflow contains a Start Workflow action that calls another workflow called GetFirstApproval.  Is it possible to return a value from the GetFirstApproval workflow to its caller (GetApprovals)?

 

Chris


6 replies

Userlevel 7
Badge +17

You can achieve it but not directly  There is no possibility for communications between workflows in O365 ( you can achieve that in on premises workflows: send and receive workflow data ).

In O365 I'd suggest you to:

  1. create a column in the list/ library where your child workflow operates,
  2. in your primary workflow create a loop with a pause action: pause you primary workflow for a minute or a time that you think the child workflow requires to complete its execution,
  3. in your child workflow add action to update the column in the list with the information you want to pass to the primary workflow,
  4. once your primary workflow unpauses query that list and check value of the column. If it is still empty then make another loop. If it has value end your loop.

That is the only way I can imagine to pass the value back.

Regards,

Tomasz

Badge +4

Thanks Tomasz. That is a good suggestion.  However, since these are approval tasks there is no telling how long it would take a given approver to complete their task.  I think I am going to just have to create the approvals in-line rather than breaking them out into their own workflows.

Chris

Userlevel 7
Badge +17

That is why I suggested you the loop

Maybe that would become handy for you: https://community.nintex.com/community/tech-blog/blog/2016/09/06/linkin-tasks-or-how-to-get-that-pesky-task-item-url

Regards,

Tomasz

Badge +4

I think I get the gist of what you are saying.  Do you see any reason why this wouldn't work with a "Start a Task Process" action?

Userlevel 7
Badge +17

Of course, you can put that action inside your primary workflow, but for some reason you wanted to separate them. But again - I am not aware of all requirements you have for the workflow.

The "start task process" action does not return you IDs of the created tasks (only "assign a task" action does it).

Regards,

Tomasz

Badge +4

Here is a better explanation:  My primary workflow has a parallel task with an approval in each of the branches.   In the case of the approvals each is a "Start a task Process" because the approvals will be sent to more than one approver and just wait for the first one to approve or reject.  For the purpose of best practices I wanted to break each of the approvals into their own workflow.  So, the primary workflow has a "Start Workflow" that is essentially starting a Task process.  I wanted to check the status of the individual approval tasks so I could complete the parallel action in the primary workflow when all the approvals are complete.

I think your solution has legs, I was just running into difficulties trying it out. 

Chris

Reply