Here we are going to call another workflow inside a workflow and pass a parameter from parent workflow to child workflow.
I am going to create 2 workflows -- parent workflow and child workflow. Parent workflow will call child workflow using the REST API.
Create Parent Workflow
- Login to your Microsoft account and go to flow.
- Type create from blank and type 'Request - When a HTTP request is received'.
- Inside Request Body JSON Schema, type below,
- {
- "type": "object",
- "properties": {
- "ClientId": {
- "type": "string"
- },
- "ClientSecret": {
- "type": "string"
- },
- "TenantId": {
- "type": "string"
- },
- "SiteUrl": {
- "type": "string"
- }
- }
- }
The body schema should look as below.
Note
I am passing four paramters to child workflow from parent workflow.
Initialize four different variables and assign the value as,
Now, save this workflow and you will see the 'HOST POST URL' will be generated after flow is saved. Save this URL on clicking on Copy URL icon next to the textbox.
Create Child Workflow
- Create an action in list/library based on your requirement and type when an item is created or modified.
- Initialize 4 different variables and assign the value as,
Note
Here, we need to put the value which we want to pass for each variable.
- Add an action - Type HTTP and copy the URL from parent flow which was generated and paste inside the URI method.
- Now, we are done with the configuration part and we can see that whenever the new item is created/modified, our child workflow will be called and all parameters can be accessed in child workflow.
Cheers!!