Skip to content
Verified

Workflow

The shared step language embedded in every program and every element, an ordered array of actions.

A workflow is not a program type of its own, it is the logic primitive embedded inside every other one. Component events, field changes, button clicks, a program's on_load, all of them carry the same thing: an ordered array of steps, each naming one action to run. Learn this shape once and it is the same shape everywhere in Xuda.

Where workflows appear

progEvents[*].workflow on any program, a field's own workflow array (change and input handlers), an element's xu-on:<event> attribute, and nested inside actions like call_library or invoke_action.

Step shape

Action catalog

Every action data.action can name, with the legacy actions it now rejects marked deprecated:

Deprecated actions are hard errors

A deprecated row above (alter_ui_element, create_ui_element, info_ui_element, remove_ui_element, empty_ui_element, cache_ui_element, load_ui_element) fails the checker today. Drive UI changes through fields plus xu-exp / xu-render instead of imperative element manipulation.

Parameter value holders

Every entry under data.name.parameters is one of two shapes: { "value": <literal> } for a static value, or { "fx": "@expression" } for an expression. outputField (on set_data and batch) names a field on the caller that receives the result.

Worked example

One action per step

Each array entry is one action; order is execution order.

Gate a step

props.condition, an expression, false skips the step silently, no error raised.

Fire and forget

props.async: true on a step like call_external_api lets later steps run without waiting on it, the right call for background work, the wrong one when a later step needs its result.

xml
<actions lang="json5">
{
  signIn: [
    { action: "update", name: { value: "@is_logged_in_v: true" } },
    { action: "update", name: { value: "@active_view_v: 'overview'" } }
  ]
}
</actions>

<template>
  <button type="button" @click="signIn">Enter dashboard</button>
</template>

.xu groups steps into a named block under <actions> and wires it to an element with @click="<name>", the shorthand for an xu-on:click handler whose workflow is that block.

json
[
  { "id": "1", "data": { "action": "get_data", "name": { "prog": "97a_gtd_…", "parameters": { "doc_in": { "value": "345" } } }, "enabled": true }, "props": {} },
  {
    "id": "2", "data": { "action": "alert", "name": { "alertDisplay": "modal", "alertType": "error", "alertTitle": "File not found", "alertBody": "the file \"document\" not found", "createLog": true }, "enabled": true },
    "props": { "condition": "@user_id===\"222\"" }
  },
  { "id": "3", "data": { "action": "call_external_api", "name": { "url": "https://stocks.example.com", "method": "GET" }, "enabled": true }, "props": { "async": true } }
]