Skip to content

Action Workflow Elements

Actions perform side effects: they save resources, answer browser requests, show UI feedback, send files, call another workflow, or communicate with users. For workflow authoring patterns, start with Authoring Workflows. For UI response behavior, see UI Integration. For background work, see Async Progress and Jobs.

GroupElementsTypical use
Persistenceaction/save, action/deletePersist or remove resources.
Client responseaction/response, action/set, action/redirect, action/refreshReturn data or instructions to the active browser request.
Files and documentsaction/convert, action/export, action/viewFile, action/downloadFileGenerate, store, show, or download documents.
Communicationaction/mail, action/notifySend email, toast, SMS-style notifications, or other user feedback.
Orchestrationaction/runStart another workflow synchronously or asynchronously.
Access and rolesaction/setRole, action/removeRole, action/resetPasswordManage user-related side effects.
NameTypeDescription
valueContextExpression, StringRaw Data to be converted.
fileboolean: falseIf the returned file should be saved as a file
parseboolean: falseFix LateX variables if converting to LateX
fromStringThe initial format of the Data
toStringThe Format to which the Data will be converted
filters(String) Array (table, heading_to_toc)Names of the LateX filters to apply when converting directly to Latex
assetsContextExpression, (Asset Object) ArrayAssets to download and serve to the conversion process

You can serve Assets either with an (unprotected) URL or Base64 encoded.

NameTypeDescription
nameStringFilename
urlStringPublic Url that serves the file. Either http or https
dataBase64 StringRaw Data of the asset in Base64 format

Tells the client via a webhook response to set field values or field properties in the active resource form. Use it for quick UI feedback, dependent fields, validation messages, or values that are only available on the backend.

PortTypeDescription
defaultResource|Resource[]The resource to use for base variables.
PortTypeDescription
defaultForwardSame output as input. Data is not changed.
NameTypeDescription
recipesDict<string, Recipe>Field values to set on the current form/resource.
propertiesDict<string, Dict<string, Recipe>>Field properties to set by field and selector. Common properties are validation status or validation message.
addarrayList items or values to add where supported.
copyRecipe | nullOptional source object to copy before applying recipes.
processbooleanWhether to process legacy values mappings where present.

Webhook-JSON of type set.

{
"name": "setProjectDefaults",
"type": "action/set",
"options": {
"copy": null,
"add": [],
"recipes": {
"billing_name": "$customer.name",
"billing_email": "$customer.email"
},
"properties": []
}
}

recipes sets fields on the active form from the current workflow context. In this example, $customer must have been loaded earlier in the workflow.

{
"identifier": "ValidateTaskTime",
"title": "Validate task time",
"async": false,
"entry": "validateTaskTime",
"elements": [
{
"name": "validateTaskTime",
"type": "event/on_change",
"set": {
"selector": ":selector"
},
"to": {
"default": {
"setWarning": ["default"]
}
}
},
{
"name": "setWarning",
"type": "action/set",
"options": {
"add": [],
"recipes": [],
"properties": {
"validateStatus": {
"${selector}.hours": "\"error\""
},
"validateMessage": {
"${selector}.hours": "\"Hours must be greater than zero.\""
}
}
}
}
],
"events": [
{
"identifier": "validateTaskTime",
"type": "on_change",
"module": "tasks"
}
]
}

The on_change event can provide a selector for the changed part of the form. Use that selector when setting properties for a field inside a list item.

We have to set the “events” option, and in there set the “on_change” value to a list of event identifiers.

{
"identifier": "hours",
"type": "number",
"options": {
"events": {
"on_change": ["validateTaskTime"]
}
}
}

The action/buildSite element builds static sites using different strategies, depending on the site builder driver used.

Currently, page-depot is the only supported driver for building static sites.

Entity with the capability SiteBuilderTemplate.

Pages Module (pages_module) [string] (optional)
Section titled “Pages Module (pages_module) [string] (optional)”

Module identifier to request the pages. Used by the PageDepot driver.

Sections Module (sections_module) [string] (optional)
Section titled “Sections Module (sections_module) [string] (optional)”

Module identifier to request available sections. Used by the PageDepot driver.

Pages Filter (pages_filter) [array] (optional)
Section titled “Pages Filter (pages_filter) [array] (optional)”

Brezel filter array for the request to page entities. Used by the PageDepot driver.

The default driver is page-depot.

The PageDepot driver communicates with the external PageDepot service.

Defines a basic template for the site builder.

FieldTypeDescription
nameTextA unique identifier for the template.
viewsMultiselectView entities with code.

Defines a template for web pages specific to the PageDepot service. This capability is a part of the implementation logic behind the scenes.

