Skip to main content

Nesting automations

The best approach for creating a coherent project is identifying specific, modular tasks and implementing the tasks as sub-automations. For example, when automating a procedure of opening a claim in an insurance agency application, you can divide a process into several steps, such as using a searching engine to find the customer, navigate to the customer's account details, and open a claim form. After creating sub-automations for every step, you may use them as building blocks of the project. 

To nest a sub-automation within an automation, add it to the designer Palette and drag and drop the automation symbol to the design surface. Give sub-automations a descriptive name and keep them focused on a specific task to help ensure clarity and maintainability.

Exit Points

Nested automations can define several Exit Points that you can use to alter the automation flow.

In the following example, LogIn is a sub-automation with two Exit Points: Success and Failure. In the case of Success, the main automation continues with the client search sub-automation. In case of a Failure, the main automation sends an error code to the Message Manifest and finishes execution.

Screenshot showing multiple exit points in an automation.

Error Handling

You can use the output parameters of the sub-automation to provide more details about the procedure execution. In the following example, a sub-automation has multiple Exit Points labeled as Failed, which determine the reason for a failure using an error code.

In the following image, click the + icons to see a LogIn sub-automation that defines error codes as output parameters.

The automation developer has access to the output parameters of a sub-automation in the main automation. In the following example, MessageBoxService is used to display the error code of a LogIn sub-automation.

Screenshot showing calling sub-automation and using output parameters.

Input and output parameters

Nested automations can define input and output parameters to operate on data during the execution. Any input parameters required for sub-automation should be considered in the parent automation to ensure they are available to pass. Any sub-automation output parameters, including data and error message details, can be passed up through the chain of parent automations. 

In the example below, a sub-automation ClientSearch has one input parameter: ClientID. The sub-automation performs a client search by the ID and then returns the client's last name as an output parameter to use in the parent automation. 

Screenshot showing the use of input and output parameters of a sub-abutomation.

 Check your knowledge with the following interaction.

This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice