Element types

Types List

TypeDescription
action/buildStaticSite
action/convertConverts the input resource(s) to a desired type
action/deleteDeletes the input resource(s)
action/downloadFileSends a download response to the client with a given file
action/exportSaves exported input resource(s) as files
action/flushSession
action/logLogs the input to the debug channel
action/mailSends a mail
action/modal
action/notifySends a notification in form of email, SMS, etc.
action/oauth
action/putSession
action/redirectDirects the client to be redirected to a given module with pre-filled values
action/refreshRefreshes the current Page the User is on
action/removeRole
action/resetPassword
action/responseSends the input as raw response to the client
action/rsync
action/runRuns a workflow (a)synchronously
action/saveSaves the input resource(s)
action/setDirects the client to set fields with certain values
action/setRoleSets the role of a user
action/viewFileSends a response to the client with a given file as contents
api/check
api/httpSends a HTTP request
api/imapConnects to an IMAP server and filter through mails
api/token
api/upload
event
event/createfires when creating a resource
event/cron
event/delete
event/on_change
event/on_create_tab_loadedfires when a tabs fields are available on create
event/on_item_delete
event/on_load
event/on_show
event/on_syncfires when 1) field in frontend is initialized; 2) when field in frontend is edited
event/options
event/policyDelete
event/policyRead
event/policyUpdate
event/OCRReadyFires 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/updatefires when a resource is updated (saved after edit)
event/webhookable to create a button in the frontend
flow/each
flow/empty
flow/hasRoles
flow/if
flow/try
op/addItem
op/addListItemCreates 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/nopDoes nothing (useful for just setting variables)
op/setSet data inside a workflow object
op/pluck
op/pushPushes new item into array
op/recipeOutputs calculated value. Read about Recipes Language
op/selector
op/set
op/sort
op/strReplace
op/uniqueReturns a new array without duplicate values
query/relations
query/resources
query/where
source/chunkedEntities
source/entities
source/file
source/getSession
source/newCreates a fresh resource (without saving it)
source/readFile
source/renderView
source/resourcesLoads and returns resources
source/userLoads and returns current user with roles and all relations

Actions

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

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/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

PortTypeDescription
defaultForwardThe input is not used for anything.

Outputs

PortTypeDescription
defaultarray, FileThe 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"
}