Skip to main content

Wait Activity

Overview​

The Delayed Wait (wait) Activity is one of the built in features in package editor that you can use to control how long the package waits before starting with the new task. The activity suspends the package for a specified period of time so that Pia is not automatically working on the next task right after the first one completes.

This activity may be used in scenarios where you want to allocate extra time for a task to be complete before starting with the other one. For example, If you have a package to create Mailbox for a user, you may want Pia to wait for 5 minutes after it has created the mailbox before assigning any permissions to the mailbox. This will allow Pia to prepare any resource that may be required for the execution of next task.

The Wait activity can be located by simply searching for "Wait" in the list of activities in the package editor: wait.png

In the below example, a one minute wait is allocated before the package starts so that Pia can prepare any resource required for the package to run:

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

- name: 'chat'
option_button: 'Wait Activity Test'
option_text: 'This is a test package'
option_category: 'Test Category'

steps:

- task: wait
inputs:
minutes: '1'

- task: chat_interaction
inputs:
text: 'Hello World!'

Activity Behaviour​

The primary purpose of this activity is to pause your Package from executing the next specified task for the given period of time. You can allocate time in minutes or seconds. There is no default timeframe set for this activity so the user will need to define how long they would want Pia to wait.

Since the activity does not have any output, user will not notice any specific behaviour of this activity in Pia Chatbot. However, they can determine where the wait activity has been used by checking the activity log.

The Wait Activity can be used in all package executions (i.e. packages that are initiated via Schedule or Ticketing System Event or the Chatbot).

Input Properties​

Use properties to modify the behaviour of the activity.

Property Name: minutes
Property Required: Either minutes or seconds is required
Property Description: This is the number of minutes to wait for before continuing package execution.
Example:

- task: wait
inputs:
minutes: '5'

Property Name: seconds
Property Required: Either minutes or seconds is required
Property Description: This is the number of seconds to wait for before continuing package execution.
Example:

- task: wait
inputs:
seconds: '5'

Output Properties​

There is no output property available for this activity.

Examples​

Wait Activity between two tasks

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

- name: 'chat'
option_button: 'Wait Activity Test'
option_text: 'This is a test package'
option_category: 'Test Category'

steps:
- task: chat_interaction
inputs:
text: 'Hello!'

- task: wait
inputs:
seconds: '5'

- task: chat_interaction
inputs:
text: 'Hello Again after 5 seconds.'

In the above package, Pia will wait for 5 seconds before presenting the message "Hello Again after 5 seconds" to the user. wait_activity_example.png