Skip to content

Data Flow

Workflow data moves through ports and context variables. The graph decides where execution goes; set, in, and recipes decide what data each element sees.

Store element output with set.

{
"name": "loadProject",
"type": "source/entities",
"options": {
"module": "projects",
"first": true
},
"set": {
"project": "default:"
}
}

After this element runs, later recipes can read $project.

Common bindings:

BindingMeaning
default:Data emitted from the default output port.
input:Request or event input payload.
confirm:Data confirmed by an action/modal.
error:Error output where an element supports it.
event:Event stream payload from elements that emit progress or service events.
selector:Special event data such as the field selector in on_change flows.

Use in to pass a context value to a specific input port.

{
"name": "saveProject",
"type": "action/save",
"in": {
"default": "$project"
}
}

Without in, many elements receive the data that arrived at their connected input port. Use explicit in bindings when a workflow has multiple resources in context and the target element must operate on one of them.

Recipes calculate values from the current context.

{
"name": "prepareSummary",
"type": "op/recipe",
"options": {
"recipe": "{\"title\": $project.name, \"task_count\": count($tasks)}"
},
"set": {
"summary": "default:"
}
}

Use recipes for compact transformations. If the expression becomes difficult to read, split it into several named op/recipe or op/set elements.

Read more in the Recipes reference.

op/set changes the workflow data object. It is commonly used after source/new or after loading an existing resource.

{
"name": "setTaskFields",
"type": "op/set",
"options": {
"copy": "$taskData",
"recipes": {
"project": "$project",
"status": "\"open\"",
"assigned_to": "user()"
}
}
}

Use copy when user input should become the base object. Use recipes for fields that must be calculated or controlled by the workflow.

Use flow/each when every resource in an array needs the same operation.

{
"name": "forEachTask",
"type": "flow/each",
"to": {
"each": {
"setTaskStatus": ["default"]
},
"next": {
"afterTasks": ["default"]
}
}
}

The each output emits one item; index exposes its key. next runs once after iteration, including an empty input, and forwards the original input. There is no empty output.

Keep loop bodies small. If each item needs a complex process, move that process into a separate workflow and call it with action/run.

Field events can provide a selector that points to the changed part of the form. Store it and use it when setting values back on the client.

Capture the selector on the event itself with "set":{"fieldSelector":"selector:"}. It points to the changed field (for example $.items[1].qty). Construct the parent row path explicitly before targeting a sibling; appending .description to that selector would address a child of qty. See action/set selectors.

  • Store important intermediate values with clear names.
  • Use explicit in bindings when more than one resource is in context.
  • Keep recipes short and named by intent.
  • Handle empty arrays before looping.
  • Do not pass private service responses to the client unless the workflow intentionally sanitizes them.