Skip to main content

Extension Automation Condition

Overview​

Extension Automations allow you to extend the functionality of the existing automations provided in Pia AIDesk, such as the Staff Onboarding and Staff Offboarding automations. For example you may create an extension automation to remove a third party license from a user at the end of the Staff Offboarding automation.

The Extension Automation condition covered in this article is just 1 step in the process of creating an extension automation. For more information, follow the Quick Start Guide.

To get started, you need to add the Extension Automation condition to your package to tell Pia that your package can be executed as an Extension Automation.

This does two things:

  1. It will make information available from the parent package to your Extension Automation (this is covered below)
  2. This will tell Pia that your Extension Automation can be linked to another package (if you are following the quick start guide, the step to link your extension comes later)

The Extension Automation condition can be selected in the conditions menu of the package editor: extension_automation_condition_search.png

Condition Behavior​

When the Extension Automation condition is added to your package, you will be able to link your extension to an automation. We refer to this as the "Parent" package.

When the parent package is executed via the Pia chatbot (e.g. Staff Onboarding automation), at the point which you have linked your extension, the parent package will execute your extension. Your extension may use data from the parent package or request information from the user via the chatbot using the Chat Interaction activity.

The parent_data output property of the Extension Automation condition will contain the data provided as an input from the parent package where the extension was called from.

There are some additional restrictions of a package containing an Extension Automation condition. The package should not contain any of the following activities:

This is because any package that has extension_automation condition cannot have a child package linked to it as Pia does not support multi layered package nesting.

If you attempt to save a package which breaks one of the above restrictions, an error will be returned in the package editor and you may need to remove either the condition or the activity for the package to be validated.

Input Properties​

This condition does not have any input properties.

Output Properties​

There is a single output property which the Extension Automation condition makes available:

Property Name: parent_data
Property Description: The data provided as an input from the parent package where the extension was called from.

Example​

Here is an example of a package that has extension_automation condition

# Orchestrator package
conditions:
- name: 'client_filter'
optMode: 'OptOut'
category: 'Testing'

- name: 'extension_automation'

steps:
- task: chat_interaction
inputs:
text: 'This is an Extension Automation'

# Test context variable
- task: inline_powershell
inputs:
data: =extension_automation.parent_data
script: |
Write-Host Test
$UserInfo = $(ConvertFrom-Json $data)
Write-Host Hi ($UserInfo.firstName), there is a kind info for testing would send to your email address ($UserInfo.email).