Automation Actions
What It Is
This chapter is the action reference for the Automation Builder.
Actions are the building blocks of automation workflows. Each action is an atomic unit that performs a specific operation, accepts input parameters, and routes execution flow through endpoints. Actions can be chained and nested to build complex workflows.
Why It Matters
Understanding the available actions and their parameters is essential for building automations. Each action has:
- Input parameters: values that configure the action's behavior, written as CodeProcessor expressions
- Endpoints: named exit points that define what happens next (e.g. on success, on error, on completion)
- Endpoint-provided parameters: values produced by the action that downstream actions can read via
endpoint("name")
Action Groups
Actions are organized into the following groups:
- Control Structures
- Loops
- Variables
- Database
- Object Operations
- Files
- Notifications & Mailing
- Network Communication
- Front-end UI Control
- System
- AI
Control Structures
Condition
Evaluates a single boolean expression and routes execution to either the If true or If false endpoint. The expression is a CodeProcessor expression — write the entire condition inline using any operators, comparisons, function calls and logical combinators (&&, ||, !).
Prefer Condition over IF for new automations. Compound logic stays in one expression instead of being spread across chained IF nodes connected via the OR endpoint.
| Input Parameter | Type | Description |
|---|---|---|
condition | mixed | Boolean expression. Non-bool results are coerced via PHP truthiness — empty string, null, 0, empty array count as false; everything else is true. |
| Endpoint | Provided Parameters |
|---|---|
| If true | — |
| If false | — |
Examples:
trigger("user").age >= 18
trigger("object").status == "approved" && var("country") == "US"
changedFrom("status", "open")
compareDates(get('due_date'), today(), 'lt')
IF
Legacy two-operand comparison. Evaluates a condition by comparing two operands with a chosen operator. Routes the flow to the If true or If false endpoint accordingly. Multiple IF actions can be chained via the OR endpoint to build compound conditions.
For new automations use Condition instead. A single
conditionexpression liketrigger("user").age >= 18 && var("country") == "US"replaces the chain of IF + OR nodes that the two-operand model forces. IF is kept for backward compatibility with existing automations.
| Input Parameter | Type | Description |
|---|---|---|
a | mixed | Left-hand side operand |
operator | string | Comparison operator |
b | mixed | Right-hand side operand |
Available operators: =, >, >=, <, <=, !=, contains, containsKey, isIn, isTrue, isFalse, isNull, isIterable, isFile, isEmail, isEmpty.
| Endpoint | Provided Parameters |
|---|---|
| If true | — |
| OR | if_result (bool) |
| If false | — |
Switch
Multi-way branch. Tests value against each item in the cases list and routes execution to the endpoint corresponding to the first matching case. If no case matches, routes to the Default endpoint. Functionally equivalent to a chain of IF actions, but the builder renders one endpoint per case, so the resulting automation is compact and intent is easier to read.
Comparison uses PHP's loose equality (==). Only the first matching case is triggered; subsequent matches are ignored (standard switch semantics).
| Input Parameter | Type | Description |
|---|---|---|
value | mixed | The value to test |
cases | iterable | Iterable of case values — see Modes below |
| Endpoint | Provided Parameters |
|---|---|
| Default (no match) | matched_value (always null) |
| Case: <label> | matched_value — the matched case value |
Modes
cases supports two addressing modes, and both can be mixed in the same list:
Positional (value-based). Entries with integer (or omitted) keys are matched and addressed by their value. Endpoint identity is derived from a hash of the value, so identical values always map to the same endpoint. Only scalar values (string, int, float, bool, null) are accepted in this mode; non-scalar entries are silently skipped.
value = status
cases = ['approved', 'pending', 'rejected']
Produces three endpoints: Case: approved, Case: pending, Case: rejected.
Keyed (label-based). Entries with string keys are matched by their value but addressed by their key. Endpoint identity is derived from a hash of the key, so every entry gets its own endpoint regardless of what its value evaluates to. Any value type is accepted — scalars, objects, arrays, whatever == can compare.
This is the mode to use for the switch(true) { case expr1: ... case expr2: ... } pattern, where the value under test is simply true and each case is a boolean expression. In positional mode all true cases would collapse to a single endpoint; in keyed mode each rule keeps its own endpoint and its own label.
value = true
cases = [
'adult' => $age >= 18,
'us_customer' => $country === 'US',
'premium' => $premium === true,
]
Produces three endpoints: Case: adult, Case: us_customer, Case: premium. The first entry whose value loosely equals true fires.
Positional and keyed entries can coexist in one list:
cases = [
'legacy' => $record->legacy === true,
'approved',
'pending',
]
Endpoint identity
Each case endpoint uses a content-addressed internal ID:
- Positional mode:
case_<hash-of-value>. - Keyed mode:
case_k_<hash-of-key>.
This keeps endpoint IDs stable across reorderings of the list and safe to use as a DOM/URL id regardless of what the key or value contains (spaces, quotes, HTML-special characters, multi-byte text, etc.). The builder surfaces the key or value as the endpoint's name (e.g. Case: approved, Case: adult), so builder UI and run logs remain readable.
Removing a case
If a case is removed from the cases list while actions are still attached to its endpoint, the endpoint is preserved in the builder under the label Case: (removed) until the attached actions are moved or deleted. Nothing is silently dropped.
Editing the cases list
The cases input is flagged to re-render the canvas when its value changes, so new case endpoints appear (and unused ones disappear) without reloading the page.
Async Waitpoint
Pauses the automation flow and waits for an external callback. A unique callback URL and token are generated that an external system can POST to in order to resume the flow. Supports an optional timeout.
| Input Parameter | Type | Description |
|---|---|---|
continueMainFlow | bool | When true, the automation continues executing after the waitpoint is created. When false, execution suspends entirely until the callback is received. |
timeoutAfter | string|null | Optional date/time expression. If the callback is not received by this time, the Timeout endpoint is triggered. |
| Endpoint | Provided Parameters |
|---|---|
| Started | asyncRunId (string), callbackUrl (string), callbackToken (string), timeoutAt (string|null) |
| Timeout | asyncRunId (string), timeoutAt (string|null) |
| Completed | asyncRunId (string), requestMethod (string), requestHeaders (array), requestContent (array), requestRawBody (string) |
Run Action (GoTo)
Runs the specified target action and anything within its endpoints. Does not continue the flow after the target action, and returns to the calling point.
| Input Parameter | Type | Description |
|---|---|---|
target | scalar|null | The target action to run (selected from actions in the current automation) |
args | object|array|null | Arguments passed to the target action as endpoint parameters |
Return Value
Immediately terminates the current automation and returns a value to the parent automation that called it (via Run Automation). The parent receives the returned value in the Output endpoint parameter.
| Input Parameter | Type | Description |
|---|---|---|
value | mixed | The value to pass back to the parent automation |
Abort Parent Operation
Aborts the parent API operation (e.g. a create, update, or delete triggered by an API event). The operation that triggered this automation will be cancelled. Useful for validation or permission checks that should prevent the parent operation from completing.
No input parameters. No endpoints.
Terminate Automation
Immediately stops the entire automation. No further actions or endpoints are executed after this point.
No input parameters. No endpoints.
Prevent Iteration Over Selection
When an automation is invoked on a selection of objects, the system normally iterates over each selected item and runs the automation for each one individually. This action prevents that iteration, so the automation runs only once for the entire selection.
No input parameters. No endpoints.
Loops
For Each
Iterates over an iterable value (array, collection, etc.) and executes the With each iteration endpoint for every item. Supports Break loop and Continue loop actions inside the loop body.
| Input Parameter | Type | Description |
|---|---|---|
iterable | iterable | The array or iterable to loop over |
| Endpoint | Provided Parameters |
|---|---|
| With each iteration | key (scalar|null), value (mixed) |
While
Repeats execution as long as the Iteration step value evaluates to a truthy value. The value is re-evaluated before each iteration. Supports Break loop and Continue loop actions inside the loop body.
| Input Parameter | Type | Description |
|---|---|---|
iterable | mixed | An expression that is re-evaluated each cycle; the loop continues while it is truthy |
| Endpoint | Provided Parameters |
|---|---|
| With each iteration | value (mixed) |
Break Loop
Immediately exits the nearest enclosing For each or While loop. No further iterations are executed.
No input parameters. No endpoints.
Continue Loop
Skips the rest of the current iteration and jumps to the next one in the nearest enclosing For each or While loop.
No input parameters. No endpoints.
Variables
Assign a Variable
Sets an automation variable to the specified value. If the variable already exists, its value is overwritten. Variables are accessible throughout the automation via var("variableName").
| Input Parameter | Type | Description |
|---|---|---|
variable | string | The name of the variable to set |
value | mixed | The value to assign |
Append Value to a Variable
Appends a value to an existing automation variable (typically an array). If the variable does not exist yet, it is created.
| Input Parameter | Type | Description |
|---|---|---|
variable | string | The name of the variable to append to |
value | mixed | The value to append |
keepExistingKeys | bool | When true, existing keys in the array are preserved; otherwise they may be overwritten. Default: true |
Set Template Variable
Sets a variable on the current front-end template (Latte). The variable becomes available in the rendered template as $variableName. The variable name must be a valid PHP identifier.
| Input Parameter | Type | Description |
|---|---|---|
variable | string | The template variable name |
value | mixed | The value to assign |
Update by Reference
Updates a single property on an object by reference. The change is applied directly to the in-memory object without saving to the database.
| Input Parameter | Type | Description |
|---|---|---|
object | mixed | The object whose property will be updated |
property | scalar|null | The name of the property to change |
value | mixed | The new value to assign |
Patch by Reference
Updates multiple properties on an object by reference in a single action. Changes are applied directly in memory without saving to the database.
| Input Parameter | Type | Description |
|---|---|---|
object | iterable|null | The object whose properties will be patched |
value | iterable|null | An iterable of property-name to new-value pairs to apply |
Database
Query
Executes a raw SQL query against the database. SELECT queries can optionally return results as ActiveResource objects.
| Input Parameter | Type | Description |
|---|---|---|
query | string|null | The SQL query to execute. Supports niceSql syntax for table/column name resolution. |
parameters | object|array|null | Optional query parameters for safe value binding |
returnAsObjects | bool | When true, SELECT results are converted to ActiveResource objects. Default: true |
| Endpoint | Provided Parameters |
|---|---|
| On success | data (array), count (int) |
| Has data | data (array), count (int) — only called for SELECT with count > 0 |
| No results | — only called when a SELECT returns zero rows |
Object Operations
Create Object
Creates a new object of the specified type. Optionally saves it to the database immediately.
| Input Parameter | Type | Description |
|---|---|---|
type | scalar|null | The object type to create |
data | iterable|stdClass|null | Property-name to value pairs for the new object |
save | bool | When true, the object is persisted immediately. Default: true |
skipApiEvents | bool | When true, API events (automations triggered by create) are not fired. Default: false |
| Endpoint | Provided Parameters |
|---|---|
| On success | object (ActiveResource) |
Get Object
Retrieves a single object by its ID, UUID, or system name.
| Input Parameter | Type | Description |
|---|---|---|
type | scalar|null | The object type to look up |
id | scalar|null | The identifier of the object |
| Endpoint | Provided Parameters |
|---|---|
| On success | object (ActiveResource) |
List Objects
Retrieves a list of objects of the specified type. Filter using either a saved Query or inline Conditions.
| Input Parameter | Type | Description |
|---|---|---|
type | scalar|null | The object type to list |
query | scalar|null | An optional saved Query to use as the filter |
context | ActiveResource|null | An optional context object (e.g. parent object for relational queries) |
conditions | object|array|null | Inline filter conditions. Each condition: [property, operator, value] |
order | scalar|null | Property name to sort results by |
orderDir | string | Sort direction: ASC or DESC. Default: ASC |
skipApiEvents | bool | When true, API events are not fired during listing. Default: false |
| Endpoint | Provided Parameters |
|---|---|
| On success | objects (array), count (int) |
| Has data | data (array), count (int) — only when count > 0 |
| No results | — when result set is empty |
Update Object
Updates an existing object with new data. Provide the object directly or look it up by type and ID.
| Input Parameter | Type | Description |
|---|---|---|
object | ActiveResource|null | The object to update (if provided, type and id are ignored) |
type | scalar|null | The object type (used if object is not provided) |
id | scalar|null | The identifier (used if object is not provided) |
data | iterable|stdClass|null | Property-name to value pairs to update |
save | bool | When true, persisted immediately. Default: true |
skipApiEvents | bool | When true, API events are not fired. Default: false |
| Endpoint | Provided Parameters |
|---|---|
| On success | object (ActiveResource) |
Delete Object
Deletes an existing object from the database. Provide the object directly or look it up by type and ID.
| Input Parameter | Type | Description |
|---|---|---|
object | ActiveResource|null | The object to delete (if provided, type and id are ignored) |
type | scalar|null | The object type (used if object is not provided) |
id | scalar|null | The identifier (used if object is not provided) |
skipApiEvents | bool | When true, API events are not fired. Default: false |
Perform Object Action
Triggers a registered action on an object (e.g. a custom button action defined on an object type). Provide the object directly or look it up by type and ID.
| Input Parameter | Type | Description |
|---|---|---|
object | ActiveResource|null | The object to act on (if provided, type and id are ignored) |
type | scalar|null | The object type (used if object is not provided) |
id | scalar|null | The identifier (used if object is not provided) |
actionId | scalar|null | The action to perform (selected from the object type's registered actions) |
args | object|array|null | Optional parameters passed to the action |
| Endpoint | Provided Parameters |
|---|---|
| On success | object (ActiveResource), return (mixed) |
Convert Object
Creates a new object of a different type by duplicating data from an existing object. Non-persistent system fields (id, timestamps, etc.) are excluded automatically.
| Input Parameter | Type | Description |
|---|---|---|
object | ActiveResource|null | The source object (if provided, type and id are ignored) |
type | scalar|null | The source object type (used if object is not provided) |
id | scalar|null | The source identifier (used if object is not provided) |
targetType | scalar|null | The type to create the new object as |
mapping | object|array|null | Optional property-name mapping (source name to target name) |
skipApiEvents | bool | When true, API events are not fired. Default: false |
| Endpoint | Provided Parameters |
|---|---|
| On success | object (ActiveResource) |
Files
Store Local File
Saves a file to a local storage location.
| Input Parameter | Type | Description |
|---|---|---|
name | scalar|null | The name to assign to the stored file (required) |
source | scalar|null | The path to the file to store |
namespace | scalar|null | Optional category or folder name |
| Endpoint | Provided Parameters |
|---|---|
| Success | filename (string) |
Write to Local File
Writes data to a file in local storage. Can create a new file or update an existing one.
| Input Parameter | Type | Description |
|---|---|---|
name | scalar|null | The name of the file (required) |
data | scalar|null | The content to write |
namespace | scalar|null | Optional category or folder name |
append | bool|null | When true, data is appended instead of overwriting. Default: false |
| Endpoint | Provided Parameters |
|---|---|
| Success | filename (string) |
Read Local File
Retrieves the contents of a locally stored file.
| Input Parameter | Type | Description |
|---|---|---|
name | scalar|null | The name of the file to read (required) |
namespace | scalar|null | Optional category or folder name |
| Endpoint | Provided Parameters |
|---|---|
| Success | data (string) |
Initiate a File Download
Initiates a file download for the user.
| Input Parameter | Type | Description |
|---|---|---|
name | scalar|null | The name to give the downloaded file |
source | scalar|null | The path to the file to download |
namespace | scalar|null | Optional namespace (if provided, file is resolved from local storage) |
Notifications & Mailing
Send an E-mail
Sends an e-mail using either a saved e-mail template or an inline message body. Supports multiple recipients, attachments, and template variables.
| Input Parameter | Type | Description |
|---|---|---|
from | string|null | Sender address. Format: "Display Name" address@example.com or just address@example.com |
to | string|null | Comma-separated list of recipients |
replyTo | string|null | Reply-to address |
subject | string|null | Subject line |
template | string|null | Saved e-mail template (if provided, Message body is ignored). Template must be active. |
body | string|null | Inline HTML body (only used when no template is selected). Supports Latte syntax. |
attachments | object|string|array|null | File objects or file paths to attach |
vars | object|array|null | Key-value pairs passed to the template for rendering |
sendNow | bool | When true, sent immediately. Otherwise queued for bulk cron delivery. Default: true |
Send a Notification
Sends an in-app system notification to a specific user, group, role, or custom recipient.
| Input Parameter | Type | Description |
|---|---|---|
title | scalar|null | Notification title (required) |
content | scalar|null | HTML content |
classes | object|array|null | Optional CSS classes |
link | array|scalar|null | URL or route array the notification links to |
pinned | bool|null | Whether the notification stays pinned until dismissed |
validFrom | scalar|null | Optional visibility start time |
validTo | scalar|null | Optional visibility end time |
recipientIdUser | scalar|null | Send to a specific user |
recipientIdGroup | scalar|null | Send to all users in a group |
recipientIdRole | scalar|null | Send to all users with a role |
recipientCustomId | scalar|null | Send to a custom recipient identifier |
| Endpoint | Provided Parameters |
|---|---|
| On success | notification (Notification) |
Send an Expo Notification
Sends a push notification to a mobile device via the Expo Push Notification service.
| Input Parameter | Type | Description |
|---|---|---|
token | array|scalar|null | Expo Push Token(s) |
title | string|null | Notification title |
content | string|null | Notification body text |
params | object|array|null | Additional Expo notification parameters (badge, sound, data, etc.) |
sendNow | bool | When true, sent immediately. Otherwise queued for cron. Default: true |
Send an SMS
Sends an SMS text message via the configured SMS gateway.
| Input Parameter | Type | Description |
|---|---|---|
to | array|scalar|null | Phone number(s) |
text | string|null | SMS text content |
sendNow | bool | When true, sent immediately. Otherwise queued for cron. Default: true |
Network Communication
Send HTTP Request
Sends an HTTP request to an external URL. Supports all common HTTP methods.
| Input Parameter | Type | Description |
|---|---|---|
url | string|null | Target URL |
method | string|null | HTTP method: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, or SEARCH. Default: GET |
type | string|null | Body encoding: json or formfields. Default: json |
headers | object|array|null | Custom HTTP headers as key-value pairs |
data | object|array|null | Request body data |
| Endpoint | Provided Parameters |
|---|---|
| On success | code (int), content (string|null) |
Send JSON Response
Sends a JSON response back to the client. The content type is set to application/json.
| Input Parameter | Type | Description |
|---|---|---|
json | array|object|null | The data to encode and return as JSON |
httpCode | scalar|null | HTTP status code |
Send Response
Sends a response with a custom content type. More flexible than Send JSON Response.
| Input Parameter | Type | Description |
|---|---|---|
payload | mixed | The response body |
httpCode | scalar|null | HTTP status code |
contentType | scalar|null | MIME type. Default: application/json |
Publish Server-Sent Event
Publishes a message to one or more SSE channels via Redis. Clients subscribed to the channel receive the message in real time.
| Input Parameter | Type | Description |
|---|---|---|
channel | array|string|null | Channel name(s) to publish to |
message | mixed | Message payload. Scalars are sent as strings; objects/arrays are JSON-encoded. |
Load Data from ARES
Looks up a Czech company in the ARES (Administrative Register of Economic Subjects) by its identification number (ICO).
| Input Parameter | Type | Description |
|---|---|---|
id | mixed | Czech company identification number (ICO) |
| Endpoint | Provided Parameters |
|---|---|
| On success | data (Ares Core Data object) |
Iterate JSON Stream
Streams a JSON document from a URL and iterates over its items without loading the entire response into memory. Uses JSON Machine for memory-efficient parsing.
| Input Parameter | Type | Description |
|---|---|---|
url | string|null | URL to stream JSON from |
jsonPointer | string|null | JSON Pointer to select a specific part of the document (e.g. /data/items). Default: root |
| Endpoint | Provided Parameters |
|---|---|
| For each item | key (scalar|null), value (mixed) — supports Break loop and Continue loop |
| On complete | count (int) |
Front-end UI Control
Flash Message
Displays a temporary flash message to the user.
| Input Parameter | Type | Description |
|---|---|---|
message | scalar|null | The text to display |
type | scalar|null | Visual style: default, primary, secondary, success, warning, danger, or info |
publicId | scalar|null | Optional author-chosen ID stamped as data-soopio-id on the rendered toast, so Run JavaScript code can target it with Jetstack.getElement(id) |
Banner Message
Displays a persistent banner message in the page template. Unlike flash messages, banners remain visible until the page is reloaded.
| Input Parameter | Type | Description |
|---|---|---|
message | scalar|null | The text to display |
type | scalar|null | Visual style: default, primary, secondary, success, warning, danger, or info |
publicId | scalar|null | Optional author-chosen ID stamped as data-soopio-id on the rendered banner, so Run JavaScript code can target it with Jetstack.getElement(id) |
Redirect App
Redirects the user to a different page or URL. Supports both internal presenter destinations and full external URLs.
| Input Parameter | Type | Description |
|---|---|---|
destination | string | The target — a presenter action string (e.g. Homepage:) or a full URL |
args | array | Parameters passed to the destination link |
includeSignal | bool | When true, the redirect also fires on AJAX/signal requests. Default: true |
Hide Last Modal
Closes the most recently opened modal dialog in the front-end.
No input parameters. No endpoints.
Reload UI Components
Triggers a full reload of all UI components on the current page.
No input parameters. No endpoints.
Run JavaScript
Executes arbitrary JavaScript in the user's browser at the end of the current request. The code is appended to the response payload and runs after the page renders (full page load) or after the next AJAX snippet update (signal/AJAX request).
| Input Parameter | Type | Description |
|---|---|---|
code | string|null | JavaScript source to execute. Edited in a CodeMirror textarea with JavaScript syntax highlighting. |
allowRepeat | bool | Default on: the code runs every time this action fires. Untick to enable per-page hash deduplication — identical code blocks then execute only once per page lifetime. |
A helper namespace window.Jetstack is available to the injected code, with small shortcuts for the most common UI commands so callers don't need to reproduce the Bootstrap markup:
| Helper | Description |
|---|---|
Jetstack.flashMessage(message, type, { publicId }) | Temporary toast. Types: primary, success, warning, danger, info, secondary, default. Optional publicId stamps data-soopio-id on the toast. |
Jetstack.showBanner(message, type, { publicId }) | Persistent banner in the page header area. Same type values as flash. Optional publicId stamps data-soopio-id on the banner. |
Jetstack.openModal({title, body, size}) | Opens a Bootstrap modal. body is raw HTML. size accepts sm, lg, xl, xlg (default). Returns the Bootstrap modal instance. |
Jetstack.getLastModal() | Returns { modalElement, getElement(id), getElements(id) } for the topmost open modal (or null). The nested getElement/getElements match data-soopio-id scoped to that modal only — useful when the same ID may exist both in the page behind and inside the modal. |
Jetstack.closeLastModal() | Dismisses the topmost open modal. |
Jetstack.reloadUi() | Reloads the main reloadable snippets (mirrors Reload UI Components). |
Jetstack.getElement(id) | Returns the first element on the page with data-soopio-id="<id>", or null. |
Jetstack.getElements(id) | Returns an array of all elements with data-soopio-id="<id>" (useful for canvas items rendered inside an iterator). |
Jetstack.extend(name, fn) | Registers additional helpers on the namespace, for front-end code that wants to expose its own commands to automations. |
Referencing UI components (data-soopio-id)
Soopio stamps a data-soopio-id attribute on a handful of rendered surfaces so Run JavaScript code can reliably find them. Use Jetstack.getElement(id) / Jetstack.getElements(id) to retrieve them.
Auto-generated IDs:
| Surface | Pattern |
|---|---|
Object edit form (from objectFormFactory) | object-edit-form:<typeSystemName>:<objectId> |
| Object create form | object-create-form:<typeSystemName>:new |
| Object delete form | object-delete-form:<typeSystemName>:<objectId> |
| Object custom form | object-custom-form:<typeSystemName>:<objectId> |
| Object "show" wrapper | object-show:<typeSystemName>:<objectId> |
| User profile form | object-edit-form:User:profile |
| Canvas Object form wrapper (create/edit/delete) | object-<formType>-form-wrapper:<typeSystemName>:<objectId> (objectId is new for create) |
| Canvas Custom form wrapper | custom-form-wrapper:<canvasItemId> |
| Canvas Object render | object-show:<typeSystemName>:<objectId> |
| Canvas Object overview | object-overview:<typeSystemName>:<objectId> |
| Canvas Object wrapper | object-wrapper:<typeSystemName>:<objectId> |
| Canvas Property value | object-property:<typeSystemName>:<objectId>:<propertyId> |
| Canvas Object discussion | object-comments:<typeSystemName>:<objectId> |
The <typeSystemName> is the type's system_name (e.g. User, Article); it falls back to the numeric type id only when no system_name has been set on the type.
Author-controlled IDs:
- Canvas items — set a "Public ID" on any canvas item via the builder (link-icon button next to Change title). The wrapper
<div>getsdata-soopio-id="<your-id>", overriding any auto-generated ID for that item. Inside an iterator, each rendered row is suffixed:<your-id>#<iteratorUniqueId>— useJetstack.getElements(id)to match them all, or include the exact suffix to target a single row. - Flash / Banner messages — pass a
publicIdinput parameter (or{ publicId }option to the JS helper). The toast/banner carriesdata-soopio-id="<your-id>".
Author-chosen IDs are free-form strings. Uniqueness within a page is the author's responsibility. Auto-generated IDs are applied only when the author has not set a Public ID.
Beyond these helpers, any browser API, jQuery, or Bootstrap JS call is available. Example — force-open a specific collapsible on the page:
const el = document.getElementById('editProfileCollapse');
if (el && !el.classList.contains('show')) {
document.querySelector('a[href="#editProfileCollapse"]')?.click();
}
Caveats:
allowRepeatis on by default, so the same code runs every time the action fires. Untick it to enable per-page hash deduplication — identical code blocks will then execute only once per page lifetime.- If the triggering request produces no HTML response (pure redirect, background task, JSON-only response with no script payload channel), the code is not delivered.
- The code runs with full page privileges — it is author-trusted, same as Canvas scripts. Treat
codeas privileged content.
System
Schedule a Task
Schedules an automation to run at a specific time in the future. Supports recurring execution.
| Input Parameter | Type | Description |
|---|---|---|
automation | scalar|null | The automation to schedule |
args | object|array|null | Optional parameters passed to the scheduled automation |
runAt | DateTimeInterface|string|null | When to execute. Default: now |
nextRun | string|null | Cron expression or relative time string for recurrence |
lastRun | DateTimeInterface|string|null | Expiration — the task will not run after this time |
logRuns | bool|null | When true, each execution is logged. Default: true |
| Endpoint | Provided Parameters |
|---|---|
| On success | taskData (array) — includes the scheduled task UUID |
Cancel a Task
Cancels a previously scheduled task.
| Input Parameter | Type | Description |
|---|---|---|
taskId | scalar|null | The ID, UUID, or system name of the task to cancel |
Run Automation
Executes another automation synchronously within the current flow. If the called automation uses a Return Value action, the returned value is available in the Output endpoint parameter.
| Input Parameter | Type | Description |
|---|---|---|
automation | scalar|null | The automation to run |
parameters | object|array|null | Parameters passed to the called automation |
| Endpoint | Provided Parameters |
|---|---|
| On success | return (mixed) |
Add Object Action
Dynamically adds a custom action button to an object at runtime. The action appears in the object's context menu and top buttons area.
| Input Parameter | Type | Description |
|---|---|---|
object | ActiveResource | The object to add the action to |
title | string | Label text for the action button |
cmd | string | Destination link or command |
icon | string | Bootstrap icon class |
ajax | bool | Whether the action executes via AJAX |
Create a PDF
Generates a PDF from a Canvas template. Uses Browsershot (headless Chrome) for rendering by default, with Dompdf as a fallback.
| Input Parameter | Type | Description |
|---|---|---|
canvas | scalar|null | The Canvas template to render |
css | scalar|null | Optional CSS file from the tenant's custom styles |
paper | scalar|null | Paper size: A0-A6, Letter, Legal, Tabloid, Ledger. Default: A4 |
orientation | scalar|null | Portrait or Landscape. Default: portrait |
margin | scalar|null | Margins applied to all sides in millimeters |
legacyRendering | bool|null | Force Dompdf rendering instead of Browsershot. Default: false |
context | ActiveResource|null | Optional object set as the Canvas wrapper context |
vars | object|array|null | Key-value pairs passed to the Canvas |
| Endpoint | Provided Parameters |
|---|---|
| On success | file (string) — path to the generated PDF |
Log Event
Creates an entry in the system event log.
| Input Parameter | Type | Description |
|---|---|---|
object | ActiveResource|object|array|null | Related object — an ActiveResource or [type, id] array |
category | scalar|null | Event category (from predefined system categories) |
title | scalar|null | Short title for the event |
content | scalar|null | Detailed description |
data | mixed | Additional data to attach |
Dump Data to Local Storage
Writes a JSON-encoded message to the tenant's local log file.
| Input Parameter | Type | Description |
|---|---|---|
message | mixed | The value to log (JSON-encoded before writing) |
Bar Dump
Dumps a variable to the Tracy debug bar for inspection. Only visible to superuser roles when the debugger is enabled.
| Input Parameter | Type | Description |
|---|---|---|
var | mixed | The value to dump |
title | string|null | Optional label shown in the debug bar |
PHP
Executes custom PHP code in a sandboxed environment. The code has access to the Internal API and any input parameters.
| Input Parameter | Type | Description |
|---|---|---|
code | string|null | PHP source code. The <?php tag is stripped automatically. Available variables: $api (Internal API), plus any keys from Inputs. |
parameters | object|array|null | Key-value pairs available as variables inside the script |
| Endpoint | Provided Parameters |
|---|---|
| On success | return (mixed) |
Convert Markdown to HTML
Renders a Markdown source string as HTML using the league/commonmark library.
| Input Parameter | Type | Description |
|---|---|---|
markdown | string|null | The Markdown source to render |
flavor | string|null | gfm (GitHub Flavored Markdown — tables, strikethrough, task lists, autolinks) or commonmark (strict CommonMark). Default: gfm |
| Endpoint | Provided Parameters |
|---|---|
| On success | html (string) |
Convert HTML to Markdown
Converts an HTML string to Markdown using the league/html-to-markdown library.
| Input Parameter | Type | Description |
|---|---|---|
html | string|null | The HTML source to convert |
options | object|array|null | Optional key-value pairs forwarded to HtmlConverter (e.g. header_style, strip_tags, hard_break, list_item_style, remove_nodes) |
| Endpoint | Provided Parameters |
|---|---|
| On success | markdown (string) |
Login As User
Impersonates another user by switching the current session. Requires the loginAs system permission and the target must be a subordinate by role hierarchy.
| Input Parameter | Type | Description |
|---|---|---|
user | User|string|int|null | The user to impersonate — a User object, user ID, or UUID |
redirect | bool | Whether to redirect after switching. Default: true |
destination | string | Redirect target (shown when redirect is true). Default: Homepage: |
args | array | Redirect link arguments (shown when redirect is true) |
includeSignal | bool | Whether redirect fires on AJAX requests (shown when redirect is true). Default: true |
AI
Prompt a Model
Calls an external AI model and stores results into automation variables. Prompts support template placeholders like {{vars.myVar}} and {{steps.output}}.
| Input Parameter | Type | Description |
|---|---|---|
provider_id | string | AI provider (e.g. OpenAI, Anthropic, Gemini) |
model_id | string | Model to use (e.g. gpt-5, claude-sonnet-4-6) |
api_key_ref | string|null | Optional API key secret reference (overrides default) |
system_instructions | string|null | High-level guidance for the model (role, tone, rules) |
prompt | string|null | The main user request (required unless context blocks are provided) |
context_blocks | object|array|null | Extra context sections appended before the prompt |
response_format | string|null | Expected output type: text, json, or json_schema. Default: text |
response_format_schema | object|array|null | JSON Schema for structured output (only when response_format is json_schema) |
reasoning_effort | string|null | Reasoning effort level for supported models: minimal, low, medium, high. Default: medium |
delivery | string|null | wait (synchronous) or callback (asynchronous). Default: wait |
callback_url | string|null | Callback URL for async delivery |
temperature | float|null | Creativity control (lower = more deterministic). Default: 0.4 |
params | object|array|null | Additional model tuning: top_p, frequency_penalty, presence_penalty, max_output_tokens |
advanced | object|array|null | Transport and safety settings: timeout_ms, retries, backoff_ms, stop_sequences, streaming, repair_json, context_max_chars |
| Endpoint | Provided Parameters |
|---|---|
| On success | text (string|null), json (mixed), usage (array|null), finish_reason (string|null) |
| On dispatched | runId (string|null), provider (string|null), model (string|null), callbackUrl (string|null) — only for async delivery |
Common Endpoints
Most actions inherit three standard endpoints from the base action class:
| Endpoint | Provided Parameters | Description |
|---|---|---|
| On success | — | Called when the action completes without errors (unless the action explicitly calls it with custom parameters) |
| On error | code (int), message (string) | Called when the action throws an exception |
| Completed | — | Always called after the action finishes, regardless of success or error |
Some actions do not inherit these standard endpoints because they serve a specific purpose that does not fit the success/error/complete pattern. These include: Redirect, Bar dump, Hide last modal, Reload UI components, Dump data to local storage, Log event, and Publish Server-Sent Event.
Practical Design Guidance
- Start with Object Operations and Control Structures. Most automations center on reading, creating, or updating objects, with IF conditions and loops directing the flow.
- Use Variables to simplify complex workflows. When several actions depend on the same derived value, assign it to a variable once rather than repeating the expression.
- Prefer Run Automation over duplicating action sequences. Extract reusable logic into a separate automation and call it with Run Automation. Use Return Value to pass results back.
- Choose the right notification channel. Use Flash Message for immediate UI feedback, Send a Notification for persistent in-app alerts, Send an E-mail for external communication, and Publish Server-Sent Event for real-time front-end updates.
- Use Abort Parent Operation for validation. When an automation is triggered by a create or update event and the operation should be prevented, use Abort Parent Operation rather than trying to reverse the change.
- Schedule deferred work with Schedule a Task. When work should happen later or recurrently, schedule it rather than blocking the current request.
- Debug with Bar Dump and Dump Data to Local Storage. Use Bar Dump for interactive debugging during development and local storage logging for production troubleshooting.