Skip to main content
Builder Automations Interface
Automations are the agentic workflows and backend logic you build on the foundation from Builder. They are the core server-side processes that power your applications, defining what to do and when to do it, so you can create sophisticated workflows, integrate with external systems, and build intelligent applications, all versioned as code alongside your agents and front-ends.

Understanding Automations

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
Example:A HubspotDealsOnSlack automation might send a notification message on Slack every time a new Hubspot deal is created:
  • 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:

Indentation and structure rules

YAML structure is significant. Three rules cover 95 % of the mistakes the editor will surface.
  1. Indentation is spaces, not tabs. Two spaces per level is the convention used everywhere in this documentation. Mixing tabs and spaces fails parsing.
  2. A list item starts with - at the parent’s indentation level. The contents of the item are indented one more level.
  3. A key always ends with : and a single space before its value (except when the value is on the next line).
If a value contains characters YAML would otherwise interpret (:, #, {, [, &, *, !, |, >, ', ", %, @, `` `), wrap it in single or double quotes.

Naming and casing conventions

The platform does not enforce most of these, but the visual editor, the Activity view, and the SDK all assume them; sticking to the conventions keeps tooling consistent.

Interpreted keywords

Inside do: 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).

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.
The full expression and condition grammar is documented in Condition and Expression syntax; it covers comparison and logical operators, regular expressions, MongoDB-style matches, deep-merge, and the built-in helpers for dates, math, strings, and URL parsing.

Variable scopes

Variables live in different scopes with different lifetimes. Each scope is exposed as a top-level object in expressions. See Memory Architecture for the full picture, including persistence guarantees.

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.
When in doubt, switch to the visual graph: nodes that the editor cannot render correspond to YAML the runtime would reject.

Triggers

Automations can be activated through different types of triggers, configured at the top of the automation graph:
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:
  • 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)
For multipart/form-data requests, uploaded files will be detailed within a body.<fileKey> object variable.
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:
  • $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)
For long-running SSE endpoints, you can configure a keep-alive to avoid timeouts:
After this instruction, a 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
When a request is made to /webhooks/{workspaceSlug}/v1/users/123, the automation receives:
  • pathParams.id = "123"
Multiple Parameters:
get-user-post
Request to /webhooks/{workspaceSlug}/v1/users/alice/posts/456 results in:
  • pathParams.userId = "alice"
  • pathParams.postId = "456"
Combined with Query and Body:
update-user
Multi-segment Parameters (wildcards):Use *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
Request to /webhooks/{workspaceSlug}/v1/models/openai/text-embedding-3-large yields:
  • pathParams.model_id = "openai/text-embedding-3-large"
A request to /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 :paramName syntax (e.g., :id, :userId); they match one URL segment and reject values containing /
  • Multi-segment parameters use *paramName syntax; 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
Path parameters must be defined in the endpoint field, not in the automation slug.The automation slug (e.g., get-user) only supports letters, numbers, spaces, underscores, and hyphens. To use path parameters, you must explicitly set the endpoint field to your desired path pattern:
Using endpoint: true will expose the automation at the slug path, but the slug itself cannot contain : characters.
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.)
These events can be:
  • Native events: Generated automatically by the platform
  • Custom events: Emitted from automations in the same workspace
  • App events: Emitted from installed Apps
Example configuration:
Workspaces can only listen to a specific subset of native events. See the Supported Native Events section for details.
An automation can be regularly triggered based on cron expressions:
  • 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.scheduled event is emitted
A helpful tool for creating cron expressions is crontab.guru.

Memory Architecture

Automations can use and modify data across different memory scopes:
Available only during current execution
Access pattern: {{run.variable}} Run variables include execution context like:
  • run.date: Current timestamp
  • run.ip: Client IP address
  • run.automationSlug: Current automation identifier
  • run.correlationId: Unique ID for tracing related events
  • run.depth: Current automation depth in the stacktrace
  • run.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 websocket
  • run.appSlug: Current app slug if running from an appInstance
  • run.appInstanceSlug: Current appInstance slug if applicable
  • run.parentAppSlug: Parent app slug if parent is also an appInstance
The run context is automatically removed 60 seconds after the last automation run.
Persistent for the authenticated user
Access pattern: {{user.variable}}User variables include:
  • user.id: Unique user identifier
  • user.email: User’s email address
  • user.authData: Authentication information
  • user.role: User’s role in the workspace
  • Custom user-specific data that persists across sessions
Available for the current user session
Access pattern: {{session.variable}}Session variables include:
  • session.id: Current session ID
  • Custom session data
Session variables store temporary user data:
  • Form inputs across multiple steps
  • Wizard progress state
  • Temporary preferences
For authenticated users, session expiration is defined by the Gateway API (default 1 month). For unauthenticated endpoint calls, sessions expire after 1 hour of inactivity.
Shared across all users and executions
Access pattern: {{global.variable}}Global variables include:
  • global.workspaceId: Current workspace ID
  • global.workspaceName: Current workspace name
  • global.apiUrl: Current API instance public URL
  • global.studioUrl: Current studio instance public URL
  • global.pagesUrl: Current workspace pages public URL
  • global.pagesHost: Current pages instance base domain
  • global.endpoints: Map of available endpoint slugs to URLs
  • global.workspacesRegistry: Map of public workspaces
  • Custom workspace-wide variables
