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:

  1. Control Structures
  2. Loops
  3. Variables
  4. Database
  5. Object Operations
  6. Files
  7. Notifications & Mailing
  8. Network Communication
  9. Front-end UI Control
  10. System
  11. 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 ParameterTypeDescription
conditionmixedBoolean expression. Non-bool results are coerced via PHP truthiness — empty string, null, 0, empty array count as false; everything else is true.
EndpointProvided 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 condition expression like trigger("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 ParameterTypeDescription
amixedLeft-hand side operand
operatorstringComparison operator
bmixedRight-hand side operand

Available operators: =, >, >=, <, <=, !=, contains, containsKey, isIn, isTrue, isFalse, isNull, isIterable, isFile, isEmail, isEmpty.

EndpointProvided Parameters
If true
ORif_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 ParameterTypeDescription
valuemixedThe value to test
casesiterableIterable of case values — see Modes below
EndpointProvided 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 ParameterTypeDescription
continueMainFlowboolWhen true, the automation continues executing after the waitpoint is created. When false, execution suspends entirely until the callback is received.
timeoutAfterstring|nullOptional date/time expression. If the callback is not received by this time, the Timeout endpoint is triggered.
EndpointProvided Parameters
StartedasyncRunId (string), callbackUrl (string), callbackToken (string), timeoutAt (string|null)
TimeoutasyncRunId (string), timeoutAt (string|null)
CompletedasyncRunId (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 ParameterTypeDescription
targetscalar|nullThe target action to run (selected from actions in the current automation)
argsobject|array|nullArguments 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 ParameterTypeDescription
valuemixedThe 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 ParameterTypeDescription
iterableiterableThe array or iterable to loop over
EndpointProvided Parameters
With each iterationkey (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 ParameterTypeDescription
iterablemixedAn expression that is re-evaluated each cycle; the loop continues while it is truthy
EndpointProvided Parameters
With each iterationvalue (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 ParameterTypeDescription
variablestringThe name of the variable to set
valuemixedThe 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 ParameterTypeDescription
variablestringThe name of the variable to append to
valuemixedThe value to append
keepExistingKeysboolWhen 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 ParameterTypeDescription
variablestringThe template variable name
valuemixedThe 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 ParameterTypeDescription
objectmixedThe object whose property will be updated
propertyscalar|nullThe name of the property to change
valuemixedThe 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 ParameterTypeDescription
objectiterable|nullThe object whose properties will be patched
valueiterable|nullAn 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 ParameterTypeDescription
querystring|nullThe SQL query to execute. Supports niceSql syntax for table/column name resolution.
parametersobject|array|nullOptional query parameters for safe value binding
returnAsObjectsboolWhen true, SELECT results are converted to ActiveResource objects. Default: true
EndpointProvided Parameters
On successdata (array), count (int)
Has datadata (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 ParameterTypeDescription
typescalar|nullThe object type to create
dataiterable|stdClass|nullProperty-name to value pairs for the new object
saveboolWhen true, the object is persisted immediately. Default: true
skipApiEventsboolWhen true, API events (automations triggered by create) are not fired. Default: false
EndpointProvided Parameters
On successobject (ActiveResource)

Get Object

Retrieves a single object by its ID, UUID, or system name.

Input ParameterTypeDescription
typescalar|nullThe object type to look up
idscalar|nullThe identifier of the object
EndpointProvided Parameters
On successobject (ActiveResource)

List Objects

Retrieves a list of objects of the specified type. Filter using either a saved Query or inline Conditions.

Input ParameterTypeDescription
typescalar|nullThe object type to list
queryscalar|nullAn optional saved Query to use as the filter
contextActiveResource|nullAn optional context object (e.g. parent object for relational queries)
conditionsobject|array|nullInline filter conditions. Each condition: [property, operator, value]
orderscalar|nullProperty name to sort results by
orderDirstringSort direction: ASC or DESC. Default: ASC
skipApiEventsboolWhen true, API events are not fired during listing. Default: false
EndpointProvided Parameters
On successobjects (array), count (int)
Has datadata (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 ParameterTypeDescription
objectActiveResource|nullThe object to update (if provided, type and id are ignored)
typescalar|nullThe object type (used if object is not provided)
idscalar|nullThe identifier (used if object is not provided)
dataiterable|stdClass|nullProperty-name to value pairs to update
saveboolWhen true, persisted immediately. Default: true
skipApiEventsboolWhen true, API events are not fired. Default: false
EndpointProvided Parameters
On successobject (ActiveResource)

Delete Object

Deletes an existing object from the database. Provide the object directly or look it up by type and ID.

Input ParameterTypeDescription
objectActiveResource|nullThe object to delete (if provided, type and id are ignored)
typescalar|nullThe object type (used if object is not provided)
idscalar|nullThe identifier (used if object is not provided)
skipApiEventsboolWhen 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 ParameterTypeDescription
objectActiveResource|nullThe object to act on (if provided, type and id are ignored)
typescalar|nullThe object type (used if object is not provided)
idscalar|nullThe identifier (used if object is not provided)
actionIdscalar|nullThe action to perform (selected from the object type's registered actions)
argsobject|array|nullOptional parameters passed to the action
EndpointProvided Parameters
On successobject (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 ParameterTypeDescription
objectActiveResource|nullThe source object (if provided, type and id are ignored)
typescalar|nullThe source object type (used if object is not provided)
idscalar|nullThe source identifier (used if object is not provided)
targetTypescalar|nullThe type to create the new object as
mappingobject|array|nullOptional property-name mapping (source name to target name)
skipApiEventsboolWhen true, API events are not fired. Default: false
EndpointProvided Parameters
On successobject (ActiveResource)

Files

Store Local File

Saves a file to a local storage location.

Input ParameterTypeDescription
namescalar|nullThe name to assign to the stored file (required)
sourcescalar|nullThe path to the file to store
namespacescalar|nullOptional category or folder name
EndpointProvided Parameters
Successfilename (string)

Write to Local File

Writes data to a file in local storage. Can create a new file or update an existing one.

Input ParameterTypeDescription
namescalar|nullThe name of the file (required)
datascalar|nullThe content to write
namespacescalar|nullOptional category or folder name
appendbool|nullWhen true, data is appended instead of overwriting. Default: false
EndpointProvided Parameters
Successfilename (string)

Read Local File

Retrieves the contents of a locally stored file.

Input ParameterTypeDescription
namescalar|nullThe name of the file to read (required)
namespacescalar|nullOptional category or folder name
EndpointProvided Parameters
Successdata (string)

Initiate a File Download

Initiates a file download for the user.

Input ParameterTypeDescription
namescalar|nullThe name to give the downloaded file
sourcescalar|nullThe path to the file to download
namespacescalar|nullOptional 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 ParameterTypeDescription
fromstring|nullSender address. Format: "Display Name" address@example.com or just address@example.com
tostring|nullComma-separated list of recipients
replyTostring|nullReply-to address
subjectstring|nullSubject line
templatestring|nullSaved e-mail template (if provided, Message body is ignored). Template must be active.
bodystring|nullInline HTML body (only used when no template is selected). Supports Latte syntax.
attachmentsobject|string|array|nullFile objects or file paths to attach
varsobject|array|nullKey-value pairs passed to the template for rendering
sendNowboolWhen 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 ParameterTypeDescription
titlescalar|nullNotification title (required)
contentscalar|nullHTML content
classesobject|array|nullOptional CSS classes
linkarray|scalar|nullURL or route array the notification links to
pinnedbool|nullWhether the notification stays pinned until dismissed
validFromscalar|nullOptional visibility start time
validToscalar|nullOptional visibility end time
recipientIdUserscalar|nullSend to a specific user
recipientIdGroupscalar|nullSend to all users in a group
recipientIdRolescalar|nullSend to all users with a role
recipientCustomIdscalar|nullSend to a custom recipient identifier
EndpointProvided Parameters
On successnotification (Notification)

Send an Expo Notification

Sends a push notification to a mobile device via the Expo Push Notification service.

Input ParameterTypeDescription
tokenarray|scalar|nullExpo Push Token(s)
titlestring|nullNotification title
contentstring|nullNotification body text
paramsobject|array|nullAdditional Expo notification parameters (badge, sound, data, etc.)
sendNowboolWhen true, sent immediately. Otherwise queued for cron. Default: true

Send an SMS

Sends an SMS text message via the configured SMS gateway.

Input ParameterTypeDescription
toarray|scalar|nullPhone number(s)
textstring|nullSMS text content
sendNowboolWhen 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 ParameterTypeDescription
urlstring|nullTarget URL
methodstring|nullHTTP method: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, or SEARCH. Default: GET
typestring|nullBody encoding: json or formfields. Default: json
headersobject|array|nullCustom HTTP headers as key-value pairs
dataobject|array|nullRequest body data
EndpointProvided Parameters
On successcode (int), content (string|null)

Send JSON Response

Sends a JSON response back to the client. The content type is set to application/json.

Input ParameterTypeDescription
jsonarray|object|nullThe data to encode and return as JSON
httpCodescalar|nullHTTP status code

Send Response

Sends a response with a custom content type. More flexible than Send JSON Response.

Input ParameterTypeDescription
payloadmixedThe response body
httpCodescalar|nullHTTP status code
contentTypescalar|nullMIME 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 ParameterTypeDescription
channelarray|string|nullChannel name(s) to publish to
messagemixedMessage 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 ParameterTypeDescription
idmixedCzech company identification number (ICO)
EndpointProvided Parameters
On successdata (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 ParameterTypeDescription
urlstring|nullURL to stream JSON from
jsonPointerstring|nullJSON Pointer to select a specific part of the document (e.g. /data/items). Default: root
EndpointProvided Parameters
For each itemkey (scalar|null), value (mixed) — supports Break loop and Continue loop
On completecount (int)

Front-end UI Control

Flash Message

Displays a temporary flash message to the user.

Input ParameterTypeDescription
messagescalar|nullThe text to display
typescalar|nullVisual style: default, primary, secondary, success, warning, danger, or info
publicIdscalar|nullOptional author-chosen ID stamped as data-soopio-id on the rendered toast, so Run JavaScript code can target it with Jetstack.getElement(id)

Displays a persistent banner message in the page template. Unlike flash messages, banners remain visible until the page is reloaded.

Input ParameterTypeDescription
messagescalar|nullThe text to display
typescalar|nullVisual style: default, primary, secondary, success, warning, danger, or info
publicIdscalar|nullOptional 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 ParameterTypeDescription
destinationstringThe target — a presenter action string (e.g. Homepage:) or a full URL
argsarrayParameters passed to the destination link
includeSignalboolWhen 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 ParameterTypeDescription
codestring|nullJavaScript source to execute. Edited in a CodeMirror textarea with JavaScript syntax highlighting.
allowRepeatboolDefault 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:

HelperDescription
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:

SurfacePattern
Object edit form (from objectFormFactory)object-edit-form:<typeSystemName>:<objectId>
Object create formobject-create-form:<typeSystemName>:new
Object delete formobject-delete-form:<typeSystemName>:<objectId>
Object custom formobject-custom-form:<typeSystemName>:<objectId>
Object "show" wrapperobject-show:<typeSystemName>:<objectId>
User profile formobject-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 wrappercustom-form-wrapper:<canvasItemId>
Canvas Object renderobject-show:<typeSystemName>:<objectId>
Canvas Object overviewobject-overview:<typeSystemName>:<objectId>
Canvas Object wrapperobject-wrapper:<typeSystemName>:<objectId>
Canvas Property valueobject-property:<typeSystemName>:<objectId>:<propertyId>
Canvas Object discussionobject-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> gets data-soopio-id="<your-id>", overriding any auto-generated ID for that item. Inside an iterator, each rendered row is suffixed: <your-id>#<iteratorUniqueId> — use Jetstack.getElements(id) to match them all, or include the exact suffix to target a single row.
  • Flash / Banner messages — pass a publicId input parameter (or { publicId } option to the JS helper). The toast/banner carries data-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:

  • allowRepeat is 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 code as privileged content.

System

Schedule a Task

Schedules an automation to run at a specific time in the future. Supports recurring execution.

Input ParameterTypeDescription
automationscalar|nullThe automation to schedule
argsobject|array|nullOptional parameters passed to the scheduled automation
runAtDateTimeInterface|string|nullWhen to execute. Default: now
nextRunstring|nullCron expression or relative time string for recurrence
lastRunDateTimeInterface|string|nullExpiration — the task will not run after this time
logRunsbool|nullWhen true, each execution is logged. Default: true
EndpointProvided Parameters
On successtaskData (array) — includes the scheduled task UUID

Cancel a Task

Cancels a previously scheduled task.

Input ParameterTypeDescription
taskIdscalar|nullThe 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 ParameterTypeDescription
automationscalar|nullThe automation to run
parametersobject|array|nullParameters passed to the called automation
EndpointProvided Parameters
On successreturn (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 ParameterTypeDescription
objectActiveResourceThe object to add the action to
titlestringLabel text for the action button
cmdstringDestination link or command
iconstringBootstrap icon class
ajaxboolWhether 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 ParameterTypeDescription
canvasscalar|nullThe Canvas template to render
cssscalar|nullOptional CSS file from the tenant's custom styles
paperscalar|nullPaper size: A0-A6, Letter, Legal, Tabloid, Ledger. Default: A4
orientationscalar|nullPortrait or Landscape. Default: portrait
marginscalar|nullMargins applied to all sides in millimeters
legacyRenderingbool|nullForce Dompdf rendering instead of Browsershot. Default: false
contextActiveResource|nullOptional object set as the Canvas wrapper context
varsobject|array|nullKey-value pairs passed to the Canvas
EndpointProvided Parameters
On successfile (string) — path to the generated PDF

Log Event

Creates an entry in the system event log.

Input ParameterTypeDescription
objectActiveResource|object|array|nullRelated object — an ActiveResource or [type, id] array
categoryscalar|nullEvent category (from predefined system categories)
titlescalar|nullShort title for the event
contentscalar|nullDetailed description
datamixedAdditional data to attach

Dump Data to Local Storage

Writes a JSON-encoded message to the tenant's local log file.

Input ParameterTypeDescription
messagemixedThe 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 ParameterTypeDescription
varmixedThe value to dump
titlestring|nullOptional 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 ParameterTypeDescription
codestring|nullPHP source code. The <?php tag is stripped automatically. Available variables: $api (Internal API), plus any keys from Inputs.
parametersobject|array|nullKey-value pairs available as variables inside the script
EndpointProvided Parameters
On successreturn (mixed)

Convert Markdown to HTML

Renders a Markdown source string as HTML using the league/commonmark library.

Input ParameterTypeDescription
markdownstring|nullThe Markdown source to render
flavorstring|nullgfm (GitHub Flavored Markdown — tables, strikethrough, task lists, autolinks) or commonmark (strict CommonMark). Default: gfm
EndpointProvided Parameters
On successhtml (string)

Convert HTML to Markdown

Converts an HTML string to Markdown using the league/html-to-markdown library.

Input ParameterTypeDescription
htmlstring|nullThe HTML source to convert
optionsobject|array|nullOptional key-value pairs forwarded to HtmlConverter (e.g. header_style, strip_tags, hard_break, list_item_style, remove_nodes)
EndpointProvided Parameters
On successmarkdown (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 ParameterTypeDescription
userUser|string|int|nullThe user to impersonate — a User object, user ID, or UUID
redirectboolWhether to redirect after switching. Default: true
destinationstringRedirect target (shown when redirect is true). Default: Homepage:
argsarrayRedirect link arguments (shown when redirect is true)
includeSignalboolWhether 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 ParameterTypeDescription
provider_idstringAI provider (e.g. OpenAI, Anthropic, Gemini)
model_idstringModel to use (e.g. gpt-5, claude-sonnet-4-6)
api_key_refstring|nullOptional API key secret reference (overrides default)
system_instructionsstring|nullHigh-level guidance for the model (role, tone, rules)
promptstring|nullThe main user request (required unless context blocks are provided)
context_blocksobject|array|nullExtra context sections appended before the prompt
response_formatstring|nullExpected output type: text, json, or json_schema. Default: text
response_format_schemaobject|array|nullJSON Schema for structured output (only when response_format is json_schema)
reasoning_effortstring|nullReasoning effort level for supported models: minimal, low, medium, high. Default: medium
deliverystring|nullwait (synchronous) or callback (asynchronous). Default: wait
callback_urlstring|nullCallback URL for async delivery
temperaturefloat|nullCreativity control (lower = more deterministic). Default: 0.4
paramsobject|array|nullAdditional model tuning: top_p, frequency_penalty, presence_penalty, max_output_tokens
advancedobject|array|nullTransport and safety settings: timeout_ms, retries, backoff_ms, stop_sequences, streaming, repair_json, context_max_chars
EndpointProvided Parameters
On successtext (string|null), json (mixed), usage (array|null), finish_reason (string|null)
On dispatchedrunId (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:

EndpointProvided ParametersDescription
On successCalled when the action completes without errors (unless the action explicitly calls it with custom parameters)
On errorcode (int), message (string)Called when the action throws an exception
CompletedAlways 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.