18.1 Trigger-Based Attended Automation: Forms, Triggers & Global Variables
Key Takeaways
Trigger-based attended automation combines forms, callouts, triggers, and Data Manager global variables.
A trigger workflow starts with one trigger activity, such as Application, Click, Keypress, Form Event, Repeat, or Hotkey triggers.
Scheduling modes are Sequential, Concurrent, OneTime, Sequential Collapse (keep only the latest pending event), and Sequential Drop (cancel the running action).
Enabled set to False starts a trigger silently until Enable Local Trigger activates it.
Global Variable Changed Trigger reacts to global variable changes, and Notify Global Variable Changed pushes the notification.
18.1 Trigger-Based Attended Automation: Forms, Triggers & Global Variables
Core Concept: In trigger-based attended automation, workflows start when something happens on the user's machine: the user clicks a button in an application, presses a hotkey, changes a form field, or a global variable changes. Several triggers can listen at once, so one attended process can react to many events during the user's work.
Building Blocks
| Building block | Package | Purpose |
|---|---|---|
| Forms | Form.Activities | Collect and show information, and raise events |
| Callouts | Callout.Activities | Small forms shown next to a UI element |
| Triggers | System.Activities and UIAutomation.Activities | Start workflows on application, user, or form events |
| Global variables | Created in the Data Manager | Share values across workflows and trigger on their changes |
These capabilities need version 23.4 or later of Form, System, UIAutomation, and Callout activities.
Trigger Workflows
A trigger workflow is a workflow whose first activity is a trigger. The rest of the workflow is what runs each time the trigger fires. Only one trigger per workflow is allowed. Trigger workflows can be debugged on their own or in the context of the whole project.
Trigger activities
| Trigger | Fires when |
|---|---|
| Application Event Trigger | A native event occurs on a window or UI element (the event types depend on the element and its technology) |
| Click Event Trigger | The user clicks the indicated element |
| Keypress Event Trigger | A key is pressed on the indicated element |
| Form Event Trigger | Something happens in a form, such as a component changing or the form closing |
| Repeat Trigger | A TimeSpan elapses; it can repeat |
| Hotkey Trigger | A system-wide key combination is pressed |
| Mouse Trigger, Click Image Trigger, System Trigger | System-wide mouse input, clicks on an image, or combined key and mouse events |
| SAP Session Attributes Changed Trigger | Monitored SAP session attributes change |
In Studio versions before 2023.4, these triggers had to sit inside a Trigger Scope activity.
Scheduling mode
Each trigger has a Scheduling mode that decides what happens when it fires again while its workflow is still running:
| Mode | Behavior |
|---|---|
| Sequential | Actions run one after another |
| Concurrent | Actions can overlap |
| OneTime | Runs one action, then stops monitoring |
| Sequential Collapse | While an action runs, ignores all new events except the latest, which runs next |
| Sequential Drop | Stops the running action and starts the new one |
For Sequential and Concurrent modes, monitoring continues until the user stops the execution or a Break activity is reached.
Other trigger properties
- Enabled: when False, the trigger starts but fires no events until enabled at run time with Enable Local Trigger.
- Include children (Application Event Trigger): also monitors the element's children.
- Healing Agent mode: Disabled, Inherit job settings, Recommendation only, or Same as App/Browser.
Global Variables
Global variables are created in the Data Manager and are visible to all workflows of the project. Two activities connect them to triggers:
- Global Variable Changed Trigger starts a trigger workflow when the value of a global variable changes.
- Notify Global Variable Changed pushes the change notification to the workflows that subscribe to it.
This lets one workflow update state, for example the current customer ID, and other trigger workflows react.
Forms in Trigger-Based Automation
- Forms are .uiform files designed with the Form Builder (custom HTML forms are also possible), independent of the activities that show them.
- Show Form displays a form; give each instance a unique Instance Name to show several forms at once, or leave it empty to act on all instances.
- Continue Workflow Execution decides whether the workflow waits for the form or continues while it is shown.
- Get Form Values, Set Form Values, Change Form Properties, and Run Form Script read, change, and script forms at run time.
Worked Example: A Claims Assistant
A claims handler works in a web claims system:
- Main shows a side form with the claim summary and runs Run Local Triggers.
- A trigger workflow starting with a Click Event Trigger on the system's "Open claim" button reads the claim number and updates a global variable.
- A Global Variable Changed Trigger workflow refreshes the side form with Set Form Values.
- A Form Event Trigger on the form's "Check policy" button runs a lookup and shows the result.
- A Hotkey Trigger (Ctrl+Shift+Q) with Sequential Drop starts a quick-note capture, cancelling any earlier capture still running.
Each piece is a small workflow that reacts to one event, which keeps the process easy to maintain.
Common Traps
- Putting the trigger anywhere other than first in the workflow, or adding a second trigger to the same workflow.
- Choosing Concurrent for triggers whose workflows change the same application screen; overlapping runs then fight over the UI.
- Forgetting that OneTime stops monitoring after the first event.
- Mixing up the two global variable activities: the trigger reacts to a change, Notify Global Variable Changed announces it.
A Hotkey Trigger workflow is still running when the user presses the hotkey again. The new press should cancel the current run and start over. Which scheduling mode fits?
Sequential
Concurrent
Sequential Collapse
Sequential Drop
Which statement about trigger workflows is correct?
A workflow can contain any number of triggers anywhere in its body.
The trigger must be the first activity, and only one trigger per workflow is allowed.
Triggers always need a Trigger Scope in current Studio versions.
Triggers can only be started from Orchestrator.
A trigger should be active only after the user has passed a validation step. How can this be implemented?
Set the trigger's Enabled property to False and call Enable Local Trigger after the validation.
Place a Delay before the trigger activity.
Use OneTime scheduling mode.
Start a second robot.
Sections you finish are checked off in the contents.