I feel like this should not be that hard. I just want to have a Parent Workflow Kick off a Child workflow, while sending some simple data back and forth. I assumed i would be using the Store and Retrieve Data Actions.
My steps are
Within the child workflow create the variables you require and ensure that the 'Show on Start Form' option is ticked:
Within the parent workflow the 'Start Workflow' action will have 'Start data' fields which require data:
Does this help?
YES, Barry, that definitely helps me get further toward a solution.
I did not know about that! Why was this information so hard to find? grrrrr
So now i can pass an varApproverName to the child approval workflow (which can be reused). I will also send the parent workflow instance ID to the child workflow.
Now the only thing left to figure out will be how to pass what the approval outcome from the child wf back to the parent to continue processing the rest of the parent.
You can use the Store Data action to store the outcome in your original parent workflow. As you have passed this workflow ID into the child you would define the Store Data action with that ID in the "Workflow instance to store to" then just define the "store as" (this will be whatever name you want - doesnt need to be defined as a variable) and the outcome variable as the "variable to store".
Then on the Parent, use the Retrieve Data action to run on the "Current Workflow", retrieving the defined Stored data (the same name as the child stored data item) and put it into your desired workflow variable.
It took a long time to understand that you could just give the "Store As" field any piece of text, and then as long as you use that same piece of text in the Restore Data - "Store as" field, both workflows can use it. I find the documentation lacking on this. You can not see this mysterious variable anywhere. This method does not seem to be fully baked into the product, as i would expect there to be a tab next to the options of (Item Proerties, Variables, Parameters, Functions)
Eitherway, I understand and get how it works now. Thanks for taking the time Mark, and Barry.
Glad to help. I usually prefix my stored data "variables" with a "SD" to distinguish them as being Store Data items. Perhaps the long term plan is to roll these into the same definitions as the other properties, variables etc.
I think I am missing something. In your previous post, you suggest to create a variable on the child workflow and ensure 'Show on Start Form' option is ticked. Then the parent workflow 'Start Workflow' action will have 'Start data' fields. I added a variable with 'Show on Start Form' ticked in my child workflow, but I do not see a 'Start data' section in the 'Start Workflow' action of my parent workflow. Any ideas why Start data may not show? I also don't understand how one workflow would know about variables in another workflow.