Documentation Index
Fetch the complete documentation index at: https://docs.prisme.ai/llms.txt
Use this file to discover all available pages before exploring further.

Understanding Automations
- What are Automations?
- Automation Architecture
In simple words, automations describe what to do and when:
- What to do: A sequence of instructions that process data and perform actions
- When to do it: Triggers that activate the automation when specific conditions are met
- The what would be a fetch instruction calling Slack API to send a message
- The when would be a URL (webhook) trigger that Hubspot calls whenever a new deal is opened
Automation YAML Syntax
Every automation is a YAML file. The visual editor reads and writes that same file, so understanding the syntax is what unlocks the rest of the platform.File anatomy
A minimal automation:| Top-level key | Purpose |
|---|---|
slug | URL-safe identifier. Must be unique inside the workspace. Used in API paths and event sources. |
name | Human-readable label shown in the sidebar. |
description | Optional free text shown in the workspace overview and app store. |
arguments | Schema for the inputs the automation expects when called directly (see Arguments). |
when | Trigger configuration: endpoint, events, schedules (see Triggers). |
do | Ordered list of instructions to execute. |
output | Expression returned to the caller after do completes. |
validateArguments | When true, the runtime rejects calls whose inputs do not match the arguments schema. |
private | When true, the automation cannot be called from outside the workspace (only via runWorkflow from another automation). |
disabled | When true, the automation is registered but never executes. |
labels | Free-form tags used for organization. |
Indentation and structure rules
YAML structure is significant. Three rules cover 95 % of the mistakes the editor will surface.- Indentation is spaces, not tabs. Two spaces per level is the convention used everywhere in this documentation. Mixing tabs and spaces fails parsing.
- A list item starts with
-at the parent’s indentation level. The contents of the item are indented one more level. - A key always ends with
:and a single space before its value (except when the value is on the next line).
:, #, {, [, &, *, !, |, >, ', ", %, @, `` `), wrap it in single or double quotes.
Naming and casing conventions
| Element | Convention | Examples |
|---|---|---|
slug | kebab-case or camelCase, no spaces | send-welcome, sendWelcome |
name | free text | Send welcome email |
Variable names (set: name: …) | camelCase | userEmail, nextStep |
Event names (emit: event: …) | dot-separated, lowercase | app.greeting.requested |
Module names in run | lowercase | secrets, collections, accessManager, text |
Interpreted keywords
Insidedo: and other instruction lists, these keys are interpreted by the runtime. Any other key is treated as an app or workspace automation call (see Visual Editor and YAML Mapping).
| Keyword | Effect |
|---|---|
set | Assign a variable. |
delete | Remove a variable. |
emit | Publish an event. |
fetch | Make an HTTP request. |
wait | Pause until an event arrives or a timeout elapses. |
conditions | Branch on expressions. The keys of the map are the conditions themselves; default runs if none match. |
repeat | Loop over a collection (on:) or a fixed count (until:). |
break | Exit the current loop or the whole automation. |
all | Execute child branches in parallel. |
try / catch | Catch errors raised by child instructions. |
run | Call a built-in runtime module function. |
runWorkflow | Call another automation in the workspace. |
comment | Free-form annotation, ignored at runtime. |
rateLimit, auth, createUserTopic, joinUserTopic | Specialized runtime instructions; see the table in Visual Editor and YAML Mapping. |
Expressions: {{ … }} and {% … %}
Anywhere a value is expected, you can interpolate an expression.
{{ … }}evaluates and substitutes a single expression. The whole value is replaced by the result.{% … %}evaluates an arithmetic or logical sub-expression while keeping the rest of the string.
Variable scopes
Variables live in different scopes with different lifetimes. Each scope is exposed as a top-level object in expressions.| Scope | Prefix in expressions | Lifetime | Use it for |
|---|---|---|---|
| Run / temporary | none ({{myVar}}) | One automation run | Local working values inside do. |
| Session | {{session.x}} | One user session | State shared across runs of the same user session. |
| User | {{user.x}} | One user | Per-user persistent state. |
| Global / workspace | {{global.x}} | Workspace, all users | Shared counters, caches, feature flags. |
| Config | {{config.x}} | Workspace static config | Non-sensitive parameters defined in the workspace index.yml. |
| Secret | {{secret.x}} | Workspace, encrypted | Sensitive values from Settings → Secrets. |
| Trigger input | {{body}}, {{headers}}, {{query}}, {{pathParams}}, {{method}}, {{event}} | One run | Inputs from the request or event that triggered the automation. |
What the YAML editor reports
The Builder’s Monaco editor validates the YAML as you type, using the same schema the runtime applies on save.- Indentation / parsing errors are flagged on the offending line. Fix them before save — the editor blocks the save button.
- Schema errors (unknown keyword, wrong type for a field) are surfaced with the path of the offending field.
- Lint warnings (e.g. an unused variable, a duplicate slug) appear inline but do not block saving.
Triggers
Automations can be activated through different types of triggers, configured at the top of the automation graph:URL (Webhook/API Endpoint)
URL (Webhook/API Endpoint)
When an automation activates its URL trigger, it becomes publicly available through a URL which you can copy from your Workspace graph or source code. You can then use this URL in external services that support webhooks.From inside the automation, 5 variables give access to input HTTP requests:
Example :By default, these HTTP requests will receive the automation output as a response body. However, an $http variable available inside the automation gives full control over the response:You can also use this variable to implement Server-Sent Events (SSE) for streaming responses:For long-running SSE endpoints, you can configure a keep-alive to avoid timeouts:After this instruction, a When a request is made to Request to Multi-segment Parameters (wildcards):Use Request to
- body: Request body
- headers: Request headers
- method: HTTP method (GET, POST, etc.)
- query: URL query parameters
- pathParams: Extracted path parameter values (when using path parameters like
:id)
body.<fileKey> object variable.Example :
- $http is only available in the URL-triggered automation (not in children calls)
- Headers cannot be set after the first chunk is sent
- When using SSE events, the automation output will also be sent as the last event
- SSE automatically sets appropriate headers (Content-Type, Cache-Control, Connection)
data: {"keepAlive": true} chunk will be regularly emitted until the connection ends.Path Parameters
Webhook endpoints support path parameters for building RESTful APIs. Path parameters allow you to define dynamic URL segments that extract values from incoming requests.Basic Usage:get-user
/webhooks/{workspaceSlug}/v1/users/123, the automation receives:pathParams.id="123"
get-user-post
/webhooks/{workspaceSlug}/v1/users/alice/posts/456 results in:pathParams.userId="alice"pathParams.postId="456"
update-user
*paramName instead of :paramName when the value can contain slashes — for instance, model identifiers like openai/text-embedding-3-large or hierarchical paths.get-model
/webhooks/{workspaceSlug}/v1/models/openai/text-embedding-3-large yields:pathParams.model_id="openai/text-embedding-3-large"
/webhooks/{workspaceSlug}/v1/models/gpt-4o (no slash) matches the same endpoint with pathParams.model_id = "gpt-4o".Path Parameter Behavior:
- Single-segment parameters use
:paramNamesyntax (e.g.,:id,:userId) — they match one URL segment and reject values containing/ - Multi-segment parameters use
*paramNamesyntax — they match one or more segments and let you capture values containing/ - All defined parameters are required - requests missing parameters will not match
- Parameter values are automatically URL-decoded
- Exact match endpoints take priority over pattern endpoints
- When multiple patterns could match, the first defined pattern wins
- Patterns like
message:stream(colon without preceding slash) are treated as exact matches, not patterns
Events
Events
An automation can listen to a list of events. Whenever such events are received, the automation is executed and can access:
- payload: Event payload data
- source: Event source information (source IP, correlationId, userId, automation, etc.)
- Native events: Generated automatically by the platform
- Custom events: Emitted from automations in the same workspace
- App events: Emitted from installed Apps
Workspaces can only listen to a specific subset of native events. See the Supported Native Events section for details.
Schedules
Schedules
An automation can be regularly triggered based on cron expressions:A helpful tool for creating cron expressions is crontab.guru.
- Automations can be scheduled at most every 15 minutes
- Schedules use UTC timezone
- When scheduled, the automation runs “on the hour” (e.g., a 20-minute schedule starting at 3:14 will run at 3:20, 3:40, etc.)
- When successfully scheduled, a
runtime.automations.scheduledevent is emitted
Memory Architecture
Automations can use and modify data across different memory scopes:Run Scope
Run Scope
Available only during current execution
{{run.variable}}
Run variables include execution context like:run.date: Current timestamprun.ip: Client IP addressrun.automationSlug: Current automation identifierrun.correlationId: Unique ID for tracing related eventsrun.depth: Current automation depth in the stacktracerun.trigger.type: Trigger type (event, endpoint, automation)run.trigger.value: Trigger value (event name, endpoint path, etc.)run.socketId: Current socket ID if connected by websocketrun.appSlug: Current app slug if running from an appInstancerun.appInstanceSlug: Current appInstance slug if applicablerun.parentAppSlug: Parent app slug if parent is also an appInstance
User Scope
User Scope
Persistent for the authenticated user
{{user.variable}}User variables include:user.id: Unique user identifieruser.email: User’s email addressuser.authData: Authentication informationuser.role: User’s role in the workspace- Custom user-specific data that persists across sessions
Session Scope
Session Scope
Available for the current user session
{{session.variable}}Session variables include:session.id: Current session ID- Custom session data
- Form inputs across multiple steps
- Wizard progress state
- Temporary preferences
Global Scope
Global Scope
Shared across all users and executions
{{global.variable}}Global variables include:global.workspaceId: Current workspace IDglobal.workspaceName: Current workspace nameglobal.apiUrl: Current API instance public URLglobal.studioUrl: Current studio instance public URLglobal.pagesUrl: Current workspace pages public URLglobal.pagesHost: Current pages instance base domainglobal.endpoints: Map of available endpoint slugs to URLsglobal.workspacesRegistry: Map of public workspaces- Custom workspace-wide variables
Socket Scope
Socket Scope
Available for the current websocket connection
{{socket.variable}}Socket scope provides a temporary state local to a websocket connection, useful for separating state between multiple browser tabs. This context automatically expires after 6 hours without any updates.Config Scope
Config Scope
Workspace and app configuration
{{config.variable}}Contains the workspace configuration defined in the workspace settings.$workspace Scope
$workspace Scope
Read-only workspace information
{{$workspace.variable}}This read-only context holds the current workspace definition, allowing access to any of its sections (e.g., installed apps config via $workspace.imports.myApp.config).Except for $workspace, all these contexts can be written to using the
set instruction. Written data will be persisted and available in subsequent requests. However, when setting variables inside session/user contexts from an unauthenticated webhook, they will not be persisted.Working with Variables
Inside your automation instructions, dynamic data can be injected by surrounding a variable name with double braces:{{some.variable.name}}.
Variables can be created and modified using the set instruction and removed using the delete instruction.
For objects or arrays, you can access specific properties:
session.myObjectVariable equals {"mickey": "house"} and item.field equals mickey, the entire expression resolves to house.
Visual Editor and YAML Mapping
Every automation has two equivalent representations:- YAML — the source of truth, stored in the workspace and synchronized with Git.
- Visual graph — a node-based editor that reads and writes the same YAML.
Trigger nodes (Start)
The single Start node represents the automation’swhen block. Its visual sub-labels reflect which trigger fields are populated.
| Visual node | Sub-label | DSUL field | Notes |
|---|---|---|---|
| Start → Webhook | ”Webhook” | when.endpoint: true (or a custom string slug) | Exposes the automation as POST /webhooks/<slug>. |
| Start → Event | event names, comma-separated | when.events: [eventName, ...] | The automation runs whenever a matching event is emitted on the workspace bus. |
| Start → Schedule | cron expression | when.schedules: [cron, ...] | Standard 5-field cron syntax. |
Instruction nodes
Each instruction node serializes to a single DSUL key. The table below lists every node available in the editor’s “Add instruction” panel and the YAML it produces.| Visual node | DSUL key | Main fields | Use it for |
|---|---|---|---|
| Set Variable | set | name, value | Assign or update a variable in any scope. |
| Delete Variable | delete | name | Remove a variable from a scope. |
| Emit Event | emit | event, payload, optional target | Publish an event on the workspace bus. |
| HTTP Request | fetch | url, method, headers, body, query, output | Call any HTTP API. Resolves $secret: references automatically. |
| Wait | wait | timeout, oneOf | Pause until an event arrives or a timeout elapses. |
| Conditions | conditions | map of expression: [instructions] plus optional default | Branching. The visual editor renders one Branch node per key and a Merge node where branches reconverge. Full operator and helper grammar in Condition and Expression syntax. |
| Repeat | repeat | on (collection) or until (count/expression), do | Iterate over a list or loop a fixed number of times. Inside the body, {{item}} and {{$index}} are available. |
| Break | break | scope (automation | repeat), optional payload | Exit early from the current loop or automation. |
| Note (Comment) | comment | string | Documentation only — no runtime effect. |
| Parallel (All) | all | do: [instructions] | Execute branches concurrently and wait for all of them. |
| Try / Catch | try | do, catch | Recover from errors raised by inner instructions. |
| Run Module | run | module, function, parameters, output | Call a built-in runtime module (e.g. secrets, collections). |
| Run Workflow | runWorkflow | workflow, parameters, output | Call another automation in the same workspace. |
| Rate Limit | rateLimit | name, limit, window, output | Enforce a sliding-window rate limit. |
| Auth Token | auth | workspace (bool), output | Issue a short-lived JWT for the current user or workspace. |
| Create User Topic | createUserTopic | topic, userIds | Create a multi-user real-time topic. |
| Join User Topic | joinUserTopic | topic | Subscribe the current user to an existing topic. |
| End | output (top-level key) | expression | The single End node maps to the automation’s top-level output field — i.e. the value returned to the caller. |
App and workspace automation calls
Beyond the built-in nodes above, the editor also lets you drop any imported app action or any other automation in the same workspace.- An imported app action is rendered as
<App name> → <action>and serializes to the action’s slug, e.g.mySlackInstance.sendMessage. - A workspace automation call uses its slug directly.
Visual-only nodes
A few nodes appear in the graph but have no DSUL counterpart — they exist purely to organize the canvas:- Branch — one per key inside a
conditionsblock; renders the condition expression. - Merge — converges all branches of a
conditionsorallblock.
conditions / all.
Instructions
Once triggered, automations execute a sequence of instructions in order. Here are the available instructions:Logic Instructions
Condition
Condition
Conditionally execute instructions based on variable values or expressions.More details on condition syntax
Repeat
Repeat
Loop through items or execute instructions multiple times.You can also process batches in parallel:
Break
Break
Stop execution of the current automation or loop.When
break is meant to be handled from a parent automation’s try/catch, scope must be set to all.If using the instruction like this : - break: {}, it will default to scope: automation.All
All
Execute multiple operations in parallel.
Try/Catch
Try/Catch
Handle errors gracefully.The
$error variable is accessible both inside and outside the catch block.Data Instructions
Set Instruction
Set Instruction
Create or update variables in different scopes.Like everywhere else, you can also use expressions in the value parameter:
- Basics
- Objects
- Array
Delete Instruction
Delete Instruction
Remove variables when no longer needed.
Integration Instructions
Fetch Instruction
Fetch Instruction
Make HTTP requests to external APIs.
- Basics
- Output options
- multipart/form-data
- application/x-www-form-urlencoded
- HTTP SSE (Server Side Events)
- AWS SigV4
Emit Instruction
Emit Instruction
Trigger events for UI updates or other automations.
- Basics
- Target
- Options
Wait Instruction
Wait Instruction
Pause execution until a specific event is received.
Rate Limit Instruction
Rate Limit Instruction
Control resource usage with rate limiting.
Other Instructions
Auth Instruction
Auth Instruction
Generate authentication tokens for internal API calls.
This token cannot be used outside of automations, and is specifically intented for When fetching a Prismeai automation endpoint with such workspace token, a
You can also forward source workspace authentication to a subsequent fetch :
fetch consumption (as an Authorization header).{{run.authenticatedWorkspaceId}} variable (which cannot be manually set) will be made available to securely check calling workspace.You can also forward source workspace authentication to a subsequent fetch :
User Topic Instructions
User Topic Instructions
Manage user subscription topics.User topics allow sending events to multiple users without knowing who they are in advance, automatically granting them read access to these events without requiring any API Key.User topics allow sending events to multiple users without knowing who they are in advance.
Run instruction
Run is a generic instruction allowing you to call runtime modules.These are lightweight NodeJS packages offering various methods for use cases needing raw Javascript for better performances than standard automations. Example :
- module : Module name
- function : Function name
- parameters : Function parameters object
- onError : Exception handling behaviour
breakwill break current automation with given exception (default)emitwill emit an error event but continue current automationcontinuewill only return the error and continue current automation
Embed JavaScript or Python with the Custom Code app
Need to run arbitrary code inline (parsing, hashing, reshaping)? Install the Custom Code app and use
Custom Code.run to invoke a function you defined in YAML.Collections
Store, query, and manage structured data with MongoDB-style queries. This module is generally meant to be used through the Collection application.Collections Module Reference
Functions:
create, findMany, updateOne, deleteOne, aggregate, and moreSecrets
Securely store and retrieve sensitive values (API keys, tokens, credentials) at runtime, with automatic redaction from logs.Secrets Module Reference
Functions:
set, get, delete — scopes: workspace, userAccess Manager
Manage organization service account tokens at runtime with in-memory secret caching and event-driven invalidation.Access Manager Module Reference
Functions:
getServiceAccountToken, createServiceAccount, rotateServiceAccountSecret, deleteServiceAccountText
Pure-JS text processing utilities for splitting text into chunks with configurable separators and overlap.Text Module Reference
Functions:
splitTextInstruction Reference
Quick lookup tables for every built-in instruction. For each one: the full parameter list (with type, default, and notes), the value left inoutput (when applicable), the errors it raises, and the related instructions you typically chain it with.
set
Assigns a value to a variable in any scope.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | string (required) | — | Target variable. Supports dotted paths (user.profile.name) and array append (items[]). |
value | any (required) | — | Value to assign. Expressions are evaluated. |
type | replace | merge | push | replace | merge deep-merges objects/arrays; push appends to an array. |
lifespan | number (seconds) | session/run lifetime | TTL for the variable. After expiry the variable is unset. |
delete, conditions, emit.
delete
Removes a variable.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | string (required) | — | Variable to remove. Dotted paths supported. |
emit
Publishes an event on the workspace event bus.
| Parameter | Type | Default | Description |
|---|---|---|---|
event | string (required) | — | Event name. Convention: app.<thing>.<verb> (dot-separated, lowercase). |
payload | object | {} | Event data. |
target.userTopic | string | — | Deliver only to the named user topic (see createUserTopic). |
target.sessionId | string | — | Deliver only to events streams scoped to that session. |
target.userId | string | — | Deliver only to streams scoped to that user. |
target.currentSocket | boolean | false | Deliver only on the socket that triggered this run (useful for SSE replies). |
options.persist | boolean | true | When false, the event is broadcast but not stored — invisible in Activity. |
wait, runWorkflow.
fetch
Calls an HTTP endpoint.
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string (required) | — | Absolute or workspace-relative URL. $secret: references are resolved transparently. |
method | GET | POST | PUT | PATCH | DELETE | GET | HTTP method. |
headers | object | {} | Request headers. |
query | object | {} | Query string parameters. Merged with any present in url. |
body | any | — | Request body. Serialized as JSON unless Content-Type says otherwise. |
multipart | array | — | Multipart/form-data fields (file uploads). See the Fetch accordion above. |
auth.basic.user / auth.basic.password | string | — | HTTP Basic auth. |
auth.awsv4 | object | — | AWS SigV4 signing. See the Fetch accordion above. |
outputMode | body | detailed_response | base64 | data_url | body | Shape of the value left in output. |
stream | object | — | Emit each SSE chunk as an event instead of buffering. See the Fetch accordion above. |
emitErrors | boolean | false | When true, HTTP errors are caught and emitted as prismeai.fetch.error events instead of aborting the run. |
output | string | — | Variable name receiving the response. |
{ body, headers, status } if outputMode: detailed_response. Raises: network errors, timeout, non-2xx HTTP (unless emitErrors). Often chained with: set, conditions, repeat (for streams).
wait
Blocks the automation until a matching event arrives or a timeout elapses.
| Parameter | Type | Default | Description |
|---|---|---|---|
oneOf[].event | string (required) | — | Event name to wait for. |
oneOf[].filters | object | {} | Match conditions on the event payload (dotted paths). |
timeout | number (seconds) | 20 | Maximum wait time. |
output | string | — | Variable receiving the matching event ({ event, payload }). |
null if the timeout elapsed. Raises: none. Often chained with: emit (initiate the request, then wait for the reply).
conditions
Branches on expressions.
Structure:
default runs (if present). See Condition and Expression syntax for operators and helpers.
Output: none. Raises: expression evaluation errors. Often chained with: set, emit, break.
repeat
Iterates over a collection or repeats a fixed number of times.
| Parameter | Type | Default | Description |
|---|---|---|---|
on | expression | — | Collection to iterate. Exclusive with until. |
until | number | expression | — | Number of iterations, or an expression that stops the loop when truthy. Exclusive with on. |
do | array (required) | — | Instructions to execute each iteration. |
batch.size | number | 1 | Items processed in parallel per batch. |
batch.interval | number (ms) | 0 | Pause between batches. |
do, {{item}} is the current element and {{$index}} the 0-based index. Output: none. Raises: none. Often chained with: break, all.
break
Exits a loop or the whole automation.
| Parameter | Type | Default | Description |
|---|---|---|---|
scope | repeat | automation | all | automation | repeat exits the nearest loop; automation ends the current automation; all propagates to parent automations through try/catch. |
payload | object | — | Forwarded as the automation output. |
all
Runs branches in parallel.
| Parameter | Type | Default | Description |
|---|---|---|---|
| (positional list) | array of instructions (required) | — | Each entry is an independent branch. Run concurrently. |
all returns once every branch has completed. Errors in one branch do not cancel the others — wrap with try/catch if you need fail-fast.
try / catch
Catches errors raised by inner instructions.
| Parameter | Type | Default | Description |
|---|---|---|---|
do | array (required) | — | Protected block. |
catch | array | — | Recovery block. Receives {{$error}} ({ name, message, details }). |
catch is omitted, the error is silently swallowed.
run
Calls a built-in runtime module.
| Parameter | Type | Default | Description |
|---|---|---|---|
module | string (required) | — | secrets, collections, accessManager, text. See Modules. |
function | string (required) | — | Module function name. |
parameters | object | {} | Function inputs. Shape depends on the function. |
output | string | — | Variable receiving the return value. |
onError | throw | continue | throw | When continue, errors are returned in output as { error: '<code>' } instead of aborting. |
not_found, user_required, …). See each module’s reference page.
runWorkflow
Calls another automation in the same workspace.
| Parameter | Type | Default | Description |
|---|---|---|---|
workflow | string (required) | — | Slug of the target automation. |
parameters | object | {} | Inputs passed to the target’s arguments. |
output | string | — | Variable receiving the target’s output. |
wait | boolean | true | When false, fire-and-forget — the parent continues without waiting. |
output. Raises: propagates errors from the target (unless wait: false).
rateLimit
Enforces a sliding-window rate limit.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | string (required) | — | Identifier shared across automations that should share the limit. |
limit | number (required) | — | Maximum events in the window. |
window | number (seconds, required) | — | Sliding-window size. |
consumer | expression | global | Partition key (e.g. "{{user.id}}" for per-user limits). |
output | string | — | Variable receiving { ok, retryAfter, remaining, limit, window, consumer }. |
output.ok to decide what to do.
auth
Issues a short-lived JWT for internal calls.
| Parameter | Type | Default | Description |
|---|---|---|---|
workspace | boolean | false | When true, the JWT carries workspace identity. The receiving automation can read {{run.authenticatedWorkspaceId}}. |
output | string | — | Variable receiving { jwt: '<token>' }. |
fetch calls back to the platform — it cannot authenticate against external systems.
createUserTopic / joinUserTopic
Manage real-time delivery topics.
| Instruction | Parameter | Type | Description |
|---|---|---|---|
createUserTopic | topic | string | Topic name (workspace-scoped). |
createUserTopic | userIds | array of strings | Initial subscribers. |
joinUserTopic | topic | string | Topic name. The current user is added. |
emit … target: { userTopic: '<topic>' } delivers events to all members in real time.
comment
Free-form annotation. No runtime effect. Renders as a yellow sticky note in the visual editor.
Errors raised by all instructions
Any instruction can raise the following platform errors regardless of its own logic:| Error | When |
|---|---|
WorkspaceQuotaExceeded | The workspace has hit its event/run quota. |
WorkflowTimeoutError | The whole automation run exceeded its max duration. |
ConfigurationError | An expression references a variable scope that is unavailable in the current trigger (e.g. {{user}} in a cron). |
try/catch to recover from these.
Condition and Expression syntax
Conditions allow you to execute different instructions based on contextual information. You can use a powerful expression syntax in conditions and anywhere with{% ... %} delimiters.
Basic Operators
Logical Operators
Regular Expressions
MongoDB-like Conditional Matches
Deep merge objects
This functiun helps deep merge two objects.Date Functions
Parsing and Access
Formatting
Math Functions
Operators
Functions
String Functions
URL parsing
Parse URL search params :Arguments
When calling a native instruction or another automation, different arguments can be transmitted. These graphical inputs are not reserved to native instructions, but can also be configured for your own custom automations by specifying expected arguments and their types.someToken argument defined with secret: true is automatically redacted from native runtime events to avoid accidental leaks of sensitive information.
Arguments Validation
Automation arguments can be validated during execution by enablingvalidateArguments: true:
Advanced Automation Patterns
- Webhook Handling
- Data Processing Pipeline
- Multi-LLM Orchestration
Implement secure webhook endpoints for third-party integrations:
Supported Native Events
Workspaces can listen to a specific subset of native events:Workspace Events
Workspace Events
App Events
App Events
Automation Events
Automation Events
Runtime Events
Runtime Events
Best Practices
Modular Design
Modular Design
Create maintainable automation structures:
- Break complex flows into smaller automationsUse events for communication between modulesCreate reusable patterns for common tasksDocument automation purposes and interfaces
Error Handling
Error Handling
Build robust fault tolerance:
- Use try/catch blocks for risky operationsImplement appropriate retry strategiesProvide informative error messagesCreate fallback paths for critical operations
State Management
State Management
Handle data appropriately across scopes:
- Use appropriate memory scopes for different data needsClean up temporary variables when finishedInitialize variables before using themBe mindful of persistence requirements
Security Best Practices
Security Best Practices
Keep your automations secure:
- Store sensitive data in secretsValidate inputs from external sourcesImplement rate limiting for external APIsUse proper authentication for API calls
Performance Optimization
Performance Optimization
Ensure efficient execution:
- Use parallel processing for independent operationsImplement batching for large data setsCache results when appropriateMonitor execution times and optimize bottlenecks
Testing
Testing
Validate automation functionality:
- Test with representative data samplesVerify error handling pathsTest edge cases and unexpected inputsUse Activity view to review execution history
Next Steps
Pages
Pages
Learn how React pages call endpoints and emit workspace events
Testing & Debugging
Testing & Debugging
Trace automation runs with Activity and correlation IDs
Deployment
Deployment
Learn more about deployment strategies