Available for the current websocket connection
Access pattern: {{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.
Workspace and app configuration
Access pattern: {{config.variable}}Contains the workspace configuration defined in the workspace settings.
Read-only workspace information
Access pattern: {{$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:
If 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.
The visual editor never adds extra semantics: each node maps 1-to-1 to a DSUL instruction (or a trigger field). Switching between the two modes does not change the saved file.

Trigger nodes (Start)

The single Start node represents the automation’s when block. Its visual sub-labels reflect which trigger fields are populated. Multiple triggers can coexist on the same Start node; e.g. an automation can be both a webhook and a scheduled job.

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.

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.
In both cases the YAML is just the slug as a key, with parameters as the value:
The catalog of available app actions is read from the workspace’s installed imports; the catalog of workspace automations is read from the workspace itself.

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 conditions block; renders the condition expression.
  • Merge: converges all branches of a conditions or all block.
Switching to Code view is the only way to see these aren’t separate keys: they are computed from the structure of conditions / all.

Instructions

Once triggered, automations execute a sequence of instructions in order. Here are the available instructions:

Logic Instructions

Conditionally execute instructions based on variable values or expressions.
More details on condition syntax
Loop through items or execute instructions multiple times.
You can also process batches in parallel:
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.
Execute multiple operations in parallel.
Handle errors gracefully.
The $error variable is accessible both inside and outside the catch block.

Data Instructions

Create or update variables in different scopes.
Like everywhere else, you can also use expressions in the value parameter:
Remove variables when no longer needed.

Integration Instructions

Make HTTP requests to external APIs.
Trigger events for UI updates or other automations.
Pause execution until a specific event is received.
Filter values can be scalars (equality match) or MongoDB-style operator objects: $eq, $ne, $in, $nin, $gt, $gte, $lt, $lte, $regex, $exists. Keys use dot notation on the event object (e.g. payload.foo.bar). Multiple filters are joined with AND.
Control resource usage with rate limiting.

Other Instructions

Generate authentication tokens for internal API calls. This token cannot be used outside of automations, and is specifically intented for fetch consumption (as an Authorization header).
When fetching a Prismeai automation endpoint with such workspace token, a {{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 :
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 :
Parameters :
  • module : Module name
  • function : Function name
  • parameters : Function parameters object
  • onError : Exception handling behaviour
    • break will break current automation with given exception (default)
    • emit will emit an error event but continue current automation
    • continue will 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 more

Secrets

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, user

Access 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, deleteServiceAccount

Text

Pure-JS text processing utilities for splitting text into chunks with configurable separators and overlap.

Text Module Reference

Functions: splitText

Instruction Reference

Quick lookup tables for every built-in instruction. For each one: the full parameter list (with type, default, and notes), the value left in output (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. Output: none. Raises: none. Often chained with: delete, conditions, emit.

delete

Removes a variable. Output: none. Raises: none.

emit

Publishes an event on the workspace event bus. Output: none. Raises: none. Often chained with: wait, runWorkflow.

fetch

Calls an HTTP endpoint. Output: the response body, or { 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. Output: the event, or null if the timeout elapsed. Raises: none. Often chained with: emit (initiate the request, then wait for the reply).

conditions

Branches on expressions. Structure:
Branches are evaluated in declaration order. The first one whose expression is truthy runs; if none match, 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. Inside 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.

all

Runs branches in parallel. 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. If catch is omitted, the error is silently swallowed.

run

Calls a built-in runtime module. Output: the function’s return value (varies). Raises: module-specific errors (not_found, user_required, …). See each module’s reference page.

runWorkflow

Calls another automation in the same workspace. Output: the target automation’s output. Raises: propagates errors from the target (unless wait: false).

rateLimit

Enforces a sliding-window rate limit. Output: the limit state. Does not raise; branch on output.ok to decide what to do.

auth

Issues a short-lived JWT for internal calls. The token is only valid for fetch calls back to the platform; it cannot authenticate against external systems.

createUserTopic / joinUserTopic

Manage real-time delivery topics. Once a user is subscribed, 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: Wrap calls in 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

Example condition:

Deep merge objects

This functiun helps deep merge two objects.
It also accepts an option object which can slightly modify the merge behaviour.
Example options:

Date Functions

Parsing and Access

Note: Tested values are UTC based, and day starts on 0 for Sunday (so 3 is Wednesday).

Formatting

See all formatting options on Day.js documentation.

Math Functions

Operators

Functions

String Functions

URL parsing

Parse URL search params :
Or parse a complete URL as an object :
This returns :
Or directly access a specific field :

Input & output schemas

An automation declares the inputs it expects — and, optionally, the shape of its output — through the schemas field. schemas is a list of conditional branches, each carrying up to three keys: payload and output are described with the same typed-field format used across Prisme.ai (type, properties, items, required, format, title, description, plus the secret / redact markers below). Supported type values are string, number, integer, boolean, object, array, and the localized:* variants.

Declaring inputs

The simplest case is a single branch describing the payload. These fields also power the graphical inputs shown when the automation is called from another automation or from the execute modal.
The someToken field defined with secret: true is automatically redacted from native runtime events to avoid accidental leaks of sensitive information (see Protecting sensitive fields).

Conditional branches

When an automation is exposed as an HTTP endpoint (or handles more than one call shape), you can declare a branch per case and let the runtime route to the matching one:
Branch resolution rules:
  • First match wins. Branches are evaluated top to bottom; the first one whose conditions all match becomes active.
  • conditions are dot-paths resolved from the payload root (method, body.kind, query.version…). Each entry must equal the corresponding payload value.
  • method is matched case-insensitively (POST matches post). Other keys are case-sensitive.
  • Values are compared as strings after scalar coercionversion: 2 matches ?version=2, since query parameters always arrive as strings. An object, an array, or a null condition value (YAML’s valueless key:) never matches.
  • A branch without conditions is the default and always matches — put it last as a catch-all.

Protecting sensitive fields

Two markers can be placed on any field of a payload or output schema:
Notes:
  • secret only protects strings. To hide an object or an array (a whole JSON body, a structured credential…), use redact: true on that field instead — secret: true would silently do nothing.
  • redact does not follow the value across automations. Unlike secret, which tracks a string value wherever it flows, redact is purely path-based: it only strips the field from the events of the automation that declares it. You must therefore repeat redact: true on every automation the object passes through — declaring it once upstream does not protect it downstream.
  • secret takes precedence over redact: a field marked both is value-tracked and path-redacted.
  • redact only applies to fields reachable through properties. A marker placed inside items, additionalProperties, or a oneOf-style keyword is ignored; redact the parent field instead.

Validation

Set validateArguments: true to have the runtime validate incoming payloads against the active branch’s payload schema:
Schemas support various validation formats including date, url, time, password, etc. Validation errors immediately stop the current and parent automations. When validateArguments is true and no branch matches the payload, the call is rejected. Declare an unconditioned branch (one with no conditions) to accept internal calls or unlisted HTTP methods. Output schemas are never validation-enforced — they only document the output and drive redact.

Backward compatibility with arguments

Automations historically declared their inputs through a top-level arguments map. That format is still fully supported: on save it is automatically converted into a single, unconditioned schemas branch ({ payload: { type: object, properties: <arguments> } }), and collapsed back to arguments when loaded so the editor keeps rendering it. secret and redact markers ride along unchanged.
You never need to migrate existing automations by hand. Reach for schemas when you need what arguments cannot express: conditional branches, an output schema, or redact markers. When both arguments and schemas are present, schemas drives validation, while the secret / redact markers declared on arguments stay enforced on every branch.

Advanced Automation Patterns

Implement secure webhook endpoints for third-party integrations:

Supported Native Events

Workspaces can listen to a specific subset of native events:
event
Emitted when workspace configuration is updatedPayload:
event
Emitted when a workspace is deletedPayload:
event
Emitted after import or repository pullPayload:
event
Emitted when a new workspace version is committedPayload:
event
Emitted when a previous version has been rolled backPayload:
event
Emitted when some page has been shared with someonePayload:
event
Emitted when someone’s access to the page has been removedPayload:
event
Emitted when app instance configuration is updatedPayload:
event
Emitted when app instance is installedPayload:
event
Emitted when app instance is uninstalledPayload:
event
Emitted when workspace is published as an appPayload:
event
Emitted when workspace app is unpublishedPayload:
event
Emitted when an automation is createdPayload:
event
Emitted when an automation is updatedPayload:
event
Emitted when an automation is deletedPayload:
event
Emitted when an automation completes executionPayload:
event
Emitted when an automation is successfully scheduledPayload:
event
Emitted when a fetch receives a 4xx or 5xx HTTP statusPayload:
event
Emitted when a webhook is calledPayload:
event
Emitted when a schedule is triggeredPayload:

Best Practices

Create maintainable automation structures:
    Break complex flows into smaller automationsUse events for communication between modulesCreate reusable patterns for common tasksDocument automation purposes and interfaces
Build robust fault tolerance:
    Use try/catch blocks for risky operationsImplement appropriate retry strategiesProvide informative error messagesCreate fallback paths for critical operations
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
Keep your automations secure:
    Store sensitive data in secretsValidate inputs from external sourcesImplement rate limiting for external APIsUse proper authentication for API calls
Ensure efficient execution:
    Use parallel processing for independent operationsImplement batching for large data setsCache results when appropriateMonitor execution times and optimize bottlenecks
Validate automation functionality:
    Test with representative data samplesVerify error handling pathsTest edge cases and unexpected inputsUse Activity view to review execution history

Next Steps

Learn how React pages call endpoints and emit workspace events
Trace automation runs with Activity and correlation IDs
Learn more about deployment strategies