The Call subprocess action enables users to use existing processes within another process (parent process). When a parent process calls a subprocess (a child process), the child process executes in a sequential manner. Once it completes, the execution control is then transferred to the main parent process.
Go to the Process Designers section and open a new or an existing process. Actions configuration can be performed once they are dragged and dropped on canvas.
Step 1. Drag the Call Subprocess action from Toolbar and drop it on canvas; click on the action to open the Properties Panel.
Step 2. You can edit the Action Name.
Step 3. Select the Subprocess from a list of processes from your account.
Step 4. Click on the Subprocess configuration card to go to the next configurations steps.
If the process (that is being called as a subprocess) has input and/or output process variables defined at process level, in the next step you must map the parent process variables to the child process variables (and/or vice-versa). This way, when the child process (subprocess) is executed, you ensure that data passes from the parent process to the subprocess (as input) and back to the parent process (as output).
Step 5. Mapping input/output process variables
Mapping all subprocess inputs and/or outputs to parent's process variables is not mandatory.
For more details please check the below example:
Possible use case: A small shop keeps daily files with products sold and they want to send email confirmations to their customers. Instead of manually writing and sending a personal email to each customer, one-time configuration of a process may help with automating this daily task. By simply running and uploading the daily file they have.
We have created 2 flows for our example.
1. Send email - template for customers: includes a Send email action configured which will send out emails to customers. This way you will not need to configure from scratch an action (or an entire process) that you may re-use. Simply by calling it in a Call subprocess action. This is the child process. The child process will look like this:
To configure a Send email action you may check Send email action article.
The child process uses a process variable named <%inputdata%>. Inputdata is a data model with 4 attributes: to, subject, bodyDetails1, bodyDetails2.
These attributes used in the configuration of the Send Email action will receive data from the parent process at runtime.
2. Notify clients based on daily files: Gets data (related to customers and products they ordered) from the external .xls file and, for each entry in the file, will send confirmation emails to customers in the file, with details related to their order. Let's call this the parent process. The parent process will look like this:
To configure the Get File Data action you may check the Get File Data article.
Two process variables were created:
In Get File Data, configure the Configuration panel as follows:
Next, in order to ensure that a separate email is sent to every entry in the file, a ForEach action is needed. Check For Each article for configuration details.
Define the list and the iterator name:
Now let's configure the Call subprocess action:
Step1: Click on the action and the Properties Panel will open.
Step 2: Select a process you want to you within the main process. In our case, process that has the template for send email action configured.
Step 3: click on the Subprocess configuration card to move to next configuration steps.
Step 4: To ensure that data is passed from parent process (from the file) to child process, you need to perform the data mapping for input and/or output process variables.
In our case, the process has no output variable as the only output of the process will be actually sending out the emails to the customers.
Mapping the subprocess input variables to variables coming from the process is important to ensure there is data to initiate the subprocess run.
The elements that are used in the Send email configuration in the child process (To, Subject, bodyDetails1, bodyDetails2) will receive data from the file (customeremail, orderid, productordered, totalAmountInvoice|)
As our action is inside a foreach border, use the iterator's attributes when mapping the data, not the attributes of the data model that captures the data from the file.
Step 5: Save, Validate and Run the Process. Upload the .xls file and click Run.
This is one sample of an email sent.