FieldTypeDescription
nameTextA unique identifier for the template.
baseTextA reference to the base layout for the template.

Defines the general layout of a web page. This includes how sections, slots, and scripts should be arranged.

FieldTypeDescription
nameTextA unique identifier for the layout.
baseTextA reference to the base layout.
scriptsCodeCode snippets written in JavaScript to enhance the page functionality.
slotsListA list of slots that are sub-parts of a layout.

The ‘slots’ field holds a list of slot objects. Each ‘slot’ defines a specific area on the page where sections can be inserted. Within a layout, different slots can be defined to include different sections of the page.

Each slot object contains the following sub-fields:

FieldTypeDescription
slotTextA unique identifier for the slot.
sectionsListA list of sections that are inserted into this slot.

Under a section, following sub-fields are present:

FieldTypeDescription
sectionSelectThe name of the section that is added to the slot. It selects from the available ‘sections’.
paramsMapA map of parameters used within the section.
subslotsJsonA JSON object denoting any subsections within the main section.
provide_slotTextThe name of the slot that this section provides for nesting additional sections.

By arranging and configuring different slots and sections within each slot, you can create complex yet easily manageable page layouts. The actual contents of the sections and their respective parameters can be customized as per needs and are not defined in the PageDepotLayoutCapability. They would fall within other capabilities, such as PageDepotSectionCapability.

Defines a structure for a single webpage. It gives details about how the title, description, layout, script, etc. should be formed.

FieldTypeDescription
nameTextA unique identifier for the page.
titleTextThe name shown on the tab of the browser.
dynamic_titleCodeA dynamic title that changes according to some conditions.
layoutSelectThe layout type in which the page should be presented.
descriptionTextareaA brief description of the page.
scriptsCodeCode snippets written in JavaScript to enhance the page functionality.
slotsListA list of slots that are sub-parts of the page.

Defines a section - a subset of the layout. Its purpose is to bring in variants in the layout.

FieldTypeDescription
nameTextA unique identifier for the section.
typeSelectThe type of the section. It can either be Astro or Vue.
varsMapA map related to the functioning of the section.
codeCodeCode that defines the functionalities of the section.

The action/deploySite element deploys static sites built by action/buildSite.

Currently, page-depot is the only supported driver for deploying static sites.

List of hostnames the site should be available under. Used by the PageDepot driver.

The default driver is page-depot.

The PageDepot driver communicates with the external PageDepot service.

Runs another workflow. This can be either synchronous or asynchronous.

NameTypeDescription
workflowstringIdentifier of the workflow to run.
asyncboolean | nullWhether the called workflow should run asynchronously.
queuestring | nullOptional queue for asynchronous runs.
scopebooleanWhether to create a new context for the called workflow.
inputobject | arrayVariables to set in the new context when scope is true.

If scope is false, the called workflow runs in the current context. Existing variables remain accessible.

If scope is true, a new context is created for the called workflow. Values from input are set as variables in that new context. The output of action/run is the output of the last element of the called workflow.

{
"name": "startPublishJob",
"type": "action/run",
"options": {
"workflow": "PublishProject",
"async": true,
"queue": null,
"scope": true,
"input": {
"project": "$project"
}
}
}

The previous context is restored after action/run completes.

Sends a notification to the notification center and over Web push, if available.

notification

Below are the available options for creating notifications:

  • recipients: Specifies the recipient of the notification, which can be a user, a list of users, a role slug, or a list of role slugs. If this field is omitted, the notification will be sent to the current user. If set to null in recipe mode, the notification will not be sent to anyone.

  • title: Specify the title of the notification.

  • message: The message of the notification.

  • entity: Append an entity, such as a File entity, to the notification using this field.

  • type: The type of notification, which can be one of info, warning, or error.

  • icon: The icon to be displayed in the notification. You can provide an absolute URL or a virtual path pointing to a Brezel file (e.g., /static/icon.png). If you use a virtual path, a permanent public absolute URL to the file will be generated, containing a share token. If you are in recipe mode, you can also use a file entity, with the same sharing behavior as the virtual path.

  • image: The image to be displayed in the notification. You can provide an absolute URL, a virtual path, or a file entity.

  • actions: Provide a list of action buttons to display in the notification. You can provide a tokenized list of action names (e.g., “Accept, Deny”), an array of action identifiers (in recipe mode), or an array of action dictionaries (in recipe mode), where each dictionary specifies the action button properties.

:::tip If actions is given and non-empty, this element checkpoints! :::

action/notify

  • action: fired when the user clicks on an action, with the selected action identifier as the data.