Editing a Script
In the script profile under the Script tab, you can activate the script or switch to edit mode. To enable the script, click Activate. To edit a script, click Edit.
In the History tab, you can see the execution history of the script. The history log in the script profile works similar to the Execution Log, except it does not include filtering, a search field, and the Workspace and Script columns.
In the General tab, you can change the script's name, description, and its unique Key.
The Key value is generated automatically when a script is created or duplicated, but it can be changed: enter any combination of 1–40 characters and click Save in the header. The value must be unique.
The key is preserved during script export and import.
The unique Key field ensures the script can be run from a dashboard even if the script's name has changed. However, if you change the key, the script will no longer run from the dashboard. In that case, you will need to reconfigure it.
The General tab also shows the workspace where the script was created and its current state if it has been run: activated or disabled.
To start editing a script, open it and click Edit.
In edit mode, you can:
- Rename the script
- Add automation blocks
- Configure the script execution order
- Test individual blocks or the entire script
- Publish the script
- Manage script versions
To rename a script in edit mode:
- Click the context menu icon and select Rename script.
- In the dialog box that opens, enter the new script name.
- Click Save.
Adding Blocks
When creating a new script, the Select a trigger block automatically appears.
On the left panel, you can configure the script’s schedule using:
- Scheduler
- New events and System events blocks from the Tracker group
- New event from the Webhook group
- New event from the Event Processing group
- Manual start
A detailed description of script trigger blocks can be found in Trigger Blocks.
Other blocks can be added to the canvas in two ways:
- Click the + icon below an existing block.
- Right-click a connection line and select Add.
You can select action blocks from the left panel. First choose the group, then the specific action block. Each block has parameters, displayed on the left panel.
Categories, groups, and blocks are described in detail in Automation Blocks.
Supported Data Types
When creating new tables in a workspace (manually or from source data), you can select a system-defined data type from a dropdown list or enter a custom type manually.
The system supports the following data types:
- String
- Integer
- Decimal
- Boolean
- Date and Time
- UUID
- String Array
- Integer Array
- Decimal Array
- Boolean Array
- Date and Time Array
The system can read, write, and in some cases convert different data types from various databases.
If a column's declared type does not match the actual data type, the system automatically attempts to convert it. If conversion is not possible, an error occurs.
Currently, conversion is supported in:
- Insert rows and Update rows blocks when connected to ClickHouse
- Manual start
- Partially for Get CSV
- Blocks working with JSON
When using the Insert rows and Update rows blocks with ClickHouse connection, input data types may be converted to the target ClickHouse column types depending on compatibility.
In Get CSV, you can specify column types manually or load them from a sample CSV. All String values from CSV files will be automatically converted to the specified type.
When using JSON-related blocks — for example, New event (Webhook, Event processing), Manual start, New events (Tracker) — JSON arrays can be written to array column types such as Array(String) in ClickHouse.
Decimal (ClickHouse) and Numeric (PostgreSQL) conversions are not supported in the Insert rows and Update rows blocks. It is recommended to preprocess such data or use compatible types.
Visual Mapping
Each block has its own fields and can reference fields from preceding blocks. To make these fields available in visual mapping, the previous block must be run.
In Insert rows and Update rows, you can automatically populate table fields with outputs from previous blocks.
To create columns and map fields automatically when manually adding a new table:
- Click Select from output fields.
- Choose the block whose output fields you want to use and click Add.
- The columns are added. Finish creating the table.
To automatically map fields into an existing table:
- Select the desired table.
- Click Autocomplete fields with output data.
- Select the fields to map into table columns and click Apply.
- The fields are automatically mapped into the respective columns.
In the left panel, you can also manually select fields for block parameters. By default, only blocks with available mapping fields are shown. Click the block name to expand the tree.
If field names fully or partially match, suggested mappings will be automatically offered. Simply select the correct one without searching the tree.
If Ungroup array and Send request (HTTP) blocks return parent objects in their output, those objects also become available in the mapping list, allowing other automation blocks to use them.
Visual mapping fields are also shown in the right-hand panel in the editor, making them easy to insert into queries and code. For more details, see Query and Code Editor.
Special Visual Mapping Mode
By default, the values from mapping fields are inserted into block parameters in safe mode. This mode prevents the use of table or column names in mappings, protecting against SQL injections.
Sometimes, you may need to insert a table or column name stored in a variable into a query. In such cases, you can disable safe mode for the SQL Query and Select Rows by SQL Query blocks.
To pass a table or column name from a variable into an SQL query, place an exclamation mark ! before the substituted field.
A single SQL query can include different mapping fields — some using safe mode and others ignoring it.
If your query uses the system variable activity_table, you need place an exclamation mark ! before it as well.
Disabling safe mode may lead to SQL injections. Use this option only if you are certain the substituted data is safe.
Adding and Deleting Connections Between Blocks
The script execution order is defined by connecting blocks
To add a connection, click a block, select an entry or exit point and drag it to the desired block.
Dragging one block onto another also creates a connection.
- A block can have multiple exits and one entry.
- Each block must have at least one connection.
To remove a connection, right-click it and select Delete.
Actions with Blocks
The block settings menu is located on the left panel. Here you can:
- Rename the block
- Edit block settings
- View block output data and run the block
- Search block output using Ctrl+F and Enter
For details on output data display, see Known issues and limitations.
Additional Actions with Blocks
Right-clicking a block opens a context menu with additional actions:
- Add an action
- Duplicate
- Replace
- Cut
- Copy
- Paste
- Delete
You can zoom in and out of the canvas with blocks using the mouse wheel or the Fit to size, +, and - buttons in the lower right corner. The lower right corner also contains the button for opening the list of published versions of the current script.
When the script is ready, you can test and publish it.
Keyboard Shortcuts
In script edit mode, the following keyboard shortcuts are available:
- Ctrl+plus button(+) and Ctrl+minus button(-) — zoom in and out of the canvas
- Shift+Delete — delete the active block
- Shift and left mouse button — select multiple blocks
- Space — drag the canvas by holding down the key (on Linux available only when using TrackPoint)
Script Versions
To view version information for a script, click the version button in the lower right corner of the canvas.
In the panel that opens, you can see the script version number, publication date, add a comment, and extend the storage period. Only the draft of the current version is editable. Other versions cannot be changed, but you can copy blocks from them.
To open a version, click it.
To add or edit a comment on a version, click the context menu icon of the version and select Comment.
You can restore a version in two ways:
- Click the corresponding button in its profile
- Click the context menu icon and select Restore Version
The current script version is stored indefinitely. Previous versions are stored for up to 30 days. You can extend a version's storage period by clicking the context menu icon and selecting Prolong storage.
Prolonging storage replaces the remaining days with the new period; it does not add to them.
To collapse the panel and view the selected script version in full screen, click the version button in the lower right corner.
You can return from a script version to the draft of the current version in two ways:
- Click the X button in the upper right corner of the version panel
- Click the Back button in the header
Was the article helpful?