Element types
6 minute read
Types List
Type | Description |
---|---|
action/buildStaticSite | |
action/convert | Converts the input resource(s) to a desired type |
action/delete | Deletes the input resource(s) |
action/downloadFile | Sends a download response to the client with a given file |
action/export | Saves exported input resource(s) as files |
action/flushSession | |
action/log | Logs the input to the debug channel |
action/mail | Sends a mail |
action/modal | |
action/notify | Sends a notification in form of email, SMS, etc. |
action/oauth | |
action/putSession | |
action/redirect | Directs the client to be redirected to a given module with pre-filled values |
action/refresh | Refreshes the current Page the User is on |
action/removeRole | |
action/resetPassword | |
action/response | Sends the input as raw response to the client |
action/rsync | |
action/run | Runs a workflow (a)synchronously |
action/save | Saves the input resource(s) |
action/set | Directs the client to set fields with certain values |
action/setRole | Sets the role of a user |
action/viewFile | Sends a response to the client with a given file as contents |
api/check | |
api/http | Sends a HTTP request |
api/imap | Connects to an IMAP server and filter through mails |
api/token | |
api/upload | |
event | |
event/create | fires when creating a resource |
event/cron | |
event/delete | |
event/on_change | |
event/on_create_tab_loaded | fires when a tabs fields are available on create |
event/on_item_delete | |
event/on_load | |
event/on_show | |
event/on_sync | fires when 1) field in frontend is initialized; 2) when field in frontend is edited |
event/options | |
event/policyDelete | |
event/policyRead | |
event/policyUpdate | |
event/OCRReady | Fires once the OCR data for a newly uploaded file is ready and returns this in the default output. (The file entity is also provided in the file out) |
event/update | fires when a resource is updated (saved after edit) |
event/webhook | able to create a button in the frontend |
flow/each | |
flow/empty | |
flow/hasRoles | |
flow/if | |
flow/try | |
op/addItem | |
op/addListItem | Creates an empty List Item that can be filled by op/set |
op/addListItems | |
op/base64 | |
op/count | |
op/diff | |
op/except | |
op/exist | |
op/filter | |
op/first | |
op/flatten | |
op/get | |
op/groupBy | |
op/hide | |
op/join | |
op/load | |
op/merge | |
op/mergeFiles | |
op/nop | Does nothing (useful for just setting variables) |
op/set | Set data inside a workflow object |
op/pluck | |
op/push | Pushes new item into array |
op/recipe | Outputs calculated value. Read about Recipes Language |
op/selector | |
op/set | |
op/sort | |
op/strReplace | |
op/unique | Returns a new array without duplicate values |
query/relations | |
query/resources | |
query/where | |
source/chunkedEntities | |
source/entities | |
source/file | |
source/getSession | |
source/new | Creates a fresh resource (without saving it) |
source/readFile | |
source/renderView | |
source/resources | Loads and returns resources |
source/user | Loads and returns current user with roles and all relations |
Actions
action/convert
Options
Name | Type | Description |
---|---|---|
value | ContextExpression, String | Raw Data to be converted. |
file | boolean: false | If the returned file should be saved as a file |
parse | boolean: false | Fix LateX variables if converting to LateX |
from | String | The initial format of the Data |
to | String | The 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 |
assets | ContextExpression, (Asset Object) Array | Assets to download and serve to the conversion process |
Asset Object Structure
You can serve Assets either with an (unprotected) URL or Base64 encoded.
Name | Type | Description |
---|---|---|
name | String | Filename |
url | String | Public Url that serves the file. Either http or https |
data | Base64 String | Raw Data of the asset in Base64 format |
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
Port | Type | Description |
---|---|---|
default | Resource|Resource[] | The resource to use for base variables. |
Outputs
Port | Type | Description |
---|---|---|
default | Forward | Same output as input. Data is not changed. |
Options
Name | Type | Description |
---|---|---|
values | Dict[ContextExpression, String] | Mapping from a JSONPath-selector to a recipe. Variables available in the recipe are context and input resource. |
hidden | Dict[ContextExpression, String] | Mapping from a JSONPath-selector to a (boolean) recipe. Variables available in the recipe are context and input resource. |
options | ContextExpression | Selector 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/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.
Api
api/http
Inputs
Port | Type | Description |
---|---|---|
default | Forward | The input is not used for anything. |
Outputs
Port | Type | Description |
---|---|---|
default | array, File | The request’s response. Type depends on the response type |
Request data
Use JSON input for setting up request data, i.e.
- uri
- method
- params
- base_uri
- headers
- response_type
Example
{
"uri": "/track/v1/details/$tracking_number",
"method": "GET",
"params": {
"base_uri": "https://wwwcie.ups.com",
"headers": {
"Accept": "application/json",
"AccessLicenseNumber": "***********"
}
},
"response_type": "json"
}