Mapper Language

SiPHON Mapper Language – Technical Reference #

System Overview #

System Name: Mapper
Component Type: Core Subsystem
Parent System: SiPHON Core
Primary Function: Parameter value assignment during workflow execution

Purpose #

Mapper is responsible for setting parameter values at any point during workflow execution. The subsystem reads mapper statements from workflow configurations, compiles them, and executes them to perform required data mapping operations.

Invocation Points #

Mapper is invoked during:

  • Webhook request parameter/payload mapping to workflow inputs
  • Preset value mapping before task execution
  • Task input parameter mapping
  • Subflow output preset value mapping
  • Subflow payload output mapping
  • Exception flow data mapping
  • Audit flow data mapping

Statement Syntax #

Basic Structure #

All mapper statements are enclosed in parentheses: (...)

Statement Forms #

Two-Argument Statement

({Statement Type}:{Argument})

Format: Type identifier followed by single argument, separated by colon.

Three-Argument Statement

({Statement Type}:{Argument 1}:{Argument 2})

Format: Type identifier followed by two arguments, each separated by colon.


Statement Types #

Primary Statement Types #

Primary types can be used as top-level mapper statements.


Static Statements #

Statement Type: static
Argument Forms: 2 or 3 arguments
Purpose: Define literal values with explicit data types

Static Statement Syntax #

Full Form:

(static:{Data Type}:{Value})

Null Form:

(static:null)

Supported Data Types #

string

JSON Return Type: String
Syntax: (static:string:{text value})
Example:

(static:string:Hello World!)

Returns:

"Hello World!"

Escaping Characters in Strings #

Special characters within string values require escape sequences to be interpreted literally rather than as syntax elements.

Escape Slash /

To include a literal forward slash / character within a string, use the escape sequence //.

