Skip to content
LogoLogo

Workflow templates

A template is text with {{ … }} in it. Picked fills it with data from the run before the node uses it. A tool node can have a template in each of its fields. A condition node can have a template in a text value of its rule.

Data that a template reads

RootDataExample
triggerThe event or the action that started the run. Refer to Trigger.trigger.action.responses.email
nodes.<node-id>The output of the last visit to a tool node. Refer to Loops.nodes.n2.leads[0].id
runThe run. Refer to Variables.run.startedAt
workflowThe workflow. Refer to Variables.workflow.name
currentThe node that reads the data. Refer to Variables.current.visit

A template writes an index as [0], such as leads[0].id. The var operator of a rule reads the same paths, and writes an index as a segment, such as leads.0.id.

In the editor, the Insert reference button of a field shows the data that the node can read. The Previous steps tab shows trigger and nodes. The Variables tab shows run, workflow and current.

Trigger

All runs have these paths below trigger: id, name, occurredAt, projectId, workspaceId, entityId and actorId. The trigger of the workflow adds more paths:

TriggerPathValue
An actiontrigger.action.actionKeyThe key of the action.
An actiontrigger.action.pickedIdThe Picked ID of the visitor.
An actiontrigger.action.responses.<key>The answer to a field that the action has.
An eventtrigger.event.nameThe name of the event, such as workspace.published.
lead.created, lead.updatedtrigger.lead.idThe ID of the lead.
lead.created, lead.updatedtrigger.lead.pickedIdThe Picked ID of the visitor.
lead.created, lead.updatedtrigger.lead.workspaceVersionIdThe workspace version that captured the lead.
lead.created, lead.updatedtrigger.lead.createdAtThe time that Picked captured the lead.
lead.created, lead.updatedtrigger.lead.responses.<key>The answer to a field of the workspace.
lead.created, lead.updatedtrigger.lead.labels.<namespace>.<key>The value of a label on the lead.

A lead event also has trigger.event.name. trigger.lead.userId is the old name of trigger.lead.pickedId.

Picked reads the lead when each node starts. A node reads the labels and the answers that the lead has at that time, not the values at the time of the event. A node after a Set lead labels node reads the labels that it set. In a test run with Execute writes off, Set lead labels does not write. The nodes after it read the old labels.

A Create lead or Create or update lead node writes the labels in its labels argument before Picked sends lead.created or lead.updated. The first node of a workflow for that event reads these labels.

If the lead was deleted, the node fails.

A workflow for lead.created or lead.updated reads leads, so it needs the scope ORGANIZATION_LEADS_READ. To save the workflow, you must have this scope.

To set labels on the lead of the event, set the lead argument of a Set lead labels node to {{ trigger.lead }}.

In a test run of a workflow for lead.created or lead.updated, you must give the ID of a lead.

Variables

PathTypeValue
run.idTextThe ID of the run, such as wkrun_…. In a test run, the ID of the test run.
run.startedAtTextThe time that Picked recorded the run. In a test run, the time that the test run started.
run.previewTrue or falseTrue for a run of the draft from a preview of the workspace, and for a test run.
workflow.idTextThe ID of the workflow.
workflow.nameTextThe name of the workflow.
current.idTextThe ID of the node that reads the variable.
current.startedAtTextThe time that the node started. If the node starts again, the time of the last start.
current.visitNumberThe number of the visit to the node, from 1. On a loop, each visit adds 1.

A time is ISO 8601 in UTC, such as 2026-10-12T21:30:00.000Z. The date filter changes the format and the timezone.

Picked sets run.startedAt and run.preview one time, when it records the run. All the nodes of the run read the same values.

Picked gets the current values when the node starts, and records the result of the node:

  • When a run continues after a stop, Picked uses the recorded results of the nodes that ran. It does not run these nodes again.
  • If a node stops before Picked records its result, Picked starts the node again. The node gets a new current.startedAt.
  • Picked does not start a failed node again. The run continues on the error exit of the node, or stops at the node. Refer to the Workflow runs reference.
  • When the retry argument of an External API node is on, the node can send its request more than one time. Each request uses the values that the node got when it started.

