Generators
New random identifiers.
Each example was run against the deployed expression engine over the example context at the end of the page.
$uuid
A random UUID version 4, 36 characters in the 8-4-4-4-12 hexadecimal layout. It is a property, not a function: write $uuid, not $uuid(). Every read produces a new value, even twice in the same expression.
Examples
Errors
| Message | Cause and fix |
|---|---|
$uuid is not a function | It was called as $uuid(). Remove the parentheses. |
Notes
- When several nodes need the same id, generate it once (for example in a
data.transform) and read it from that node with$('…').
In JSONata $$uuid
$randomId
Returns prefix followed by length random hexadecimal characters (0-9, a-f). Use it for human-friendly references; for a standard identifier use $uuid.
Parameters
-
optionsobject required - Always pass an object, even an empty one:
$randomId()without it fails. -
options.lengthnumber optional default15 - How many random characters (up to 512).
-
options.prefixstring optional default'id-' - Text placed before them.
Returns
string prefix + length hexadecimal characters.
Examples
Without the options object it fails.
Errors
| Message | Cause and fix |
|---|---|
Cannot destructure property 'length' of 'undefined' as it is undefined. | It was called without the options object. Pass {} at least. |
In JSONata $$randomId({ "length": 8, "prefix": "ord-" })
Example context
The examples run over this data: the input of the current node ($json), the nodes that already ran ($(…)), the ids of the run and the current node. The clock is fixed at 2026-11-26T14:30:00.000Z and the server zone is UTC, so $now and $today give the same values on every page.
{
"$json": {
"body": {
"order_id": "ord_1042",
"email": "ana.perez@example.com",
"customer": {
"name": "Ana Pérez",
"segment": "gold"
},
"priority": "",
"items": [
{
"sku": "A-100",
"qty": 2,
"price": 10.5
},
{
"sku": "B-200",
"qty": 0,
"price": 4
},
{
"sku": "C-300",
"qty": 1,
"price": 25
}
],
"tags": [
"new",
"web",
"new"
],
"created_at": "2026-11-25T09:15:00Z"
},
"headers": {
"content-type": "application/json"
},
"query": {},
"method": "POST"
}
}{
"Webhook Receiver": "= $json",
"Normalize input": {
"correlation_id": "c-7f3a",
"channel": "web"
},
"Classify": {
"label": "billing",
"confidence": 0.92
}
}{
"$execution": {
"id": "fir-xxxx",
"flow_instance_id": "fi-xxxx",
"flow_definition_id": "fd-xxxx",
"flow_version_id": "fv-xxxx",
"flow_slug": "order-intake"
},
"$node": {
"id": "node-notify",
"label": "Notify customer"
}
} Examples run against the orchestrator at commit 31e874b