LogoLogo
About
  • Home
  • Guides
  • BDK
  • REST API
  • Release Notes
  • Getting Started
    • What is Kognitos?
    • Logging In
    • Account Setup
    • Quick Start Guide
    • Core Concepts
  • Writing Automations
    • Automation Basics
      • Defining Data
      • Comments
      • Conditionals
      • Keywords
      • Loops
    • Calling Other Processes
      • Calling A Subprocess
      • Invoking a Subprocess
      • Starting Parallel Runs
    • Validating Data
    • Context Based Learning
    • Using the Debugger
  • Books
  • Automation Management
    • Scheduled Processes
    • Email Triggers
  • Enterprise Dashboard
  • Exception Handling
    • Providing Guidance
    • Resolving Common Exceptions
    • Learnings
  • Account Management
    • API Keys
    • User Roles & Permissions
Powered by GitBook
On this page
  • Overview
  • How to Call a Subprocess Using the Process Run Widget
  • Passing Data to a Subprocess
  • Examples

Was this helpful?

Export as PDF
  1. Writing Automations
  2. Calling Other Processes

Calling A Subprocess

Learn how to call a subprocess suing the process run widget.

Last updated 2 days ago

Was this helpful?

Overview

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.

How to Call a Subprocess Using the Process Run Widget

  1. In your automation, write the keyword run followed by a slash /

  2. From the menu that appears, select Process.

  3. Click on the Process drop-down menu to select the process you want to call.

  4. Click Save.

Passing Data to a Subprocess

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.

Parent Process

Subprocess

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}, ...

Examples

1. Returning a Single Result

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.

run /calculate the total
    the price is $3
get the above as the total
the tax is $0.87
the total price is the price + the tax
the result is the total price

2. Returning Multiple Results

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 .

run /Split Full Name
  the full name is "Ada Lovelace"
get the above as the results
split the full name into parts
get the first part as the first name
get the second part as the last name
the results are the first name, 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.

Starting Parallel Runs
question