Trigger
Overview of trigger
The trigger management function is used to create and manage task execution schedules. The system automatically dispatches tasks according to the rules set by the trigger, eliminating the need for manual intervention.
Triggers are divided into two types, each suitable for different scenarios:
Time trigger: Automatically triggers tasks based on time rules, applicable to scheduled or repetitive automation scenarios. For example, the robot performs asset investigation every day and financial reconciliation processing at the end of each month. Time triggers allow users to set a flexible time rule, and the system will create tasks according to the time rule.
Queue trigger: Monitors a specified queue and automatically triggers tasks to consume queue data when the number of messages in the queue reaches the required threshold. This is suitable for scenarios requiring batch processing of large amounts of business data, ensuring that the data in the queue is handled promptly by the worker. For example, the financial robots of each sub-center submit reimbursement application data to the queue at irregular intervals every day, while the financial robots of headquarters extract reimbursement application data from the queue and then process it uniformly.
Note:
- Time trigger is a new concept introduced in version 6.5, replacing the previous “trigger.” When upgrading the system from a version prior to 6.5 to version 6.5 or later, existing triggers will automatically be categorized as "Time triggers."
- Queue trigger is a new feature introduced in version 6.5.
Creating a New Trigger
The process for creating a new trigger varies depending on the trigger type. Detailed instructions are provided below for each type.
Creating a Time Trigger
The process of creating a Time trigger involves three steps:
Step 1: Configure Basic Information
In this step, you need to set the basic information for the trigger.
Details of the configuration items:
- Trigger Name: The name must be globally unique and cannot duplicate the name of any other trigger.
- Select Process: Choose a process from the process list. The trigger will execute based on the enabled version of the selected process.
- Select Department: Assign the task to a specific department.
- Select Automation Worker: Specify the Automation Worker to execute the task. You can choose an individual unattended worker or a specific worker from an Automation Worker group.
- Number of Tasks to Create: The number of tasks created each time the trigger is activated. For example, setting this to 2 will create 2 tasks.
- Priority: Task priority; high-priority tasks are executed first by the worker.
- Maximum Runtime: The maximum duration for task execution. If the runtime exceeds this value, the system will issue a stop command.
- Validity Period: The validity period for the task, measured in days. Tasks that exceed this period without being executed will automatically expire and cannot be executed.
- Screen Recording: Whether to record the screen of the Automation Worker.
- Description: Additional information about the trigger.
Task validity period is a new feature introduced in version 6.5.
Step 2: Configure Trigger Rules
In this step, you need to configure the detailed rules for the Time trigger.
Details of the configuration items:
- Trigger Cycle: Set the time zone for the trigger and enable the workday calendar to trigger tasks on workdays.
- Start Time: The time when the trigger starts activating tasks.
- End Time: The time when the trigger stops activating tasks. You can choose "Never End" or specify an end time.
- Trigger Rules: Support for basic rules or custom rules. Custom rules are defined using CRON expressions.
Basic Rules
Basic rules allow you to set the execution frequency and logic:
- Execution Frequency: The minimum interval for execution frequency is "minute."
- Execution Logic: Can be set to execute at a specific time or repeat after a certain interval.
Custom Rules
Custom rules are configured using CRON expressions.
The structure of a CRON expression is "Minute Hour Day Month Week," for example, "5 1 *" means "trigger at the 5th minute of the 1st day of every month."
Supported fields and symbols for CRON expressions are as follows:
Field | Required | Allowed Values | Allowed Special Characters |
---|---|---|---|
Seconds | Yes | 0–59 | , - * / |
Minutes | Yes | 0–59 | , - * / |
Hours | Yes | 0–23 | , - * / |
Day of Month | Yes | 1–31 | , - * ? / L W |
Month | Yes | 1–12 | , - * / |
Day of Week | No | 0–6 | , - * ? / L # |
Symbol | Description |
---|---|
, | Specifies multiple values, e.g., "6,17,33" triggers at the 6th, 17th, and 33rd minute. |
- | Specifies a range, e.g., "2-9" triggers between 2 and 9 o'clock. |
* | Matches all values, e.g., "*" in the Minutes field triggers every minute. |
? | Similar to *, used as a placeholder for optional fields. |
/ | Specifies intervals, e.g., "5/20" triggers every 20 minutes starting at the 5th minute. |
W | Triggers on the closest workday to a specified date, e.g., "15W" triggers on the closest workday to the 15th of the month. |
# | Specifies the nth occurrence of a weekday in a month, e.g., "5#3" triggers on the 3rd Friday of each month. |
Step 3: Confirm Trigger Details
In this step, you can review the trigger's basic information, rules, and expected execution details. Click "Confirm" to save once everything is verified.
Creating a Queue Trigger
The process of creating a Queue trigger involves three steps:
Step 1: Configure Trigger Information
In this step, you need to set the basic information for the Queue trigger.
Details of the configuration items:
- Trigger Name: Must be globally unique and cannot duplicate the name of any other trigger.
- Trigger Queue: Select the queue that the trigger will monitor. The queue must already exist, and you can only see queues within your permission scope. Contact the queue owner to add you as a collaborator if needed.
- Minimum Effective Message Count: Specifies the number of
Unconsumed - Valid
messages required in the queue to trigger a task. The range is 1 to 1000, with a default value of 1.
Suggested Setting: If you want the queue messages to accumulate to a certain level before triggering tasks for bulk processing, adjust this value accordingly to avoid workers processing queue messages too quickly.
- Periodic Check to Trigger Even if Message Count is Insufficient: This option appears only if the Minimum Effective Message Count is set higher than 1. It ensures that tasks are triggered to process remaining queue messages even when their count falls below the set threshold.
Suggested Setting: Use this option for handling the last few remaining messages in the queue. For example, if the Minimum Effective Message Count is set to 10, tasks will not trigger when the count drops below 10. If the queue messages no longer increase, these messages may remain unprocessed. Enabling this option ensures that the remaining messages are also handled.
- Check Interval: If the above option is enabled, you can set how often the system should force trigger tasks to process the remaining messages. Choose from fixed intervals provided by the system, e.g.,
10 minutes
,20 minutes
,60 minutes
,90 minutes
, or120 minutes
.
Suggested Setting: Adjust this based on the acceptable waiting time for processing business messages. For instance, if messages should be processed within 2 hours, set this value to 60 minutes.
- Trigger Once Every N Messages: Defines the average number of messages to be processed per task. For example, if a process can handle 10 messages, set this value to 10. Note: The total number of tasks in the
Pending
andRunning
states triggered by a Queue trigger will not exceed the specified number of Automation Workers. For example, if a single worker is specified, it will not exceed 1; if a worker group is specified, it will not exceed the total number of workers in the group. The system checks for trigger conditions every minute and triggers tasks immediately if the conditions are met. The number of tasks triggered (N) is calculated as follows:
info
Assume:
a = Current number of Unconsumed - Valid
messages in the queue
b = Value set for Trigger Once Every N Messages
c = Total number of tasks in the Pending
and Running
states triggered by the current Queue trigger
Calculation: N = RoundUp(a / b) - c, where RoundUp means rounding up to the nearest integer.
Example: If Trigger Once Every N Messages is set to 10, the specified worker group has 6 workers, and 3 tasks triggered by the current Queue trigger are still in the Pending
/Running
state. If there are 78 valid messages in the queue, the theoretical number of tasks to trigger is RoundUp(78 / 10) - 3 = 5. However, the number of tasks triggered will not exceed the total number of workers (6 - 3 = 3). Therefore, 3 tasks will be triggered.
Custom Work Calendar: Choose whether to enable a custom work calendar. If enabled, select a custom calendar and configure its details. See the Custom Calendar section below for details.
Description: Additional details about the trigger.
warning
Note: Queue triggers check for activation conditions every minute. Due to the time required for workers to execute tasks, workers may not immediately consume queue data. Consequently, it is possible that the number of messages in the queue may only suffice to trigger X tasks, but the system triggers more than X tasks. In such cases, the additional tasks may fail to access queue data. To address this, consider the following when designing processes:
- Retrieve queue messages as early as possible in the process.
- Implement error handling for retrieving queue messages, such as terminating the current task if no messages are retrieved.
Step 2: Configure Task Information
In this step, you need to set up task information for the Queue trigger.
Details of the configuration items:
- Select Process: Choose a process from the process list.
- Select Department: Assign the task to a specific department.
- Select Automation Worker: Specify the Automation Worker to execute the task.
- Number of Tasks to Create: Fixed at 1 for Queue triggers.
- Task Priority: Task priority; high-priority tasks are executed first by the worker.
- Maximum Runtime: The maximum duration for task execution.
- Validity Period: The validity period for the task.
- Screen Recording: Whether to record the screen of the Automation Worker.
Step 3: Confirm Trigger Details
In this step, you can review the trigger's basic information, rules, and expected execution details. Click "Confirm" to save once everything is verified.
Custom Work Calendar
Creating a New Calendar
Click the "Create Calendar" button to set a name, template, and time range, then save.
The template provides the following options:
- Weekend Calendar: Saturdays and Sundays are non-working days.
- Sunday-Only Calendar: Sundays are non-working days.
- Blank Calendar: All dates are working days.
After creating the calendar, you can mark specific dates as non-working days or upload a calendar file for configuration.
Add Collaborator
Click a trigger in the trigger list and select "Add Collaborator" to assign collaborators.
Role Name | Description |
---|---|
Manager | Can edit, delete triggers, and add collaborators. |
User | Can view triggers. |
Trigger Details
Trigger details include basic information, trigger rules, trigger records, and ownership information. The fields displayed vary depending on the trigger type.
Time Trigger Details
Basic Information Fields:
- Name
- Status (Enabled or Disabled)
- Process Name
- Department Name
- Automation Worker
- Task Priority
- Create Repeated Tasks
- Maximum Runtime
- Screen Recording
- Description
Trigger Rule Fields:
- Custom Work Calendar
- Start Time
- End Time
- Execution Logic
- Next Start Time
Queue Trigger Details
Basic Information Fields:
- Name
- Status (Normal or Abnormal)
- Enabled Status
- Trigger Type
- Trigger Queue
- Minimum Effective Message Count
- Check Interval
- Trigger Once Every N Messages
- Custom Work Calendar
- Description
Task Information Fields:
- Process Name
- Department Name
- Automation Worker
- Task Priority
- Maximum Runtime
- Screen Recording
Trigger Records
Click a trigger in the trigger list to view its activation records. Records include activation time, time zone, activation results, and corresponding task details such as task ID, process name, Automation Worker, and task status.
Editing a Trigger
Click the "Edit" button to modify trigger information. The editing interface is consistent with the creation interface, except that the trigger's time zone cannot be modified.
note
When the process specified by the trigger undergoes version changes (e.g., the release of a new version or version switching), the parameters in the trigger will be updated according to the following rules:
- If the parameters in the new version of the process remain unchanged, the corresponding parameters in the trigger will retain their original settings.
- If the default value of a parameter in the new version of the process is altered, the corresponding parameter in the trigger will still maintain its original settings.
- If the type of a parameter in the new version of the process changes, the corresponding parameter in the trigger will be adjusted to the default value of the new parameter.
- If a parameter in the new version of the process is removed, the corresponding parameter in the trigger will also be removed.
- If the name of a parameter in the new version of the process is changed, the name of the corresponding parameter in the trigger will be updated accordingly, and it will adopt the default value of the new parameter.
When developing a new version of the process, consider the following:
- Avoid modifying the name or type of a parameter if its meaning remains unchanged.
- Notify relevant business personnel in advance if modifications to parameters may result in changes to trigger parameters, allowing them to make timely adjustments.
Deleting a Trigger
Click the "Delete" button and confirm the deletion to remove the trigger.
Permission Management
Click the "Permission Management" button for a trigger to manage its permissions. You can add or remove collaborators.
Role Name | Description |
---|---|
Manager | Can edit triggers, assign permissions, etc. |
User | Can view triggers. |