Skip to content

Payload Templates

A payload template turns the process’s state into a payload: the reply a REPLY step gives, the data of an event a PUBLISH_EVENT step publishes, the body (and URL, query and headers) of an HTTP_CALL, the prompts of an LLM_CALL. Expressions go in ${…} and are JEXL, evaluated in the same sandbox as every other expression in a definition — no loops, lambdas, side effects or reflection, bounded size — because a definition may come from git.

Structured templates — JSON with typed leaves

Section titled “Structured templates — JSON with typed leaves”

Write the payload as JSON/YAML; string leaves may hold expressions:

body:
orderId: "${orderId}" # "O-1" (a string variable stays a string)
total: "${amount * 1.21}" # 121.0 (a number, not "121.0")
items: "${items}" # [{"sku":"A"}] (a variable holding a JSON array is parsed)
express: "${shipping == 'express'}" # true
customer: { id: "${customerId}", tier: "${tier ?: 'standard'}" }
note: "Order ${orderId} for ${customerName}" # interpolated text
source: eventconductor # constant
  • A leaf that is exactly one ${…} keeps the value’s type. Process variables are strings, so a variable that holds a JSON object or array is parsed into it; arithmetic (${amount * 1}) makes a number.
  • A leaf with text around its expressions is a string.
  • Anything that is not a string is a constant. The result is always valid JSON — no escaping to get wrong.
  • $${ is a literal ${.

For XML, form bodies or any other format: bodyTemplate / payloadTemplate, interpolation only — the author owns the format.

bodyTemplate: "<order id=\"${orderId}\" total=\"${amount}\"/>"
namevalue
each process variableits value (a string) — except, in a child a forEach started, the item and its index (as, indexAs), read as structure: ${room.number}
processid, businessKey, workflowDefinitionId, version
stepid, name, executionId
nowthe current instant, ISO-8601
businessKeythe process’s business key — inside an inline PROCESS body, the business key of the process that owns the body

Nothing else — no environment, no secrets.

Every ${…} is parsed at build time (the Maven plugin) and when the definition is imported; a template that does not parse is an error. A template that cannot be evaluated at run time fails the step (so retries and compensation apply) — it never yields a silently empty payload. An undefined variable is not an error: it reads as null.