Trigger Blocks
Scripts are launched using the following blocks:
- Scheduler
- Manual start
- New event (Webhook)
- New event (Event Processing)
- New events (Tracker)
- System Events (Tracker)
Scheduler
The Scheduler block is used to set the script execution schedule. This block can only be placed at the beginning of the script. In the block settings, you can select the scheduling option:
- By seconds (default is 15 seconds)
- By minutes (default is 15 minutes)
- By weekdays (select specific days, hours, and minutes)
- By specific dates (select months, days, hours, and minutes)
- By CRON schedule (a system for triggering tasks at a specific time)
The final schedule configuration is displayed in the Run script field.
Advanced options allow you to set the start and end dates for the script execution period.
The time zone is automatically set based on your browser's time zone when the block is created. You can change it if needed.
CRON Schedule
Cron (Command Run On) is a system for specifying the frequency and timing of scheduled tasks.
Cron expressions use the following symbols:
- * — any value within the specified field. For example, in the Minutes field, it means the script runs every minute
- ? — undefined value. Use when one field is specified, and the other is ignored. For example, to run on the 10th day of each month regardless of weekday, set Day to 10 and Day of week to ?
- - — range of values. For example, 10-12 in the Hour field means hours 10, 11, and 12
- , — list of values. For example, MONDAY, WEDNESDAY, FRIDAY means the script will run on Monday, Wednesday, and Friday
- / — step value. For example, 5/15 in the Minutes field means the script runs at minutes 5, 20, 35, etc.
- L — last day of the month
- W — nearest weekday. For example, 15W means the closest weekday to the 15th. If it’s a Saturday, the script runs on Friday the 14th. If Sunday — Monday the 16th
- # — nth day of the week in the month. For example, 6#3 means the third Friday of each month
The field being edited is highlighted in the input.
| Field | Allowed Values | Allowed Symbols |
|---|---|---|
| Minutes | 0–59 | * , - / |
| Hours | 0–23 | * , - / |
| Day | 1–31 | * , -, ?, L, W |
| Month | JAN–DEC or 1–12 | * , - / |
| Day of week | SUN–SAT or 1–7 | * , -, ?, L, # |
- A CRON expression must consist of five values.
- Either Day or Day of week must be set to ?
- The L, W, and # symbols cannot be combined with steps (/), lists (,), or ranges (-)
Examples of CRON Expressions
| Expression | Meaning |
|---|---|
| */15 * * * ? | Every 15 minutes |
| 0 12 * * ? | Every day at 12:00 |
| 15 10 ? * * | Every day at 10:15 |
| 15 10 ? * MON-FRI | At 10:15, Monday through Friday |
| 15 10 L * ? | At 10:15 on the last day of each month |
| 15 10 ? * 6L | At 10:15 on the last Friday each month |
| 15 10 ? * 6#3 | At 10:15 on the third Friday of the month |
| 11 11 11 11 ? | At 11:11 on November 11 |
Manual Start
The Manual start block immediately starts the script when the Activate button is clicked and then disables itself after execution. The script runs once.
You can configure input fields that will be used later in the script. Values are entered manually before execution and passed to the script using visual mapping. The desired values are entered manually each time the block—or a script containing the Manual start block—is executed.
When adding an input field, set the following:
- Name:
- Must not be empty, must include letters, and be unique within the block
- Defaults to New field
- Type:
- Text
- Number
- Date
- Date and time
- Array: check the box to mark as an array
- Required field:
- If enabled, the script cannot be started without entering a value
- If disabled, the field may be empty, and its value will be
null
If the input type does not match the actual data type at runtime, it will be automatically converted to a ClickHouse-compatible type.
When triggered, the block returns the specified fields and start_time.
Webhook
The New event trigger block from the Webhook package launches the script when new events are received, enabling instant reactions to external changes.
Webhook Settings
Block parameters:
- Webhook address — URL to send events to
- UUID — unique webhook identifier (can be changed)
- Synchronous mode — toggle for sync/async operation
To receive events, copy the webhook URL and configure the external system to send data to it.
When importing or exporting a script containing the New event block, a new endpoint URL will be generated.
To collect data from a website and track user journeys, you can use the JS Tracker. However, if the website provides data via webhooks, use the New event block from the Webhook package to receive it. This block is designed for external data that needs to be processed within the system. For example, if your application or a third-party service generates events that must be handled internally, configure this block to accept them. To send data to an external resource, use a different tool—the Send request block from the HTTP package.
Webhook operation modes:
- Synchronous — script starts immediately after receiving data and returns a response upon completion. A 5-minute timer is restarted after each run
- Asynchronous — script can only run again after the timer expires. Response is returned via a GraphQL query, using the Return data block
Scripts can only run once every 5 minutes in either mode. This limitation prevents overload from frequent small data events, ensuring efficient batch processing.
The webhook becomes active only after first use — either via testing or script activation — to ensure only verified sources send data.
After script activation, the webhook is ready to receive data. If the script is stopped, data collection pauses until reactivated.
Webhook in Cluster Mode
Clustering enables load distribution across multiple data receivers, providing fault tolerance in case one of them fails and allowing high-volume data processing by distributing the load across servers.
Webhook behavior in cluster mode includes the following features:
- If one node becomes unavailable, incoming data is automatically redirected to another active node
- If data duplication occurs across multiple nodes due to network instability, all duplicates are automatically removed before the data is passed to the automation script
- In the event of a failure, once the node is restored, it resumes receiving data as before, since the data storage structure is automatically recovered
To ensure proper webhook operation in cluster mode, you must configure data reception through a dedicated port isolated from the one used by the web interface. This port requires a separate SSL certificate distinct from the one used for the web interface. If multiple servers are configured for data collection, assigning the webhook to its own dedicated port—with restricted server interaction capabilities—enhances system security and isolation.
Processing Received Data
To process events received via webhook, add other automation blocks to your script. For example, you can automatically load the collected data into a database table for subsequent analysis.
Detailed descriptions of blocks for working with received data are provided in the Editing a Script section.
Testing with a Sample Event
If real data has not yet been received, you can test the New event block using sample data in JSON format. After processing the test event, the system generates fields that can then be used for mapping in subsequent blocks of the script. This allows you to work with the New event block’s fields and fully configure your script before real data arrives.
To use a test event:
- Go to the Test tab and click Test Event.
- In the panel that appears, enter a sample request body in JSON format.
- Click Apply to generate the mapping based on the provided example.
Was the article helpful?