Skip to content

Script Console

The Script Console section (/script-console, System → Script Console) is a technical tool for administrators: a console where you can run an arbitrary PHP script directly on Orbita's server and see the result immediately.

It's used for one-off diagnostics, targeted data fixes, and testing expressions before moving them into an automation or a BPMN process — without needing to spin up a test environment.

Only users with the administrator role can access this section.

What's available in a script

The following variables are available in the code:

VariablePurpose
$userThe current user (id, name, email)
$apiA set of helper methods: reading and updating entity records, working with relations, sending email/Telegram/push notifications, working with dates
$dataAn empty array in the console (populated with real record data when the same engine runs inside an automation)

Output via echo/print is shown in the execution result, the return value is shown separately, and calls to $api->log(...) go into a separate logs section.

For security reasons, certain functions are disabled in the script (direct file system access, running shell commands, direct database access, and direct manipulation of response headers) — this is a technical safeguard of the console, not a standard limitation of the automation language.

Example

php
$u = $api->find('users', 'email', 'admin@example.com');
echo $u['name'] . ' (id=' . $u['id'] . ')';

After clicking the run button, the result (output, return value, logs, or an error) appears in the panel alongside it.

Relationship with automations

Script Console runs code using the same engine used by scripted actions in automations and BPMN processes — so the console is a convenient way to quickly test an expression or an $api call before pasting it into an automation. The full description of available methods and syntax is in the developer section.

Orbita ITSM documentation