When talking about variables in the context of Bosbec WE, we are usually referring to metadata. Metadata is where we store data to be able to process it later.
While metadata can be permanently stored on the account resources, it is often used as a temporary storage space when used in a Workflow Context.
Metadata
When handling data in a workflow, you’ll typically store it as metadata. In most cases, there is a destination field where you can enter the metadata key to save data, though some jobs use predefined keys.
Getting data from a key dynamically looks like this:
{{metadata.key}} or {{resource.metadata.key}}
Saving data to a key looks like this:
metadata.key or resource.metadata.key
Resources
Resources can be permanent (on your account) or temporary (in a WFC). They include incoming API requests, units, lists, etc. Resources have metadata that can be accessed using this syntax:
{{[RESOURCE_NAME].metadata.[KEY]}}
{{[RESOURCE_NAME].[KEY]}}
To get the creation date and time of a resource:
{{[RESOURCE_NAME].createdon}}
This returns the date and time in the “u” format: yyyy-MM-dd HH:mm:ssZ.
Incoming message
The incomingmessage resource has specific keys you can access:
{{incomingmessage.body}} – Message body
{{incomingmessage.htmlbody}} – HTML body of email
{{incomingmessage.sender}} – Sender address (string)
{{incomingmessage.receivers}} – Comma-separated list of all receivers
{{incomingmessage.receiver}} – Main recipient
{{incomingmessage.subject}} – Email subject
Incoming HTTP request resource
The Incoming HTTP trigger creates an HTTP resource. Access data using:
{{[RESOURCE_NAME].body}} – Request body
{{[RESOURCE_NAME].headers}} – All headers
{{[RESOURCE_NAME].header.[HEADER_NAME]}} – Specific header
Paths and URLs:
{{[RESOURCE_NAME].path}} – Path only
{{[RESOURCE_NAME].fullpath}} or {{[RESOURCE_NAME].full_path}} – Full path
{{[RESOURCE_NAME].url}} – Full URL
Query parameters:
{{[RESOURCE_NAME].querystring}}
{{[RESOURCE_NAME].querykeys}}
{{[RESOURCE_NAME].query.[KEY]}}
Content type:
{{[RESOURCE_NAME].content-type}}
{{[RESOURCE_NAME].contenttype}}
Other useful properties:
{{[RESOURCE_NAME].multitude}} – Usually Single
{{[RESOURCE_NAME].requesterip}} or {{[RESOURCE_NAME].ip}} – IP address
IDs
Resources usually have an ID:
{{[RESOURCE_NAME].id}} – Resource ID
{{[RESOURCE_NAME].administratorid}} – Creator's admin ID
{{[RESOURCE_NAME].accountid}} – Creator's account ID
Files
Files attached to a resource in a Workflow Context can be accessed with {{[fileX]}}, where X is the file's position among the resource's files: file1 is the first file, file2 the second, and so on.
{{[file1].id}} – File ID (GUID)
{{[file1].fileName}} – File name, including extension
{{[file1].created}} – Created date and time
{{[file1].size}} – File size in bytes
{{[file1].contentType}} – Content type
{{[file1].mimeType}} – MIME type
When a file is received through an incoming email, it is automatically added to the WFC and can be accessed using the syntax above.
Share lists
To access sharing details:
{{[RESOURCE_NAME].sharing.owner}} – Resource owner
{{[RESOURCE_NAME].sharing.sharelists}} – Share lists
{{[RESOURCE_NAME].sharing.access}} – Access type (public/private)
Units
Units contain specific information, such as phone numbers, email addresses, and tags. You can use any unit resource name in place of “unit”.
Phone:
{{unit.phone}} or {{unit.phonenumber}} – Phone number
{{unit.phone.country}} – Country name from phone number
{{unit.phone.countryiso}} – Country ISO code (e.g., SE)
Email:
{{unit.email}}
{{unit.emailaddress}}
App users:
{{unit.appuser}}
{{unit.appuserid}}
Other unit functions:
{{unit.hasfeedchannelwithpush()}} – true if user has push channel
{{unit.channels.count()}} – Number of channels
{{unit.tags.tojson()}} – Tags in JSON format
Account settings and secrets
To access an account custom setting, use:
{{settings.customsettings.[KEY]}}
To access an account secret, use:
{{settings.secrets.[KEY]}}
Replace [KEY] with the key used in your account settings.
Account secrets are intended for sensitive values such as API keys, tokens, and passwords. The value is hidden after it has been saved, but jobs can still use it through the variable syntax above.
Variable functions
The Bosbec Workflow Builder includes built-in functions to alter and create data. For example, use these functions to create and format dates or generate random characters and values.
Date and time
{{[datetime()]}} – Default format (yyyy-MM-dd HH:mm:ssZ)
{{[datetime(yyyy-MM-dd)]}} – Custom format
{{[datetime(yyyy-MM-dd HH:mm:ssZ)]}}
{{[datetime().addtimespan(ddd.HH:mm:ss)]}} – Add days, hours, minutes, or seconds to the date and time.
{{[datetime().subtimespan(ddd.HH:mm:ss)]}} – Subtract days, hours, minutes, or seconds from the date and time.
The addtimespan and subtimespan functions can also be used without the datetime function. For example:
{{{{metadata.time_of_call}}.addtimespan(0.01:00:00)}} – Adds an hour to the date and time found in metadata.time_of_call
{{{{metadata.time_of_call}}.subtimespan(1.00:00:00)}} – Removes a day from the date and time found in metadata.time_of_call
Random generators
{{[rndnum(50)]}} – Random number 0 to 50
{{[rndnum(10,100)]}} – Random number between 10 and 100
{{[rnddecimal()]}} – Decimal 0 to 1
{{[rndalpha(5)]}} – 5 random letters
{{[rndchar(X)]}} – X random characters
{{[uid()]}} – GUID
Case conversion
{{metadata.[KEY].toupper()}} – Uppercase
{{metadata.[KEY].tolower()}} – Lowercase
JSON conversion
{{metadata.[KEY].tojson()}}
Count
{{[RESOURCE_NAME].count()}} – Count items in resource
Calculate
{{calc(1+2*3)}} – Evaluates a mathematical expression and returns the result.
Strings
{{string.replace(a,b)}} – Finds all occurrences of a in the expression and replaces them with b.
{{string.substring(from, length)}} – Returns a portion of the expression starting at position from and spanning length characters.
{{string.trim()}} – Removes leading and trailing spaces from the expression. For example, " hello " -> "hello".
Validate
{{isemail({{metadata.user_email}},yes,no)}} – Returns yes if the value is a valid email address, otherwise no.
{{isphone({{metadata.customer_phone}},valid,invalid)}} – Returns valid if the value is a valid phone number, otherwise invalid.
Default value
Use defaultvalue() to provide fallback if key is missing or empty:
{{defaultvalue( "{{metadata.key}}" || "No value" )}}
This example would save the string “No value” to the destination if metadata.key cannot be found or if it’s empty.
When an expression does not resolve
An expression pointing at something that is not there is not an error. It renders as its own text.
If metadata.name has never been set, {{metadata.name}} stores the literal string metadata.name. A misspelled function behaves the same way — coun() becomes the text coun() rather than a count. Nothing fails, and a route comparing against that value later takes a branch that looks impossible.
Use defaultvalue() above for any field that may be absent. When something branches wrongly, open the run and read the metadata: a value that is an expression rather than data tells you which job to look at.
Set data does not write an empty result
A Set data operation whose result is empty leaves its destination untouched. The previous value stays.
This matters most with trim(). Trimming " " produces an empty string, so nothing is written and the original untrimmed value remains — which is why a whitespace-only value can pass an emptiness check that looks correct.
Write to a new key rather than back over the source when you need to know whether a transformation actually ran.