Skip to content

Template node

The Template node builds a string by filling ${...} placeholders with values from your flow — references, secrets, and environment variables — and stores the result in a variable. Use it to compose an email body, a URL, a JSON payload, or any text that mixes fixed wording with live values.

Component id: flowrunner/template.

How it works

Template takes a template string and renders it in two passes, then stores the result under a variable:

  1. Secrets and environment first. ${secrets.NAME} and ${env.NAME} are resolved. A missing secret renders as an empty string (fail-closed) — it never falls back to an environment variable.
  2. Flow references next. Every remaining ${namespace.field} token is read from the flow's refs. Unlike the Set and ForEach nodes, Template walks the full dotted path, so ${response.body.name} reaches a nested value.

How values are coerced

  • A scalar (string, number, boolean) is inserted directly as text.
  • An object or array is serialised with JSON.stringify before being inserted.
  • An unknown reference — a path that doesn't resolve — renders as an empty string.

The result is always a single string, stored as { value: "<rendered text>" }. Read it back as variable.value.

Config

FieldRequiredDescription
varNo (default text)The variable name the rendered string is stored under.
templateYesThe template string. Supports ${namespace.field} refs, ${secrets.NAME}, and ${env.NAME}.

Ports

Template has a single next port.

Examples

Compose a greeting from a request field and a secret:

text
Template  var: msg
  template: "Hi ${start.name}, your key is ${secrets.API_KEY}"
# → refs.msg = { value: "Hi Ada, your key is xyz" }

Serialise an object and blank a missing ref:

text
Template  var: out
  template: "${start.obj}|${start.missing}"
# start.obj = { a: 1 }  → refs.out = { value: '{"a":1}|' }

Build a URL for a downstream HTTP node:

text
Template  var: endpoint
  template: "${env.API_BASE}/users/${start.userId}"
# read later as: endpoint.value

TIP

Template is the right tool when you need nested references (a.b.c) or want to combine several values into one string. For a straight one-to-one copy of a single value, reach for the Set node instead.

WARNING

Referencing an object inside a template inserts its raw JSON. That's handy for building a JSON body, but if you only want one field, drill into it — ${response.body.id}, not ${response.body}.

See also

FlowRunner — the no-code platform for small businesses.