Calling A Subprocess
Learn how to call a subprocess suing the process run widget.
Last updated
Was this helpful?
Learn how to call a subprocess suing the process run widget.
Last updated
Was this helpful?
One of the three ways a parent process can call a subprocess in Kognitos is by using the Process Run Widget. In this setup, the parent process controls the execution and output of the subprocess.
This method is ideal for single-run scenarios where you need to capture the result and status of a subprocess.
In your automation, write the keyword run followed by a slash /
From the menu that appears, select Process.
Click on the Process drop-down menu to select the process you want to call.
Click Save.
Passing data to a subprocess allows the parent process to provide the specific inputs the subprocess needs to do its work. This makes subprocesses more dynamic and reusable, as they don’t depend on hardcoded values. To enable this, the parent process must explicitly pass the required data, and the subprocess must be designed to accept and return values accordingly.
In your subprocess, include one of these lines at the end of your automation to return data to the parent process. This syntax informs Kognitos of the subprocess's result so it can be accessed in the parent process.
For a single result: the result is {result}
For multiple results: the results are {result 1}, {result 2}, ...
This example shows how a subprocess can be used to calculate a total. The main process, Process an Invoice, calls the subprocess calculate the total and provides the price. The subprocess uses the price to calculate and return the total.
This example shows how to return multiple results from a subprocess. Here, the subprocess Split Full Name returns two results: the first name
and the last name
.
In your parent process, add a new line after run <subprocess>
. Indent and reference the data needed for the subprocess run on the new line. If a data element is required but not explicitly provided, Kognitos will raise a .
If you need to run multiple instances of a subprocess in parallel, see for details on using the start a run
syntax.