Flows @ Functions
Functions are built-in helpers you can drop into almost any field in a flow. They start with an @ and are resolved automatically when the flow runs, the same way variables like {{name}} are. Type @ in a field to open the function picker and choose one.
Time based functions
These return a point in time expressed in minutes and are commonly used in the Time to Live field to control when stored data expires. Use the exact spelling shown, including the underscores.
| Function | Description |
|---|---|
@NowSecond | Unix time now, in seconds |
@Now | Unix time now, in minutes |
@UnixMillis | Unix time now, in milliseconds |
@End_of_Day | The time between now and the end of the day. Useful for timers. |
@24_hours | 24 hours from now. Useful for timers. |
@1_hour | 1 hour from now. Useful for timers. |
@5_mins | 5 minutes from now. |
@5_days | 5 days from now. |
@7_days | 7 days from now. |
@14_days | 14 days from now. |
@21_days | 21 days from now. |
@Next_Monday_6am | The interval to next Monday at 6am. Useful for timers. |
@Start_next_Month | The interval to the start of next month at midnight. |
@forever | Never expires. Use in Time to Live fields to keep data indefinitely. |
All of these except @NowSecond and @UnixMillis return an offset in minutes and support further calculation. For a length of time not listed, enter a plain number of minutes (for example 43200 for 30 days).
String and other functions
| Function | Description |
|---|---|
@flowid() | Returns the flow ID for the current flow. |
@guid() | Returns a randomly generated GUID. |
@default(variable, default) | Checks whether the variable exists and returns the value of default if it does not. |
@ifSet(variable, string) | If the variable is set, the second value is returned; otherwise nothing is returned. |
@dynamic(variable) | Resolves variables that are inside another variable. |
@toUpperCase(string) | Converts the string to upper case. |
@toLowerCase(string) | Converts the string to lower case. |
@toString(variable) | Converts the variable to a string, such as a number. |
@length(variable) | Returns the number of characters in the variable. |
@startsWith(variable, search) | Returns true if the variable starts with the search value, otherwise false. |
@endsWith(variable, search) | Returns true if the variable ends with the search value, otherwise false. |
@isNumeric(value) | Returns true if the value is a number, otherwise false. |
@subStr(variable, start, length) | Returns a substring. Start is zero based, and length is the number of characters to return. |
@replace(variable, find, replace) | Replaces the find value with the replace value in the variable. The find value is treated as a pattern. |
@padLeft(variable, padchar, length) | Adds padchar to the left of the variable until length is reached. |
@padRight(variable, padchar, length) | Adds padchar to the right of the variable until length is reached. |
@calc(formula) | Calculates an equation given by formula. Can also be done with the = operand. |
@bigcalc(formula) | Calculates an equation using arbitrary-precision maths, for very large or high-precision numbers. |
@format(variable, format) | Formats a numeric variable. |
@formatDate(variable, format) | Formats the Unix-seconds value passed in, using the format provided. |
@randomString(length) | Creates a random string of characters. Length must be between 1 and 100. |
@randomStr(length) | Creates a random string of lowercase a to z characters only. |
@randomint(maxNumber) | Creates a random whole number between 0 and maxNumber. |
@random(maxNumber) | Returns a random decimal value between 0 and maxNumber. |
@encode64(string) | Encodes the string in Base64. |
@encodePad64(string) | Same as encode64, but padded to the 3 byte boundary. |
@decode64(base64String, outputKey) | Decodes a Base64 string and stores the result in the output key. |
@encodeURL(string) | Base64 URL-safe encoding (no padding), for values used in URLs. |
@md5(string) | Hashes the string using MD5. |
@sha1(string) | Hashes the string using SHA-1. |
@sha256(string) | Hashes the string using SHA-256. |
@hmac(algorithm, key, message) | Generates an HMAC signature and returns it as hex. Example algorithm: HmacSHA256. |
@hmacbase64(algorithm, key, message) | Generates an HMAC signature and returns it Base64-encoded. |
@jwtDecode64(variable, outputKey) | Decodes a JWT token payload and extracts the claims. |
@jwtEncodeRS256(privateKey, claims) | Creates a JWT token signed with the RS256 algorithm. |
@s3auth(host, path, query, httpMethod, accessKey, secretKey, awsRegion, awsService, payload) | Returns a JSON string with the authorisation headers required for AWS S3. |
@toJSON() / @toJSON(baseElement) | Builds a JSON packet from the dictionary items specified. |
@flatmapjson(JsonString) | Parses a JSON string into a JSON object. |
@toXML(variable, baseXMLNode) | Converts the variable into a valid XML string. |
@arrayGet(variable, index) | Returns the entry or object found at index in the array. |
@arrayCount(variable) | Returns the number of elements in the array. |
@arraySet(variable, index, newitem) | Sets newitem into the array at position index. |
@arrayAdd(variable, newitem) | Adds newitem to the end of the array. |
@arrayAddString(variable, value) | Adds value to the end of the array as a string. |
@arrayRemove(variable, index) | Removes the item at index from the array. |
@arrayRemoveArray(array1, array2) | Removes all elements found in the second array from the first array. |
@arraytostring(array) | Converts an array to a string. |
@arraySortString(variable, column, asc/desc) | Sorts and returns a new array, ordered by a string column. |
@arraySortNumeric(variable, column, asc/desc) | Sorts and returns a new array, ordered by a numeric column. |
@splitToArrayString(string, delimiter) | Splits a string into an array, forcing all values to string type. |
@splitToArrayNumeric(string, delimiter) | Splits a string into an array, forcing all values to numeric type. |
@encodebracket() | Strips emojis and other characters that may break the parser from a string. |
@decodebracket() | Restores characters previously removed by encodebracket. |