When you save a workflow, Picked refuses a path below run, workflow or current that is not in this table. It also refuses run, workflow or current without a path below it. The error shows the path.

Loops

A run can visit a node more than one time, on a loop. The path nodes.<node-id> gives the output of the last visit to that node that has a result. This is a visit that succeeded, or a visit that failed with an error.

A node can read a node that comes after it on the loop. On the first visit, that node did not run, so the path has no value. In a condition, the value is null. In the editor, Insert reference shows these nodes with (from the previous pass).

Templates in a condition

A text value in a rule can have a template. Picked fills the template before it checks the rule.

ValueResult
Only one {{ … }}, such as "{{ nodes.n2.count }}"The value with its type. A number stays a number.
Text with a {{ … }} in it, such as "id-{{ run.id }}"Text.
Only one {{ … }}, with no valuenull.

A value that is only one {{ … }} must give text, a number, true, false or null. If it gives a list or an object, the condition stops with the code condition_failed. Text with a {{ … }} in it always gives text, also when the {{ … }} gives a list.

Picked fills all the templates of a rule before it checks the rule. This includes a template in a part of if, and or or that the rule does not use. A template that gives a list or an object stops the condition, also when the rule does not use that part.

A template in the rule of map, filter, reduce, all, some or none reads the data of the run. Picked fills it one time, before it checks the rule. It does not read the item.

In a rule, only {{ starts a template. A text value with only {% … %} in it stays as you write it. In a field of a tool node, {% … %} also starts a template.

These values cannot have a template. Picked refuses the workflow when you save it:

  • The path of var.
  • The pattern and the flags of regexp_matches.
  • The message of throw.

When you save a workflow, Picked checks each path in a template of a rule. It checks them as it checks a template in a tool node.

The sha256 filter

The sha256 filter changes a value to its SHA-256 hash. The hash has 64 characters. Each character is a digit or a lowercase letter from a to f. You can use the filter in a tool node and in a rule.

ValueResult
TextThe hash of the text in UTF-8. Picked does not remove spaces in the text.
A number, true or falseThe hash of the value as text. The number 42 gives the hash of "42".
No value, null or empty textEmpty text.
A list or an objectThe template stops.

The filter does not take an argument. A template that gives an argument to the filter stops.

When a template stops, its node stops:

  • A tool node stops with a message that ends in a template could not be rendered. The node does not use its error exit.
  • A condition stops with the code condition_failed.

Picked does not have the hmac_sha256 filter. When you save a workflow, Picked refuses a template that uses it.

A hash as a label key

The namespace and the key of a label row can have a template. A hash fits the format of a label key. A namespace or a key has 1 to 64 characters, and a hash has 64 characters. A key that has a hash cannot have other text. Put other text in the namespace, for example cms-lock-email.

When you save a workflow, Picked does not check the format of a namespace or a key that has a template. Picked checks the result when the node runs. If the result is not a correct namespace or key, the node stops. The node does not use its error exit.

An empty key is not correct. Put the default filter before sha256 when the template can give no value:

{{ trigger.action.responses.email | default: run.id | sha256 }}

Example: a rule for a time of day

This rule is true on days 1 to 5 of the week, from 08:00 to 16:59, in the timezone Australia/Sydney:

{
  "and": [
    { "<=": ["{{ current.startedAt | date: '%u', 'Australia/Sydney' | plus: 0 }}", 5] },
    { ">=": ["{{ current.startedAt | date: '%H', 'Australia/Sydney' | plus: 0 }}", 8] },
    { "<": ["{{ current.startedAt | date: '%H', 'Australia/Sydney' | plus: 0 }}", 17] }
  ]
}
  • %u gives the ISO day of the week, from 1 to 7.
  • %H gives the hour, from 00 to 23.
  • plus: 0 changes the text to a number.

The offset of Australia/Sydney from UTC changes two times each year. The date filter follows the offset that applies on the date of the time.

Node started at, in UTCTime in Australia/SydneyBranch
2026-10-12T21:30:00ZDay 2, 08:30, offset +11:00true
2026-06-12T21:30:00ZDay 6, 07:30, offset +10:00false