Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Calling automations from Pega Platform

Updated on October 19, 2022

You can invoke automations from any flow action that runs as part of a standard flow, modal dialog box, or overlay.

The automation identifier assigned to your automation in Pega Robot Studio must be referenced on the flow action. Automations can be invoked from either a pre-action or post-action. The decision of where to invoke your automation depends on your business requirements.

Preprocessing automations

Call a preprocessing automation when you want to fetch data from an automated process to be rendered on the next immediate (or future) UI screen.

The preprocessing actions are performed in the order shown on the Flow Action rule form.

Flow action
Flow action in preprocessing mode

Pre-processing actions are performed in the following sequence:

  1. A data transform is applied.
  2. An activity is run.
  3. The robotic automation is invoked.
  4. The UI is rendered.

Post-processing automations

Call a post-processing automation when you want to collect information from your user to use as input in your automation.

The following figure shows the post-processing rule form:

Post-processing flow action
Post-processing section of the Flow Action rule form

Post-processing actions are performed in the following sequence:

  1. The user submits the form.
  2. Input data is validated on the server.
  3. The robotic automation is called.
  4. The automation updates the clipboard with return values.
  5. The server revalidates the clipboard data.
  6. A data transform is applied.
  7. An activity is run.
  8. The flow action is submitted and completed.

Passing input data to automations

A subset of properties defined on your case is automatically bundled with each automation invocation request.

The exact set of properties to include is governed by the set of relevant property records defined for your case type. You can change the set properties that are bundled in each automation request by modifying the relevant records defined for your case type.

All fields created in the Case Designer or Data Designer are automatically marked as relevant. However, relevant records can be curated and modified for your specified case from the Relevant Records landing page (Designer StudioApplicationInventoryRelevant Records).

Each relevant record property is accompanied by its current clipboard value. Only scalar properties are included in your invocation request. Page properties, page groups, and page lists are not supported at this time.

Retrieving output data from automations

After an automation is invoked, the automation uses the case data included in the request. For example, an automation could use an account number to update a customer account in a mainframe system.

The invoked automation keeps track of the incoming values of all properties. If any of these values change during execution, the modified values are automatically included in the response back to your Pega 8 application. Updated property values are automatically posted back to the clipboard page that your flow action is running against. If an automation is invoked as a pre-action, the values are posted to the clipboard before the associated section is rendered. If the automation is invoked as a post-action, the clipboard is updated as part of the flow action submission process.

Depending on the validation criteria defined on your flow actions, your case processing can halt if an automation returns invalid data. Check your automation logic and ensure that your automations are returning valid data to your Pega Platform application.

Automation invocation responses include a return code as well as a status message that reflects the success or failure of the automation. The return statuses are used for informational purposes and do not affect the processing flow of your Pega Platform application. An automation developer can return one of the following messages:

MessageDescription
CompletedThe automation ran to completion and did not encounter any errors.
Completed with errors

The automation ran to completion but encountered an error that might have prevented the successful processing of the intended automation task.

For example, this error can occur if the automation is unable to look up a specific customer account because of an incorrect account ID.

Actual use of this message is dependent on the automation and implementation. Communication of these errors to the end user is handled before the automation is completed by using, for example, a Windows dialog box or an overlay.

Did not completeThis is the default return status. The automation developer is required to overwrite this return code on exiting the automation. If this code is displayed, most likely an error occurred in the automation that prevented a clean run

However, some error conditions affect your case processing flow. Your Pega Platform application automatically handles environmental errors, including:

  • The Pega Robotics Runtime is unavailable.
  • The Pega Robotics Runtime is available, but no package is loaded.
  • The Pega Robotics Runtime is available, but the specified automation cannot be found.
  • The automation was invoked but timed out (the time-out is currently set to 60 seconds).
  • The automation was invoked but was canceled.

If any of these scenarios is detected, a page message that describes the problem is displayed automatically. The user can do either of these actions:

  • Quit (cancel)
  • Ignore the message and continue the workflow

When one of these environmental errors is detected on a postprocessing automation invocation, the Submit button label changes to Ignore and continue. The user must decide whether to quit or continue their workflow. Button labels do not change if an environmental error is detected on a preprocessing automation invocation. In addition, button labels do not change if the default case action buttons are overridden by selecting Customize the action section button labels on your flow action.

You can also add custom error-handling logic by specializing the pyProcessAutomationFailure extension point activity. For example, you might want to send an email to your case administrator or technical support team whenever an automation request fails.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

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.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us