Syntax: (static:string:text with // character)

Example:

(static:string:https:////example.com//path//to//resource)

Returns:

"https://example.com/path/to/resource"

Use Cases:

  • URLs and file paths
  • Regular expressions with forward slashes
  • Date formats (e.g., MM/DD/YYYY)

Escape Parentheses ()

To include literal parenthesis characters ( or ) within a string, use the escape sequences /( and /).

Syntax: (static:string:text with /(parentheses/))

Example:

(static:string:This is a string with escaped characters /(parenthesis/))

Returns:

"This is a string with escaped characters (parenthesis)"

Example – Mathematical Expression:

(static:string:Calculate /(x + y/) * z)

Returns:

"Calculate (x + y) * z"

Use Cases:

  • Mathematical expressions
  • Function signatures in text
  • Parenthetical notes
  • Phone number formats: /(555/) 123-4567

Newline /n

The escape sequence /n creates a newline character within a string, enabling multiline text.

Syntax: (static:string:line1/nline2)

Example:

(static:string:First line/nSecond line/nThird line)

Returns:

"First line\nSecond line\nThird line"

Example – Formatted Address:

(static:string:123 Main Street/nSydney NSW 2000/nAustralia)

Returns:

"123 Main Street\nSydney NSW 2000\nAustralia"

Use Cases:

  • Multi-line addresses
  • Email body content
  • Formatted reports
  • Log messages with structure

Tab /t

The escape sequence /t inserts a tab character within a string, useful for indentation.

Syntax: (static:string:text/tindented text)

Example:

(static:string:Name:/tJohn Smith/nAge:/t30)

Returns:

"Name:\tJohn Smith\nAge:\t30"

Example – Nested Structure:

(static:string:Root/n/tLevel 1/n/t/tLevel 2)

Returns:

"Root\n\tLevel 1\n\t\tLevel 2"

Use Cases:

  • Indented lists
  • TSV (Tab-Separated Values) data
  • Code formatting in text
  • Hierarchical displays

Combined Escape Sequences

Multiple escape sequences can be used together in a single string:

Example – Complex Formatting:

(static:string:URL: https:////example.com//api/n/tEndpoint: /(POST/) //users//create/n/tDescription: Creates a new user)

Returns:

"URL: https://example.com/api\n\tEndpoint: (POST) /users/create\n\tDescription: Creates a new user"

Example – Log Entry:

(static:string:[INFO] Processing record/n/tID: 12345/n/tStatus: Success /(100%/)/n/tPath: //data//output//file.json)

Returns:

"[INFO] Processing record\n\tID: 12345\n\tStatus: Success (100%)\n\tPath: /data/output/file.json"

Example – Phone Number Formatting:

(static:string:Call us at: /(555/) 123-4567)

Returns:

"Call us at: (555) 123-4567"

Example – File Paths:

(static:string:Windows path: C://Users//Documents//file.txt/nLinux path: //home//user//documents//file.txt)

Returns:

"Windows path: C:/Users/Documents/file.txt\nLinux path: /home/user/documents/file.txt"

Escaping in Data References #

Important: Escape sequences are only needed within static:string values. Field names and data reference paths do NOT require escaping, even if they contain special characters.

Correct – Field names with special characters (no escaping):

(scope:item->Total ($))
(data:workflow->input->payload->Price (USD))
(scope:item->Order #)
(data:vars->Status (Active/Inactive))

Correct – String values with special characters (requires escaping):

(static:string:Total /(in USD/): $1,234.56)
(static:string:File path: //usr//local//bin)
(static:string:Status: Active//Inactive options available)

Quick Reference: When to Escape #

CharacterIn Field NamesIn String ValuesEscape Sequence
/No escapingYES//
(No escapingYES/(
)No escapingYES/)
NewlineN/AYES/n
TabN/AYES/t
SpaceNo escapingNo escaping(literal space)
$, #, @No escapingNo escaping(literal character)

literal

JSON Return Type: String
Purpose: String interpolation with variable substitution
Syntax: (static:literal:{text with ${reference} placeholders})
Variable Reference Format: ${sourcePath}

Example 1 – Simple Interpolation:

(static:literal:Hello ${vars->personName}!)

Returns:

"Hello Joe Bloggs!"

Example 2 – Complex Interpolation:

(static:literal:SELECT id, name, dob FROM ${envVars->personTableName} WHERE name = '${vars->personName}';)

Returns:

"SELECT id, name, dob FROM person_table WHERE name = 'Joe Bloggs';"

number

JSON Return Type: Number
Syntax: (static:number:{numeric value})
Supported Formats:

  • Integer: (static:number:5) → 5
  • Float: (static:number:6.7) → 6.7
  • Negative: (static:number:-4) → -4
  • Exponential: (static:number:1.1e+100) → 1.1e+100

boolean

JSON Return Type: Boolean
Syntax: (static:boolean:{true|false})
Example:

(static:boolean:true)

Returns:

true

object

JSON Return Type: Object
Syntax:

(static:object:{
    (static:string:{property name}): {value statement},
    ...
})

Key Requirements:

  • Property names MUST be strings
  • Property values can be ANY mapper statement type
  • Allows nested structures

Example – Static Object:

(static:object:{
    (static:string:name): (static:string:John Doe),
    (static:string:dob): (static:string:1970-01-01)
})

Example – Dynamic Object:

(static:object:{
    (static:string:name): (data:vars->personName),
    (static:string:dob): (data:tasks->getPersonDetails->payload->resultset[0]->dob)
})

array

JSON Return Type: Array
Syntax:

(static:array:[
    {element statement},
    ...
])

Element Requirements:

  • Array elements can be ANY mapper statement type
  • Supports mixed types
  • Allows nested structures

Example – Homogeneous Array:

(static:array:[
    (static:number:1),
    (static:number:2),
    (static:number:3)
])

Example – Complex Array:

(static:array:[
    (static:object:{
        (static:string:name): (static:string:John Doe),
        (static:string:dob): (static:string:1970-01-01)
    }),
    (static:object:{
        (static:string:name): (data:vars->personName),
        (static:string:dob): (data:tasks->getPersonDetails->payload->resultset[0]->dob)
    })
])

null

JSON Return Type: Null
Syntax: (static:null)
Returns:

null

Function Statements #

Statement Type: function
Argument Form: 2 arguments
Purpose: Execute operations on data

Function Statement Syntax #

(function:{Function Name}[{Argument Statement}, ...])

Key Rules:

  • Each function argument is a complete mapper statement
  • Most functions return values
  • Some control functions do not return values
  • Only value-returning functions can be nested as arguments

Function Categories #

  • comparison
  • logical
  • type checking
  • array
  • object
  • string
  • math
  • control
  • datetime
  • cryptography
  • decoding
  • encoding
  • type conversion

Comparison Functions #

equals #

Categories: comparison
Return Type: boolean
Purpose: Test value and type equality
Syntax: (function:equals[{value1}, {value2}])
Arguments:

  • Position 0: Any statement type, returns any type, REQUIRED
  • Position 1: Any statement type, returns any type, REQUIRED
    Returns: TRUE if values are identical (same type and value), FALSE otherwise

Example:

(function:equals[
  (static:string:hello),
  (static:string:hello)
])

Returns: true

notEqual #

Categories: comparison
Return Type: boolean
Purpose: Test value and type inequality
Syntax: (function:notEqual[{value1}, {value2}])
Arguments:

  • Position 0: Any statement type, returns any type, REQUIRED
  • Position 1: Any statement type, returns any type, REQUIRED
    Returns: TRUE if values are not identical, FALSE otherwise

Example:

(function:notEqual[
  (static:number:5),
  (static:number:3)
])

Returns: true

greaterThan #

Categories: comparison
Return Type: boolean
Purpose: Test if value1 > value2
Syntax: (function:greaterThan[{value1}, {value2}])
Arguments:

  • Position 0: Any statement type, returns any type, REQUIRED
  • Position 1: Any statement type, returns any type, REQUIRED
    Returns: TRUE if value1 logically greater than value2, FALSE otherwise

Example:

(function:greaterThan[
  (static:number:10),
  (static:number:5)
])

Returns: true

greaterThanOrEqual #

Categories: comparison
Return Type: boolean
Purpose: Test if value1 >= value2
Syntax: (function:greaterThanOrEqual[{value1}, {value2}])
Arguments:

  • Position 0: Any statement type, returns any type, REQUIRED
  • Position 1: Any statement type, returns any type, REQUIRED
    Returns: TRUE if value1 logically greater than or equal to value2, FALSE otherwise

Example:

(function:greaterThanOrEqual[
  (static:number:10),
  (static:number:10)
])

Returns: true

lessThan #

Categories: comparison
Return Type: boolean
Purpose: Test if value1 < value2
Syntax: (function:lessThan[{value1}, {value2}])
Arguments:

  • Position 0: Any statement type, returns any type, REQUIRED
  • Position 1: Any statement type, returns any type, REQUIRED
    Returns: TRUE if value1 logically less than value2, FALSE otherwise

Example:

(function:lessThan[
  (static:number:3),
  (static:number:5)
])

Returns: true

lessThanOrEqual #

Categories: comparison
Return Type: boolean
Purpose: Test if value1 <= value2
Syntax: (function:lessThanOrEqual[{value1}, {value2}])
Arguments:

  • Position 0: Any statement type, returns any type, REQUIRED
  • Position 1: Any statement type, returns any type, REQUIRED
    Returns: TRUE if value1 logically less than or equal to value2, FALSE otherwise

Example:

(function:lessThanOrEqual[
  (static:number:5),
  (static:number:5)
])

Returns: true


Logical Functions #

and #

Categories: logical
Return Type: boolean
Purpose: Logical AND operation
Syntax: (function:and[{boolean1}, {boolean2}])
Arguments:

  • Position 0: Any statement type, returns boolean, REQUIRED
  • Position 1: Any statement type, returns boolean, REQUIRED
    Returns: TRUE if both arguments are TRUE, FALSE otherwise

Example:

(function:and[
  (static:boolean:true),
  (static:boolean:true)
])

Returns: true

See Also: Example 4 for usage in business hours validation

or #

Categories: logical
Return Type: boolean
Purpose: Logical OR operation
Syntax: (function:or[{boolean1}, {boolean2}])
Arguments:

  • Position 0: Any statement type, returns boolean, REQUIRED
  • Position 1: Any statement type, returns boolean, REQUIRED
    Returns: TRUE if either argument is TRUE, FALSE otherwise

Example:

(function:or[
  (static:boolean:true),
  (static:boolean:false)
])

Returns: true

ternary #

Categories: logical
Return Type: any
Purpose: Conditional value selection
Syntax: (function:ternary[{condition}, {trueValue}, {falseValue}])
Arguments:

  • Position 0: Any statement type, returns boolean, REQUIRED
  • Position 1: Any statement type, returns any, REQUIRED
  • Position 2: Any statement type, returns any, REQUIRED
    Returns: Result of argument 1 if condition is TRUE, result of argument 2 if FALSE

Example:

(function:ternary[
  (function:output[(static:boolean:true)]),
  (static:string:yes),
  (static:string:no)
])

Returns: "yes"

See Also: Examples 2 and 6 for complex conditional logic


Type Checking Functions #

isNumeric #

Categories: type checking
Return Type: boolean
Purpose: Test if value is numeric type
Syntax: (function:isNumeric[{value}])
Arguments:

  • Position 0: Any statement type, returns any, REQUIRED
    Returns: TRUE if value is numeric, FALSE otherwise

Example:

(function:isNumeric[
  (static:number:5)
])

Returns: true

typeOf #

Categories: type checking
Return Type: string
Purpose: Get data type name
Syntax: (function:typeOf[{value}])
Arguments:

  • Position 0: Any statement type, returns any, REQUIRED
    Return Value Mapping:
  • string → “string”
  • number → “number”
  • boolean → “boolean”
  • object → “object”
  • array → “object”
  • null → “undefined”

Example 1 – String Type:

(function:typeOf[(static:string:hello)])

Returns: "string"

Example 2 – Number Type:

(function:typeOf[(static:number:42)])

Returns: "number"

Example 3 – Boolean Type:

(function:typeOf[(static:boolean:true)])

Returns: "boolean"

Example 4 – Array Type:

(function:typeOf[(static:array:[(static:number:1),(static:number:2)])])

Returns: "object" (Note: Arrays return “object”)

isString #

Categories: string, type checking
Return Type: boolean
Purpose: Test if value is string type
Syntax: (function:isString[{value}])
Arguments:

  • Position 0: Any statement type, returns any, REQUIRED
    Returns: TRUE if value is string, FALSE otherwise

Example:

(function:isString[
  (static:string:hello)
])

Returns: true

See Also: Example 2 for validation usage


Array Functions #

array/isArray #

Categories: array, type checking
Return Type: boolean
Purpose: Test if value is array type
Syntax: (function:array/isArray[{value}])
Arguments:

  • Position 0: Any statement type, returns any, REQUIRED
    Returns: TRUE if value is array, FALSE otherwise

Example:

(function:array/isArray[
  (static:array:[
    (static:number:1),
    (static:number:2),
    (static:number:3)
  ])
])

Returns: true

array/includes #

Categories: array
Return Type: boolean
Purpose: Test if array contains specific element
Syntax: (function:array/includes[{array}, {searchValue}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: Any statement type, returns any, REQUIRED
    Returns: TRUE if array contains element matching searchValue (same type and value), FALSE otherwise

Example:

(function:array/includes[
  (static:array:[
    (static:number:1),
    (static:number:2),
    (static:number:3)
  ]),
  (static:number:2)
])

Returns: true

array/length #

Categories: array
Return Type: number
Purpose: Get count of array elements
Syntax: (function:array/length[{array}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
    Returns: Number of elements in array

Example:

(function:array/length[
  (static:array:[
    (static:string:a),
    (static:string:b),
    (static:string:c)
  ])
])

Returns: 3

array/lengthNotZero #

Categories: array
Return Type: boolean
Purpose: Test if array is non-empty
Syntax: (function:array/lengthNotZero[{array}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
    Returns: TRUE if array length is not zero, FALSE otherwise

Example:

(function:array/lengthNotZero[
  (static:array:[
    (static:number:1),
    (static:number:2)
  ])
])

Returns: true

array/sort #

Categories: array
Return Type: array
Purpose: Sort array using custom comparison logic
Syntax: (function:array/sort[{array}, {scope1}, {scope2}, {comparatorFunction}])

Arguments:

  • Position 0: Any statement type, returns array, REQUIRED (array to sort)
  • Position 1: scope statement, REQUIRED (scope name for first element)
  • Position 2: scope statement, REQUIRED (scope name for second element)
  • Position 3: function statement, returns number, REQUIRED (comparator function)

Comparator Function Return Values:

  • Negative number: First element comes before second (ascending)
  • Zero: Elements are equal (maintain relative order)
  • Positive number: First element comes after second (descending)

Returns: Sorted array

Example – Custom Comparator (Sort objects by property with special value handling):

(function:array/sort[
  (data:vars->filteredMainArray:(static:array:[])),
  (scope:elementA),
  (scope:elementB),
  (function:math/subtract[
    (function:ternary[
      (function:equals[(scope:elementA->position),(static:string:Swatch)]),
      (static:number:0),
      (function:toNumber[(scope:elementA->position)])
    ]),
    (function:ternary[
      (function:equals[(scope:elementB->position),(static:string:Swatch)]),
      (static:number:0),
      (function:toNumber[(scope:elementB->position)])
    ])
  ])
])

With source data:

[
  {"fileName": "Swatch_27665914-2938944.jpg", "position": "Swatch"},
  {"fileName": "27665914-2938944_2_02.jpg", "position": "2"},
  {"fileName": "27665914-2938944_1_1.jpg", "position": "1"}
]

Returns:

[
  {"fileName": "Swatch_27665914-2938944.jpg", "position": "Swatch"},
  {"fileName": "27665914-2938944_1_1.jpg", "position": "1"},
  {"fileName": "27665914-2938944_2_02.jpg", "position": "2"}
]

Use Cases:

  • Complex object sorting by properties
  • Custom sort orders with special value handling
  • Multi-criteria sorting logic
  • Sorting with type conversion or transformation

See Also:

  • Example 6 for detailed custom comparator usage
  • array/sortNumeric for simple numeric array sorting
  • array/sortString for simple string array sorting

array/sortNumeric #

Categories: array
Return Type: array
Purpose: Sort array numerically
Syntax: (function:array/sortNumeric[{array}, {descending?}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: Any statement type, returns boolean, OPTIONAL (default: false)
    Returns: Numerically sorted array (ascending if argument 1 is false/absent, descending if true)

Example – Ascending (default):

(function:array/sortNumeric[
  (static:array:[
    (static:number:7),
    (static:number:3),
    (static:number:6)
  ])
])

Returns: [3, 6, 7]

Example – Descending:

(function:array/sortNumeric[
  (static:array:[
    (static:number:7),
    (static:number:3),
    (static:number:6)
  ]),
  (static:boolean:true)
])

Returns: [7, 6, 3]

Note: This function sorts arrays of numbers. For sorting objects by numeric properties, use array/sort with a custom comparator.

array/sortString #

Categories: array
Return Type: array
Purpose: Sort array alphabetically by string values
Syntax: (function:array/sortString[{array}, {descending?}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: Any statement type, returns boolean, OPTIONAL (default: false)
    Returns: Alphabetically sorted array (ascending if argument 1 is false/absent, descending if true)

Example – Ascending (default):

(function:array/sortString[
  (static:array:[
    (static:string:pear),
    (static:string:apple),
    (static:string:carrot)
  ])
])

Returns: ["apple", "carrot", "pear"]

Example – Descending (reverse alphabetical):

(function:array/sortString[
  (static:array:[
    (static:string:pear),
    (static:string:apple),
    (static:string:carrot)
  ]),
  (static:boolean:true)
])

Returns: ["pear", "carrot", "apple"]

Note: This function performs alphabetical sorting. The sort order follows standard string comparison rules (case-sensitive, lexicographic ordering).

array/reverse #

Categories: array
Return Type: array
Purpose: Reverse array element order
Syntax: (function:array/reverse[{array}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
    Returns: Array with elements in reverse order

Example:

(function:array/reverse[
  (static:array:[
    (static:number:1),
    (static:number:2),
    (static:number:3)
  ])
])

Returns: [3, 2, 1]

array/join #

Categories: array
Return Type: string
Purpose: Convert array to delimited string
Syntax: (function:array/join[{array}, {separator}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED
    Returns: String representation with elements separated by separator string

Example:

(function:array/join[
  (static:array:[
    (static:string:apple),
    (static:string:banana),
    (static:string:orange)
  ]),
  (static:string:, )
])

Returns: "apple, banana, orange"

array/concat #

Categories: array
Return Type: array
Purpose: Concatenate two arrays
Syntax: (function:array/concat[{array1}, {array2}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: Any statement type, returns array, REQUIRED
    Returns: Single array containing elements from array1 followed by elements from array2

Example:

(function:array/concat[
  (static:array:[
    (static:number:1),
    (static:number:2)
  ]),
  (static:array:[
    (static:number:3),
    (static:number:4)
  ])
])

Returns: [1, 2, 3, 4]

array/deepJoin #

Categories: array
Return Type: string
Purpose: Convert nested arrays to delimited string
Syntax: (function:array/deepJoin[{array}, {separator}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED
    Returns: String representation of nested arrays with elements separated by separator

Example:

(function:array/deepJoin[
  (static:array:[
    (static:array:[
      (static:string:a),
      (static:string:b)
    ]),
    (static:array:[
      (static:string:c),
      (static:string:d)
    ])
  ]),
  (static:string:-)
])

Returns: "a-b-c-d"

array/flatten #

Categories: array
Return Type: array
Purpose: Flatten nested arrays
Syntax: (function:array/flatten[{array}, {depth?}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: Any statement type, returns number, OPTIONAL
    Returns: Array with sub-array elements concatenated up to specified depth (all depths if not specified)

Example:

(function:array/flatten[
  (static:array:[
    (static:array:[
      (static:number:1),
      (static:number:2)
    ]),
    (static:array:[
      (static:number:3),
      (static:number:4)
    ])
  ])
])

Returns: [1, 2, 3, 4]

array/filter #

Categories: array
Return Type: array
Purpose: Filter array elements by condition
Syntax: (function:array/filter[{array}, {scopeName}, {testFunction}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: scope statement, REQUIRED
  • Position 2: function statement, returns boolean, REQUIRED
    Behavior:
  • Executes testFunction once per array element
  • Element value is referenced using scopeName identifier
  • Includes element in result if testFunction returns TRUE
    Returns: Filtered array containing only elements passing the test

Example:

(function:array/filter[
  (static:array:[
    (static:number:1),
    (static:number:2),
    (static:number:3),
    (static:number:4)
  ]),
  (scope:item),
  (function:greaterThan[
    (scope:item),
    (static:number:2)
  ])
])

Returns: [3, 4]

array/reduce #

Categories: array
Return Type: any
Purpose: Reduce array to single accumulated value
Syntax: (function:array/reduce[{array}, {accumulatorScope}, {itemScope}, {reducerFunction}, {initialValue}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: scope statement (accumulator reference), REQUIRED
  • Position 2: scope statement (item reference), REQUIRED
  • Position 3: function statement, returns any, REQUIRED
  • Position 4: Any statement type, returns any, REQUIRED
    Behavior:
  • Executes reducerFunction once per array element
  • Accumulated value referenced using accumulatorScope identifier
  • Current element referenced using itemScope identifier
  • First execution uses initialValue as accumulator
  • Each execution replaces accumulator with function return value
    Returns: Final accumulated value

Example (sum array):

(function:array/reduce[
  (static:array:[
    (static:number:1),
    (static:number:2),
    (static:number:3),
    (static:number:4)
  ]),
  (scope:sum),
  (scope:num),
  (function:math/add[
    (scope:sum),
    (scope:num)
  ]),
  (static:number:0)
])

Returns: 10

array/map #

Categories: array
Return Type: array
Purpose: Transform array elements
Syntax: (function:array/map[{array}, {scopeName}, {mapFunction}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: scope statement, REQUIRED
  • Position 2: function statement, returns any, REQUIRED
    Behavior:
  • Executes mapFunction once per array element
  • Element value referenced using scopeName identifier
  • Each execution result becomes corresponding output element
    Returns: New array with transformed elements

Example (multiply each by 2):

(function:array/map[
  (static:array:[
    (static:number:1),
    (static:number:2),
    (static:number:3)
  ]),
  (scope:num),
  (function:math/multiply[
    (scope:num),
    (static:number:2)
  ])
])

Returns: [2, 4, 6]

See Also: Example 2 for complex object transformation

array/new #

Categories: array
Return Type: array
Purpose: Create empty array
Syntax: (function:array/new[])
Arguments: None
Returns: Empty array []

Example:

(function:array/new[])

Returns: []

IMPORTANT:

⚠️ array/new creates ONLY empty arrays []

  • It does NOT accept properties or values as arguments
  • It ONLY returns []

To create arrays WITH values, use static:array instead. If the statement requires a function, then wrap it with function:output:

(function:output[
   (static:array:[
     (static:number:1),
     (static:number:2),
     (static:number:3)
   ])
])

array/append #

Categories: array
Return Type: array
Purpose: Add element to array end
Syntax: (function:array/append[{array}, {element}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: Any statement type, returns any, REQUIRED
    Returns: Array with element appended to end

Example:

(function:array/append[
  (static:array:[
    (static:number:1),
    (static:number:2)
  ]),
  (static:number:3)
])

Returns: [1, 2, 3]

array/getElement #

Categories: array
Return Type: any
Purpose: Get element at specific index
Syntax: (function:array/getElement[{array}, {index}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: Any statement type, returns number, REQUIRED
    Returns: Element at specified index position

Example:

(function:array/getElement[
  (static:array:[
    (static:string:first),
    (static:string:second),
    (static:string:third)
  ]),
  (static:number:1)
])

Returns: "second" (index 1 is the second element)

array/unique #

Categories: array
Return Type: array
Purpose: Remove duplicate elements
Syntax: (function:array/unique[{array}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
    Returns: Array containing only unique elements

Example:

(function:array/unique[
  (static:array:[
    (static:number:1),
    (static:number:2),
    (static:number:2),
    (static:number:3),
    (static:number:1)
  ])
])

Returns: [1, 2, 3]

array/splice #

Categories: array
Return Type: array
Purpose: Remove/add elements at specific position
Syntax: (function:array/splice[{array}, {start?}, {deleteCount?}, {insertArray?}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: Any statement type, returns number, OPTIONAL (default: 0)
  • Position 2: Any statement type, returns number, OPTIONAL (default: 0)
  • Position 3: Any statement type, returns array, OPTIONAL
    Behavior:
  • Removes elements from start index up to (but not including) start + deleteCount
  • Inserts elements from insertArray at start index if provided
    Returns: Modified array

Example (remove 2 elements starting at index 1):

(function:array/splice[
  (static:array:[
    (static:number:1),
    (static:number:2),
    (static:number:3),
    (static:number:4)
  ]),
  (static:number:1),
  (static:number:2)
])

Returns: [1, 4]

array/slice #

Categories: array
Return Type: array
Purpose: Extract array section
Syntax: (function:array/slice[{array}, {start?}, {end?}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: Any statement type, returns number, OPTIONAL (default: 0) – Negative numbers select from end
  • Position 2: Any statement type, returns number, OPTIONAL (default: -1) – Negative numbers select from end
    Returns: Array section from start index to end index

Example:

(function:array/slice[
  (static:array:[
    (static:number:1),
    (static:number:2),
    (static:number:3),
    (static:number:4),
    (static:number:5)
  ]),
  (static:number:1),
  (static:number:4)
])

Returns: [2, 3, 4]


Object Functions #

object/new #

Categories: object
Return Type: object
Purpose: Create empty object
Syntax: (function:object/new[])
Arguments: None – this function takes NO arguments
Returns: Empty object {}

Example:

(function:object/new[])

Returns: {}

IMPORTANT:

⚠️ object/new creates ONLY empty objects {}

  • It does NOT accept properties or values as arguments
  • It does NOT create objects with initial properties
  • It ONLY returns {}

To Create Objects WITH Properties, Use static:object Instead, and if the statement requires a function, then wrap it with “function:output” as follows:

(function:output[
   (static:object:{
     (static:string:name):(static:string:John),
     (static:string:age):(static:number:30)
   })
])

object/mutate #

Categories: object
Return Type: object
Purpose: Add, update, or remove object properties
Syntax: (function:object/mutate[{object}, {mutations}, {removals?}])
Arguments:

  • Position 0: Any statement type, returns object, REQUIRED
  • Position 1: Any statement type, returns object, REQUIRED (mutation instructions)
  • Position 2: Any statement type, returns array, OPTIONAL (must be string array)
    Behavior:
  • Creates copy of input object
  • Adds properties from mutations object not in input
  • Updates properties from mutations object that exist in input
  • Removes properties listed in removals array
    Returns: Mutated object copy

Example:

(function:object/mutate[
  (static:object:{
    (static:string:name):(static:string:John),
    (static:string:age):(static:number:30)
  }),
  (static:object:{
    (static:string:age):(static:number:31),
    (static:string:city):(static:string:Sydney)
  })
])

Returns: {"name": "John", "age": 31, "city": "Sydney"}

object/contains #

Categories: object
Return Type: boolean
Purpose: Test if object has property
Syntax: (function:object/contains[{object}, {propertyName}])
Arguments:

  • Position 0: Any statement type, returns object, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED
    Returns: TRUE if object contains property with specified name, FALSE otherwise

Example:

(function:object/contains[
  (static:object:{
    (static:string:name):(static:string:John),
    (static:string:age):(static:number:30)
  }),
  (static:string:name)
])

Returns: true

object/excludes #

Categories: object
Return Type: boolean
Purpose: Test if object lacks property
Syntax: (function:object/excludes[{object}, {propertyName}])
Arguments:

  • Position 0: Any statement type, returns object, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED
    Returns: TRUE if object does not contain property with specified name, FALSE otherwise

Example:

(function:object/excludes[
  (static:object:{
    (static:string:name):(static:string:John)
  }),
  (static:string:age)
])

Returns: true

object/hasOwnProperty #

Categories: object
Return Type: boolean
Purpose: Test if object has property (same as object/contains)
Syntax: (function:object/hasOwnProperty[{object}, {propertyName}])
Arguments:

  • Position 0: Any statement type, returns object, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED
    Returns: TRUE if object contains property with specified name, FALSE otherwise

Example:

(function:object/hasOwnProperty[
  (static:object:{
    (static:string:name):(static:string:John)
  }),
  (static:string:name)
])

Returns: true

object/getProperty #

Categories: object
Return Type: any
Purpose: Get property value by name
Syntax: (function:object/getProperty[{object}, {propertyName}])
Arguments:

  • Position 0: Any statement type, returns object, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED
    Returns: Value of specified property

Example:

(function:object/getProperty[
  (static:object:{
    (static:string:name):(static:string:John),
    (static:string:age):(static:number:30)
  }),
  (static:string:name)
])

Returns: "John"

See Also: Example 3 for accessing properties with special characters

object/addProperty #

Categories: object
Return Type: object
Purpose: Add new property to object
Syntax: (function:object/addProperty[{object}, {propertyName}, {propertyValue}])
Arguments:

  • Position 0: Any statement type, returns object, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED
  • Position 2: Any statement type, returns any, REQUIRED
    Returns: Object copy with new property added

Example:

(function:object/addProperty[
  (static:object:{
    (static:string:name):(static:string:John)
  }),
  (static:string:age),
  (static:number:30)
])

Returns: {"name": "John", "age": 30}

object/removeProperty #

Categories: object
Return Type: object
Purpose: Remove property from object
Syntax: (function:object/removeProperty[{object}, {propertyName}])
Arguments:

  • Position 0: Any statement type, returns object, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED
    Returns: Object copy with specified property removed

Example:

(function:object/removeProperty[
  (static:object:{
    (static:string:name):(static:string:John),
    (static:string:age):(static:number:30)
  }),
  (static:string:age)
])

Returns: {"name": "John"}


String Functions #

string/startsWith #

Categories: string
Return Type: boolean
Purpose: Test if string starts with substring
Syntax: (function:string/startsWith[{string}, {prefix}])
Arguments:

  • Position 0: Any statement type, returns string, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED
    Returns: TRUE if string starts with prefix characters, FALSE otherwise

Example:

(function:string/startsWith[
  (static:string:hello world),
  (static:string:hello)
])

Returns: true

string/endsWith #

Categories: string
Return Type: boolean
Purpose: Test if string ends with substring
Syntax: (function:string/endsWith[{string}, {suffix}])
Arguments:

  • Position 0: Any statement type, returns string, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED
    Returns: TRUE if string ends with suffix characters, FALSE otherwise

Example:

(function:string/endsWith[
  (static:string:hello world),
  (static:string:world)
])

Returns: true

string/split #

Categories: string
Return Type: array
Purpose: Split string into array by separator
Syntax: (function:string/split[{string}, {separator}])
Arguments:

  • Position 0: Any statement type, returns string, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED
    Returns: Array of substrings split on separator

Example:

(function:string/split[
  (static:string:apple,banana,orange),
  (static:string:,)
])

Returns: ["apple", "banana", "orange"]

string/substring #

Categories: string
Return Type: string
Purpose: Extract substring by position
Syntax: (function:string/substring[{string}, {start}, {end}])
Arguments:

  • Position 0: Any statement type, returns string, REQUIRED
  • Position 1: Any statement type, returns number, REQUIRED (character position, 0-indexed)
  • Position 2: Any statement type, returns number, REQUIRED (character position, 0-indexed)
    Returns: Substring from start position to end position

Example:

(function:string/substring[
  (static:string:hello world),
  (static:number:0),
  (static:number:5)
])

Returns: "hello"

string/replace #

Categories: string
Return Type: string
Purpose: Replace string parts using regex
Syntax: (function:string/replace[{string}, {regex}, {replacement}])
Arguments:

  • Position 0: Any statement type, returns string, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED (regular expression)
  • Position 2: Any statement type, returns string, REQUIRED
    Returns: String with matched parts replaced

Example:

(function:string/replace[
  (static:string:hello world),
  (static:string:world),
  (static:string:there)
])

Returns: "hello there"

See Also: Example 2 for regex usage in phone number formatting

string/match #

Categories: string
Return Type: array
Purpose: Find matching substrings
Syntax: (function:string/match[{string}, {pattern}])
Arguments:

  • Position 0: Any statement type, returns string, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED (string or regex pattern)
    Returns: Array of matching substrings

Example:

(function:string/match[
  (static:string:hello world),
  (static:string:l+)
])

Returns: ["ll", "l"]

string/toLowercase #

Categories: string
Return Type: string
Purpose: Convert to lowercase
Syntax: (function:string/toLowercase[{string}])
Arguments:

  • Position 0: Any statement type, returns string, REQUIRED
    Returns: String with all uppercase characters converted to lowercase

Example:

(function:string/toLowercase[
  (static:string:HELLO World)
])

Returns: "hello world"

string/toUppercase #

Categories: string
Return Type: string
Purpose: Convert to uppercase
Syntax: (function:string/toUppercase[{string}])
Arguments:

  • Position 0: Any statement type, returns string, REQUIRED
    Returns: String with all lowercase characters converted to uppercase

Example:

(function:string/toUppercase[
  (static:string:hello World)
])

Returns: "HELLO WORLD"

string/concat #

Categories: string
Return Type: string
Purpose: Concatenate two strings
Syntax: (function:string/concat[{string1}, {string2}])
Arguments:

  • Position 0: Any statement type, returns string, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED
    Returns: Combined string

Example:

(function:string/concat[
  (static:string:Hello ),
  (static:string:World)
])

Returns: "Hello World"

See Also: Example 1 for date range concatenation


Math Functions #

math/add #

Categories: math
Return Type: number
Purpose: Addition operation
Syntax: (function:math/add[{number1}, {number2}])
Arguments:

  • Position 0: Any statement type, returns number, REQUIRED
  • Position 1: Any statement type, returns number, REQUIRED
    Returns: Sum of number1 + number2

Example:

(function:math/add[
  (static:number:5),
  (static:number:3)
])

Returns: 8

math/subtract #

Categories: math
Return Type: number
Purpose: Subtraction operation
Syntax: (function:math/subtract[{number1}, {number2}])
Arguments:

  • Position 0: Any statement type, returns number, REQUIRED
  • Position 1: Any statement type, returns number, REQUIRED
    Returns: Difference of number1 – number2

Example:

(function:math/subtract[
  (static:number:10),
  (static:number:3)
])

Returns: 7

See Also: Example 6 for complex usage in custom array sorting

math/multiply #

Categories: math
Return Type: number
Purpose: Multiplication operation
Syntax: (function:math/multiply[{number1}, {number2}])
Arguments:

  • Position 0: Any statement type, returns number, REQUIRED
  • Position 1: Any statement type, returns number, REQUIRED
    Returns: Product of number1 * number2

Example:

(function:math/multiply[
  (static:number:4),
  (static:number:5)
])

Returns: 20

math/divide #

Categories: math
Return Type: number
Purpose: Division operation
Syntax: (function:math/divide[{number1}, {number2}])
Arguments:

  • Position 0: Any statement type, returns number, REQUIRED
  • Position 1: Any statement type, returns number, REQUIRED
    Returns: Quotient of number1 / number2

Example:

(function:math/divide[
  (static:number:20),
  (static:number:4)
])

Returns: 5

math/modulus #

Categories: math
Return Type: number
Purpose: Modulo operation
Syntax: (function:math/modulus[{number1}, {number2}])
Arguments:

  • Position 0: Any statement type, returns number, REQUIRED
  • Position 1: Any statement type, returns number, REQUIRED
    Returns: Remainder of number1 / number2

Example:

(function:math/modulus[
  (static:number:10),
  (static:number:3)
])

Returns: 1

math/power #

Categories: math
Return Type: number
Purpose: Exponentiation operation
Syntax: (function:math/power[{base}, {exponent}])
Arguments:

  • Position 0: Any statement type, returns number, REQUIRED
  • Position 1: Any statement type, returns number, REQUIRED
    Returns: base raised to exponent power

Example:

(function:math/power[
  (static:number:2),
  (static:number:3)
])

Returns: 8

math/floor #

Categories: math
Return Type: number
Purpose: Round down to integer
Syntax: (function:math/floor[{number}])
Arguments:

  • Position 0: Any statement type, returns number, REQUIRED
    Returns: Number rounded down to nearest integer

Example:

(function:math/floor[
  (static:number:5.7)
])

Returns: 5

math/ceil #

Categories: math
Return Type: number
Purpose: Round up to integer
Syntax: (function:math/ceil[{number}])
Arguments:

  • Position 0: Any statement type, returns number, REQUIRED
    Returns: Number rounded up to nearest integer

Example:

(function:math/ceil[
  (static:number:5.2)
])

Returns: 6

math/random #

Categories: math
Return Type: number
Purpose: Generate random decimal
Syntax: (function:math/random[])
Arguments: None
Returns: Random number between 0 (inclusive) and 1 (exclusive)

Example:

(function:math/random[])

Returns: 0.7234567 (example value – actual result varies)

math/randomInteger #

Categories: math
Return Type: number
Purpose: Generate random integer in range
Syntax: (function:math/randomInteger[{min}, {max}])
Arguments:

  • Position 0: Any statement type, returns number, REQUIRED
  • Position 1: Any statement type, returns number, REQUIRED
    Returns: Random integer between min and max

Example:

(function:math/randomInteger[
  (static:number:1),
  (static:number:10)
])

Returns: 7 (example value – actual result varies)


Control Functions #

forEach #

Categories: control
Return Type: undefined (no return value)
Purpose: Iterate over array elements
Syntax: (function:forEach[{array}, {scopeName}, {iteratorFunction}])
Arguments:

  • Position 0: Any statement type, returns array, REQUIRED
  • Position 1: scope statement, REQUIRED
  • Position 2: function statement, REQUIRED
    Behavior: Executes iteratorFunction once per array element, element referenced using scopeName

Example:

(function:forEach[
  (static:array:[
    (static:number:1),
    (static:number:2),
    (static:number:3)
  ]),
  (scope:item),
  (function:assign[
    (data:vars->total),
    (function:math/add[
      (data:vars->total:(static:number:0)),
      (scope:item)
    ])
  ])
])

Result: Executes assign 3 times, accumulating values in vars->total

if #

Categories: control
Return Type: undefined (no return value)
Purpose: Conditional execution
Syntax: (function:if[{condition}, {trueFunction}, {falseFunction}])
Arguments:

  • Position 0: Any statement type, returns boolean, REQUIRED
  • Position 1: function statement, REQUIRED
  • Position 2: function statement, REQUIRED
    Behavior: Executes trueFunction if condition is TRUE, falseFunction otherwise

Example:

(function:if[
  (function:greaterThan[
    (data:vars->count),
    (static:number:10)
  ]),
  (function:assign[
    (data:vars->status),
    (static:string:high)
  ]),
  (function:assign[
    (data:vars->status),
    (static:string:low)
  ])
])

Result: Sets vars->status to “high” if count > 10, otherwise “low”

loop #

Categories: control
Return Type: undefined (no return value)
Purpose: Fixed iteration count
Syntax: (function:loop[{count}, {loopFunction}])
Arguments:

  • Position 0: Any statement type, returns number, REQUIRED
  • Position 1: function statement, REQUIRED
    Behavior: Executes loopFunction specified number of times

Example:

(function:loop[
  (static:number:5),
  (function:assign[
    (data:vars->counter),
    (function:math/add[
      (data:vars->counter:(static:number:0)),
      (static:number:1)
    ])
  ])
])

Result: Increments vars->counter 5 times

throw #

Categories: control
Return Type: undefined (no return value)
Purpose: Raise exception
Syntax: (function:throw[{message}])
Arguments:

  • Position 0: Any statement type, returns string, REQUIRED
    Behavior: Throws exception with specified message

Example:

(function:throw[
  (static:string:Required field 'email' is missing)
])

Result: Throws exception and terminates workflow execution

See Also: Example 1 for error-first data access pattern

assign #

Categories: control
Return Type: undefined (no return value)
Purpose: Assign value to data reference
Syntax: (function:assign[{targetDataReference}, {value}])
Arguments:

  • Position 0: data statement, REQUIRED
  • Position 1: Any statement type, returns any, REQUIRED
    Behavior: Assigns value to specified data reference path

Example:

(function:assign[
  (data:vars->userName),
  (static:string:John Doe)
])

Result: Sets vars->userName to “John Doe”

output #

Categories: control
Return Type: any
Purpose: Return value (explicit output)
Syntax: (function:output[{value}])
Arguments:

  • Position 0: Any statement type, returns any, REQUIRED
    Returns: Result of argument

Example:

(function:output[
  (static:string:Processing complete)
])

Returns: "Processing complete"


DateTime Functions #

date #

Categories: datetime
Return Type: string
Purpose: Calculate date using DayJS operations
Syntax: (function:date[{dateString}, {operations}])
Arguments:

  • Position 0: Any statement type, returns string, REQUIRED (must be valid ISO 8601 date string)
  • Position 1: Any statement type, returns array, REQUIRED (each element must be valid DayJS operation string)
    Example:
(function:date[(static:string:now),(static:array:[(static:string:tz(Australia/Sydney))])])

Returns:

"2025-09-03T09:57:03+10:00"

assignDate #

Categories: datetime, control
Return Type: undefined (no return value)
Purpose: Assign calculated date to data reference
Syntax: (function:assignDate[{targetDataReference}, {dateString}, {operations}])
Arguments:

  • Position 0: data statement, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED (must be valid ISO 8601 date string)
  • Position 2: Any statement type, returns array, REQUIRED (each element must be valid DayJS operation string)

Example:

(function:assignDate[
  (data:vars->timestamp),
  (static:null),
  (static:array:[
    (static:string:tz(Australia/Sydney)),
    (static:string:format(YYYY-MM-DD HH:mm:ss))
  ])
])

Result: Sets vars->timestamp to current date/time in AEST format


Cryptography Functions #

hmacSha256 #

Categories: cryptography, encoding
Return Type: string
Purpose: HMAC-SHA256 encoding
Syntax: (function:hmacSha256[{data}, {key}])
Arguments:

  • Position 0: Any statement type, returns string, REQUIRED
  • Position 1: Any statement type, returns string, REQUIRED (encryption key)
    Returns: HMAC-SHA256 encoded string

Decoding Functions #

json/parse #

Categories: decoding
Return Type: any
Purpose: Parse JSON string to value
Syntax: (function:json/parse[{jsonString}])
Arguments:

  • Position 0: Any statement type, returns string, REQUIRED
    Returns: Parsed JSON value

Example:

(function:json/parse[
  (static:string:{"name":"John","age":30})
])

Returns: {"name": "John", "age": 30}


Encoding Functions #

json/stringify #

Categories: encoding
Return Type: string
Purpose: Encode value to JSON string
Syntax: (function:json/stringify[{value}])
Arguments:

  • Position 0: Any statement type, returns any, REQUIRED
    Returns: JSON string representation

Example:

(function:json/stringify[
  (static:object:{
    (static:string:name):(static:string:John),
    (static:string:age):(static:number:30)
  })
])

Returns: "{\"name\":\"John\",\"age\":30}"


Type Conversion Functions #

toString #

Categories: type conversion
Return Type: string
Purpose: Convert value to string
Syntax: (function:toString[{value}])
Arguments:

  • Position 0: Any statement type, returns any, REQUIRED
    Returns: String representation of value

Example 1 – Number to string:

(function:toString[(static:number:42)])

Returns: "42"

Example 2 – Boolean to string:

(function:toString[(static:boolean:true)])

Returns: "true"

toNumber #

Categories: type conversion
Return Type: number
Purpose: Convert value to number
Syntax: (function:toNumber[{value}])
Arguments:

  • Position 0: Any statement type, returns string/boolean/number, REQUIRED
    Returns: Numeric representation of value

Example 1 – String to number:

(function:toNumber[(static:string:42)])

Returns: 42

Example 2 – Boolean to number:

(function:toNumber[(static:boolean:true)])

Returns: 1

See Also: Examples 4 and 6 for usage in time validation and sorting


Data Reference Statements #

Statement Type: data
Argument Form: 3 arguments
Purpose: Reference runtime data values

Data Statement Syntax #

(data:{Reference Path}:{Default Statement})

Components:

  • Reference Path: String path to data source location
  • Default Statement: Any mapper statement executed when no data exists at path

Best Practices for Default Values #

IMPORTANT: Always provide appropriate default values when referencing data sources to prevent errors when variables are uninitialized.

Default Value Guidelines:

  1. Match the Expected Data Type
    Use a default that matches the type you expect from the data source:

    (data:vars->personName:(static:string:))
    

    From the variable name personName, we can deduce it will be a string, so use an empty string as the default.

    (data:vars->itemCount:(static:number:0))
    

    For numeric values, use 0 or another appropriate number as the default.

    (data:workflow->input->payload->items:(static:array:[]))
    

    For arrays, use an empty array as the default.

    (data:vars->userProfile:(static:object:{}))
    

    For objects, use an empty object as the default.

  2. Use null When Type is Unknown
    If the data type is uncertain or could vary:

    (data:vars->dynamicValue:(static:null))
    

Common Patterns:

Expected TypeDefault ValueExample
String(static:string:)(data:vars->name:(static:string:))
Number(static:number:0)(data:vars->count:(static:number:0))
Boolean(static:boolean:false)(data:vars->isActive:(static:boolean:false))
Array(static:array:[])(data:vars->items:(static:array:[]))
Object(static:object:{})(data:vars->config:(static:object:{}))
Unknown(static:null)(data:vars->value:(static:null))

Why This Matters:

  • Prevents runtime errors when variables are uninitialized
  • Ensures mapper statements execute successfully
  • Provides predictable behavior in edge cases
  • Makes code more resilient to missing data

Reference Path Structure #

Format: {sourceType}->{path segments separated by ->}

Path segments may include:

  • Property names (object navigation)
  • Property names with spaces (no escaping needed)
  • Array indices using bracket notation: [index]
  • Nested combinations

Accessing Fields with Spaces:
Fields with spaces in their names can be accessed directly without any special quoting or escaping:

workflow->input->payload->Customer Name
vars->Product Info->Stock Level
tasks->getOrder->payload->Order Details->Shipping Address

Example with spaces in nested path:

(data:workflow->input->payload->Contact List[0]->First Name:(static:string:Unknown))

Example with special characters:

(data:vars->Order Info->Total ($):(static:number:0))
(data:tasks->getData->payload->Record #:(static:string:))

Data Source Types #

Variable Source #

Source Type: vars
Path Structure: vars->{varName}->...
Data Type: any
Purpose: Access workflow variables

Examples:

vars->name
vars->record->id

Environment Variable Source #

Source Type: envVars
Path Structure: envVars->{envVarName}
Data Type: string | number | boolean
Purpose: Access environment configuration

Example:

envVars->maxRecordCount

Flow Attribute Source #

Source Type: flowAttributes
Path Structure: flowAttributes->{flowAttributeName}->...
Data Type: any
Purpose: Access flow-level attributes

Examples:

flowAttributes->flowAuditId
flowAttributes->asset->expiryDate

Task Source #

Source Type: tasks
Path Structure: tasks->{taskName}->{component}->...
Purpose: Access task execution data

Components:

  • payload – Task response data (any type)
  • attributes->{attributeName} – Task attributes (string | number | boolean)
  • metadata->{metadataField} – Task execution metadata

Metadata Fields:

  • startTime (string) – Task start timestamp
  • runTime (number) – Execution duration
  • endTime (string) – Task end timestamp
  • payloadSize (number) – Payload byte size
  • status (string) – Task status

Examples:

tasks->getRecordId->payload
tasks->getPersonDetails->payload->name
tasks->findAssets->attributes->totalHits
tasks->downloadAsset->metadata->payloadSize

Workflow Source #

Source Type: workflow
Path Structure: workflow->{component}->...
Purpose: Access workflow-level data

Components:

  • input->payload – Workflow input data (any type)
  • status (string) – Current workflow status
  • metadata->{metadataField} – Workflow metadata

Metadata Fields:

  • correlationId (string) – Workflow correlation ID
  • workflow (string) – Workflow name
  • workflowVersion (number) – Workflow version number
  • startTime (string) – Workflow start timestamp
  • runTime (number) – Execution duration
  • envId (string) – Environment ID
  • region (string) – Execution region
  • dataIsSensitive (boolean) – Sensitive data flag

Examples:

workflow->input->payload
workflow->input->payload->recordId
workflow->status
workflow->metadata->startTime

Exception Attribute Source #

Source Type: exceptionAttributes
Path Structure: exceptionAttributes->{component}->...
Purpose: Access exception context data

Components:

  • class (string) – Exception class
  • message (string) – Exception message
  • retryCount (number) – Retry attempt count
  • task->id (string) – Failed task ID
  • task->sequenceNumber (number) – Task sequence number
  • task->name (string) – Task name
  • task->module->name (string) – Module name
  • task->module->version (number) – Module version
  • task->module->configId (string, optional) – Module config ID

Examples:

exceptionAttributes->message
exceptionAttributes->task->name
exceptionAttributes->task->module->name

Audit Attribute Source #

Source Type: auditAttributes
Path Structure: auditAttributes->task->{component}->...
Purpose: Access audit context data

Components:

  • task->id (string) – Audited task ID
  • task->sequenceNumber (number) – Task sequence number
  • task->name (string) – Task name
  • task->module->name (string) – Module name
  • task->module->version (number) – Module version
  • task->module->configId (string, optional) – Module config ID

Example:

auditAttributes->task->name

Scope Statements #

Statement Type: scope
Argument Form: 2 arguments
Usage Context: Function arguments only (not top-level statements)
Purpose: Create named references for iteration variables

Scope Statement Syntax #

(scope:{Name})

Applicable Functions:

  • array/filter
  • array/reduce
  • array/map
  • forEach

Usage Pattern #

Scope statements define identifiers that reference current iteration values within array processing functions. The scope name can then be used in data references within the function body.

Example in array/filter:

(function:array/filter[
    {array},
    (scope:item),
    (function:equals[(scope:item->status),(static:string:active)])
])

In this example, (scope:item) creates a reference name, and (scope:item->status) accesses the status property of each array element during iteration.

Accessing Fields with Spaces in Names #

When object properties contain spaces or special characters, they can be accessed directly in scope references using the same arrow notation.

Important: No special quoting or escaping is required – spaces are handled naturally in the reference path.

Example 1 – Simple field with spaces:

(function:array/map[
  (static:array:[
    (static:object:{
      (static:string:First Name):(static:string:John),
      (static:string:Last Name):(static:string:Smith)
    }),
    (static:object:{
      (static:string:First Name):(static:string:Jane),
      (static:string:Last Name):(static:string:Doe)
    })
  ]),
  (scope:person),
  (scope:person->First Name)
])

Returns: ["John", "Jane"]

Example 2 – Nested fields with spaces:

(function:array/filter[
  (static:array:[
    (static:object:{
      (static:string:Product Name):(static:string:Widget A),
      (static:string:Stock Info):(static:object:{
        (static:string:Quantity Available):(static:number:50)
      })
    }),
    (static:object:{
      (static:string:Product Name):(static:string:Widget B),
      (static:string:Stock Info):(static:object:{
        (static:string:Quantity Available):(static:number:5)
      })
    })
  ]),
  (scope:product),
  (function:greaterThan[
    (scope:product->Stock Info->Quantity Available),
    (static:number:10)
  ])
])

Returns: Array containing only Widget A (quantity 50 > 10)

Example 3 – Fields with special characters:

(function:array/map[
  (static:array:[
    (static:object:{
      (static:string:Customer Name):(static:string:ACME Corp),
      (static:string:Order #):(static:string:ORD-001),
      (static:string:Total ($)):(static:number:1500.50)
    })
  ]),
  (scope:order),
  (static:object:{
    (static:string:customer):(scope:order->Customer Name),
    (static:string:orderNumber):(scope:order->Order #),
    (static:string:amount):(scope:order->Total ($))
  })
])

Returns:

[{
  "customer": "ACME Corp",
  "orderNumber": "ORD-001",
  "amount": 1500.50
}]

Example 4 – Combining with data references:

(function:forEach[
  (data:workflow->input->payload->Contact List:(static:array:[])),
  (scope:contact),
  (function:assign[
    (data:vars->processedContacts),
    (function:array/append[
      (data:vars->processedContacts:(static:array:[])),
      (static:object:{
        (static:string:fullName):(function:string/concat[
          (scope:contact->First Name),
          (function:string/concat[
            (static:string: ),
            (scope:contact->Last Name)
          ])
        ]),
        (static:string:email):(scope:contact->Email Address)
      })
    ])
  ])
])

Common Field Name Patterns:

  • (scope:item->Field Name) – Basic field with spaces
  • (scope:item->First Level->Second Level) – Nested fields with spaces
  • (scope:item->Product SKU) – Fields with acronyms
  • (scope:item->Price (USD)) – Fields with parentheses
  • (scope:item->Order #) – Fields with symbols
  • (scope:item->Customer's Name) – Fields with apostrophes

Note: While spaces and special characters work in scope references, it’s recommended to use camelCase or snake_case for new field names to improve readability and consistency.


Complete Example #

Context #

Task getPersonDetails returns:

{
    "resultset": [{
        "id": "56065fa5-e2ee-4afd-98dc-90ca25d1ed99",
        "name": "Joe Bloggs",
        "dob": "1983-08-13",
        "favFoods": "FishNChips,Burger,Churros"
    }]
}

Variable personName contains: "Joe Bloggs"

Mapper Statement #

(static:array:[
    (static:object:{
        (static:string:name): (static:string:John Doe),
        (static:string:dob): (static:string:1970-01-01),
        (static:string:favFoods): (static:array:[
            (static:string:Pizza),
            (static:string:Steak)
        ])
    }),
    (static:object:{
        (static:string:name): (data:vars->personName:(static:null)),
        (static:string:dob): (data:tasks->getPersonDetails->payload->resultset[0]->dob:(static:null)),
        (static:string:favFoods): (function:string/split[
            (data:tasks->getPersonDetails->payload->resultset[0]->favFoods:(static:string:)),
            (static:string:,)
        ])
    })
])

Result #

[
    {
        "name": "John Doe",
        "dob": "1970-01-01",
        "favFoods": ["Pizza", "Steak"]
    },
    {
        "name": "Joe Bloggs",
        "dob": "1983-08-13",
        "favFoods": ["FishNChips", "Burger", "Churros"]
    }
]

Example Explanation #

This statement demonstrates:

  • Static object construction
  • Static array construction
  • Data references to variables
  • Data references to task payload with array indexing
  • Function usage (string/split)
  • Default statements (null and empty string)
  • Nested statement composition

Quick Reference Summary #

Statement Type Keywords #

  • static – Literal values with type specification
  • function – Operation execution
  • data – Runtime data reference
  • scope – Iteration variable naming (function arguments only)

Common Patterns #

Conditional Value Selection

(function:ternary[
    {boolean condition},
    {value if true},
    {value if false}
])

Array Transformation

(function:array/map[
    {source array},
    (scope:{item reference name}),
    {transformation function using scope:{item reference name}}
])

Array Filtering

(function:array/filter[
    {source array},
    (scope:{item reference name}),
    {boolean test function using scope:{item reference name}}
])

Safe Data Access with Defaults

(data:{path to data}:{default value statement if path not found})

Object Construction from Mixed Sources

(static:object:{
    (static:string:{property name}): {value statement - can be static, data, or function},
    ...
})

Function Return Type Matrix #

CategoryReturns ValueReturns undefined
comparison✓ 
logical✓ 
type checking✓ 
array✓ 
object✓ 
string✓ 
math✓ 
control ✓ (except output, ternary)
datetime✓✓ (assignDate)
cryptography✓ 
decoding✓ 
encoding✓ 
type conversion✓ 

Note: Only value-returning functions can be used as arguments to other functions.


Version Information #

Documentation Generated: 2025
Source System: SiPHON Core
Coverage: Complete Mapper statement definition including all 70+ functions
Last Updated: December 2025 – Added comprehensive string escaping documentation with examples for forward slash (//), parentheses (/(,/)), newlines (/n), and tabs (/t). Clarified that escaping only applies to static:string values, not field names or data paths.

Was it helpful ?
Updated on February 24, 2026
en_USEnglish