triggering a workflow activity when another workflow is finished

triggering a workflow activity when another workflow is finished

Post by Laura Benn » Mon, 26 Jan 2009 07:34:32


I have a workflow in CRM 4.0 that has 2 steps - the first step runs a
child workflow and the second step sends out an email dependent on the
first step's results.

Unfortunately, the second step starts before the child workflow in the
first step is completed - not what I want to do. How do I make the
second step wait for the child workflow to finish?
 
 
 

triggering a workflow activity when another workflow is finished

Post by danny.varg » Wed, 28 Jan 2009 07:18:27

On Jan 24, 5:34m, Laura Bennett < XXXX@XXXXX.COM >


Hi Laura,

When a workflow executes and completes execution, it returns an
execution status and then processes the next step in the workflow.
For example, if you have a step 1 updates an entity, the entity will
get updated first, return a status of complete/success and then
executes step 2. It looks like step 1 is "successful" just by calling
the child workflow.

To get around this, does step 1 calling the child workflow produce
some sort of update/create? If so, you could setup another workflow
that will wait/check to see if that update/create occurs. Another
option is to take the logic out of the child wofklow and place that in
the workflow, then to call a child workflow for step 2.

Good luck!

 
 
 

triggering a workflow activity when another workflow is finished

Post by TUQ » Wed, 28 Jan 2009 07:22:05

Laura,

Set up a flag (bit field) on the entity for which your child workflow runs
(call it something like "WF Complete", defaulted to "No".
In the last step of your child workflow, update this bit field to "Yes".
Remove your Send Email step from the Parent WF.
Build a new one for the Send Email step. Set the Triggering event to
Attribute Change. Then select you Flag field.
You'll then want to make a Condition check to make sure that Flag field is
set to "Yes".
If So, Send the Email.

Now, if this is the type of WF rule that will only run once, you can end the
WF there. But if the workflow may need to run again, you'll need to add an
Update step and set the flag back to "No".

Keep in mind that this will then trigger the very same workflow again
(because the Flag Field attribute value changes from "Yes" to "No" again, but
since the Check Condition only executes the steps if the value is "Yes", it
won't do anything the 2nd time around.

--
MD
 
 
 

triggering a workflow activity when another workflow is finished

Post by Danny Varg » Wed, 28 Jan 2009 07:25:20

On Jan 24, 5:34m, Laura Bennett < XXXX@XXXXX.COM >


Hi Laura,

When a workflow executes and completes execution, it returns an
execution status and then processes the next step in the workflow.
For example, if you have a step 1 updates an entity, the entity will
get updated first, return a status of complete/success and then
executes step 2. It looks like step 1 is "successful" just by
calling
the child workflow.


To get around this, does step 1 calling the child workflow produce
some sort of update/create? If so, you could setup another workflow
that will wait/check to see if that update/create occurs. Another
option is to take the logic out of the child wofklow and place that
in
the workflow, then to call a child workflow for step 2.


Good luck!