Skip to content

Action Workflow Elements

Convert documents (action/convert)

Options

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
Asset Object Structure

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

Setting values in the client (action/set)

Tells the client via a Webhook response to set some internal values. Usually, the object being set on the client side are fields in a resource create or edit view. Useful for dynamically filling fields based on other fields or based on data that is only available in backend.

Inputs

PortTypeDescription
defaultResource|Resource[]The resource to use for base variables.

Outputs

PortTypeDescription
defaultForwardSame output as input. Data is not changed.

Options

NameTypeDescription
valuesDict[ContextExpression, String]Mapping from a JSONPath-selector to a recipe. Variables available in the recipe are context and input resource.
hiddenDict[ContextExpression, String]Mapping from a JSONPath-selector to a (boolean) recipe. Variables available in the recipe are context and input resource.
optionsContextExpressionSelector of the (multi)select fields whose available options should change. The default port is used for the new options. Example: positions[*].warehouse to indicate all warehouse select fields in the positions list.

Response

Webhook-JSON of type set.

Example (1)

{
"name": "Set",
"type": "action/set",
"options": {
"values": {
"shipping_street": "client_street",
"positions[*].discount": "client_discount"
}
}
}

client_street and client_discount are fields present in the default-input resource. The keys are JSONPath selectors. shipping_street refers to the key with the same name in the client’s object that is to be set. positions[*].discount is a JSONPath selecting all discount fields of all entries in the positions array.

Example (2) – Full Workflow

{
"identifier": "SetEmailWorkflow",
"title": "Set",
"async": false,
"elements": [
{
"name": "Select",
"type": "op/selector",
"set": {
"eventSelector": ":selector"
}
},
{
"name": "Set",
"type": "action/set",
"options": {
"values": {
"${eventSelector}.email": "user.email"
}
}
}
],
"events": [
{
"identifier": "SetEmailEvent",
"type": "on_change"
}
]
}
Graph view
graph TB
classDef element fill:#c4c7ff;
subgraph "SetEmailWorkflow"
SelectInDefault((in))
SelectInNone((in))
SelectOutContext>$eventSelector]
SelectInDefault -- default --> Select
Select -. :selector .-> SelectOutContext
Select --> Set
class Select element
class Set element
end
subgraph "Event Bus"
Event[SetEmailEvent] -- original --> SelectInNone
Event[SetEmailEvent] -- default, prototype --> SelectInDefault
Event[SetEmailEvent] -- selector --> Select
end

Note that the on_change-Event gives three inputs into the workflow. default/prototype (the current values of the resource frontend at time of the event), original (resource in edit mode, empty in create mode), and selector (the JSONPath of the parent of the field that fired the event). In this case, if the event was fired at the top-most level, the selector would be ”$” and hence change the root “email” field of the resource. If the event was fired in a list field, the selector could look like “$.mylist[2]”, and the email field of this list item would be changed instead.

In this case, we expect the selector to describe a list item, so we first select only the list item with the op/selector element. In the “Set”-element, we would then set the field $.mylist[2].email to the email of the user field in the previously selected list item. This example therefore shows

  • how we can select sub-fields based on the event emitter (in op/selector)
  • how we can tell the client what fields we want to set with which values.
Adding an event emitter to a field

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

{
"identifier": "user",
"type": "select",
"options": {
"references": "users",
"events": {
"on_change": ["SetEmailEvent"]
}
}
}

action/buildSite

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

Options

Driver (driver) [string]

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

Template (template) [Entity]

Entity with the capability SiteBuilderTemplate.

Pages Module (pages_module) [string] (optional)

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

Sections Module (sections_module) [string] (optional)

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

Pages Filter (pages_filter) [array] (optional)

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

Drivers

The default driver is page-depot.

PageDepot (page-depot)

The PageDepot driver communicates with the external PageDepot service.

Capabilities

SiteBuilderTemplate

Defines a basic template for the site builder.

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

PageDepotTemplate

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.

PageDepotLayout

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.

PageDepotPage

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.

PageDepotSection

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.

action/deploySite

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

Inputs

Options

Deployer (deployer) [string]

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

Hostnames (hostnames) [array<string>]

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

Deployers

The default driver is page-depot.

PageDepot (page-depot)

The PageDepot driver communicates with the external PageDepot service.

Running another workflow (action/run)

Runs another Workflow. This can be either sync or async.

If New Scope is set to false the context will not change. This means all Variables will be accessible.

If New Scope is set to true a new context will be created for the action/run. Variables kann be passed to the new Context. These are set on the context not passed via the Workflowflow. This means that they are normally accessible. The output will be the output of the last Element of the executed Workflow.

The old context will automatically be restored one the action/run is done.

Notify (action/notify)

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

notification

Options

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.

action/notify

Outputs

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