Skip to content

LatticeFlow v2 Node Reference ​

Every node in LatticeFlow v2 is registered and validated by validateNodeDefinition in plugins/nocobase/plugin-dxos-studio/src/server/flow/registry.js. The 24 node types span 6 categories (trigger, control, data, logic, ai, integration) and share a common graph envelope: id, type, label, position, config, continueOnFail, and optional timeoutMs.

GET/api/dxosAutomations:nodeRegistry
Bearer JWT | ldx_pat_*read
Returns nodeTypes containing all 24 registered node schemas with inputSchema and defaultConfig.
POST/api/dxosAutomations:testNode
Bearer JWT | ldx_pat_*read | write
Executes a single node in isolation with pinnedInputs inside an RLS savepoint (dryRun=true by default).

All 24 Node Types Index ​

#Node Type KeyCategoryInputsOutputsSummary
1trigger.eventtrigger[]mainStarts on matching CloudEvents from the Event Bus
2trigger.recordtrigger[]mainStarts on ORM create, update, or delete hooks
3trigger.scheduletrigger[]mainStarts on a 5-field cron schedule and IANA timezone
4trigger.webhooktrigger[]mainStarts on inbound HTTP POST with HMAC or Bearer auth
5trigger.manualtrigger[]mainStarts from Control Studio or dxosAutomations:runNow
6control.ifcontrolintrue, false, errorBinary branch evaluated by structured filter rules
7control.switchcontrolincase_0, case_1, case_2, default, errorMulti-way branch routed by ordered cases
8control.parallelcontrolinmain, errorFans out execution across all connected outgoing edges
9control.mergecontrolinmain, errorJoins parallel branches via wait_all or first_completed
10control.loopcontrolinitem, done, errorBounded iteration (max 100 items) with durable cursor state
11control.delaycontrolinmain, errorSuspends execution for durationSec or until untilIso
12control.approvalcontrolinapproved, rejected, errorEnqueues an HITL approval and pauses until decided
13control.subflowcontrolinmain, errorInvokes another rule in the same org (max depth 8)
14data.querydatainmain, errorQueries tenant-scoped records from allowlisted collections
15data.createdatainmain, errorInserts a record with forced organizationId and depth tracking
16data.updatedatainmain, errorUpdates records matching recordId or non-empty filter
17logic.dmnlogicinmain, errorEvaluates a tenant DMN table and populates context.dmn
18logic.transformlogicinmain, errorRuns 9 declarative data operations without eval()
19ai.llmaiinmain, errorCalls OpenAI-compatible llmServices with PII redaction
20ai.agentaiinmain, errorRuns single-turn triage proposals or multi-turn ReAct agents
21integration.httpintegrationinmain, errorCalls origin-locked Vault connectors with SSRF and HMAC guards
22iot.twin_commandintegrationinmain, errorDispatches desiredPatch to Digital Twin or HITL queue
23notify.sendintegrationinmain, errorSends role-targeted notifications across 5 delivery channels
24event.emitintegrationinmain, errorPublishes a CloudEvent to the Event Bus with incremented depth

trigger Category (5 Nodes) ​

All trigger nodes (nodes/triggers.js) declare inputs: [] and outputs: ['main'], and normalize their output payload to the same envelope:

json
{
  "type": "lot.held_mkt",
  "data": { "lotCode": "LOT-VAX-01", "mktCelsius": 10.4 },
  "record": null,
  "timestamp": "2026-11-26T08:30:00.000Z",
  "webhook": null,
  "schedule": null
}

1. trigger.event ​

Starts a workflow when a CloudEvent published on the Lattice Event Bus matches eventType (supports * wildcards and comma-separated patterns) and passes filterJson.

trigger.event Config
ParameterTypeDefaultDescription
eventTyperequired
string*CloudEvent type pattern to match (for example lot.held_mkt or entity.*).
filterJson
jsonnullOptional structured filter evaluated against event data before creating a run.

2. trigger.record ​

Starts from ORM lifecycle hooks (registerRecordTriggerHooks) when records are created, updated, or deleted in an allowlisted business collection or latticeCustom* table. output.record holds the sanitized ORM record.

trigger.record Config
ParameterTypeDefaultDescription
collectionrequired
string""Allowlisted business collection or custom latticeCustom* table name.
operationrequired
stringcreateORM event operation: create, update, or delete.
filterJson
jsonnullOptional structured filter applied to the mutated record.

3. trigger.schedule ​

Starts periodically from a 5-field cron expression (minute hour dom month dow, normalizing Sunday 7 to 0) and IANA timezone. Dispatched by tickScheduledRules under the PostgreSQL advisory lock dxos_flow_scheduler_tick; sets output.schedule to { cron, timezone }.

trigger.schedule Config
ParameterTypeDefaultDescription
cronrequired
string0 * * * *Standard 5-field UNIX cron expression.
timezone
stringUTCIANA timezone evaluated via Intl.DateTimeFormat (for example Asia/Ho_Chi_Minh).

4. trigger.webhook ​

Starts from an external HTTP POST sent to POST /api/dxosAutomations:webhookIngress. Validates request authentication before starting the graph and populates output.webhook with { webhookPath, authMode, secretHeader }.

trigger.webhook Config
ParameterTypeDefaultDescription
webhookPathrequired
string""Logical webhook path descriptor associated with the rule.
authModerequired
stringhmacVerification mode: hmac (HMAC-SHA256 or Standard Webhooks) or bearer.
secretHeader
stringX-Lattice-Signature-256HTTP header inspected for hex HMAC signatures when authMode is hmac.

5. trigger.manual ​

Starts manually from Control Studio or via POST /api/dxosAutomations:runNow. inputSchemaJson documents the expected JSON payload schema for operators and test callers.

trigger.manual Config
ParameterTypeDefaultDescription
inputSchemaJson
json{}JSON schema describing expected manual trigger input fields.

control Category (8 Nodes) ​

Control nodes (nodes/control.js) accept input on in and handle branching, fan-out, fan-in, bounded loops, durable suspension, and nested rule calls.

6. control.if ​

Interpolates {{path}} tokens inside condition and evaluates it with matchesFilter. Outputs on ['true', 'false', 'error'] and returns { matched, condition }.

control.if Config
ParameterTypeDefaultDescription
conditionrequired
json{"field":"","op":"eq","value":""}Structured filter supporting $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, $contains, $and, $or, and $not.

7. control.switch ​

Reads expression and evaluates cases in order, routing to the first matching port (case_0, case_1, case_2, or custom case port) or default if none match (outputs: ['case_0', 'case_1', 'case_2', 'default', 'error']). Returns { matched, port, value }.

control.switch Config
ParameterTypeDefaultDescription
expressionrequired
string""Context path (data.priority) or {{path}} template to inspect.
casesrequired
json[{"port":"case_0","operator":"eq","equals":""}]Ordered array of case definitions with port, operator (or op), equals (or value), or condition.

8. control.parallel ​

Fans out execution simultaneously over main to every connected downstream branch (outputs: ['main', 'error']). Ready target nodes are dispatched via runRlsAwareBatch. Returns { fannedOut: true, input }.

control.parallel Config
ParameterTypeDefaultDescription
mode
stringfan_outFan-out execution mode (fixed to fan_out).

9. control.merge ​

Joins outputs from incoming parallel branches (outputs: ['main', 'error']) and returns { mode, merged, branches }. In wait_all mode, execution waits for all non-skipped predecessors; in first_completed mode, the first arriving branch triggers downstream execution immediately.

control.merge Config
ParameterTypeDefaultDescription
moderequired
stringwait_allBranch join strategy: wait_all or first_completed.

10. control.loop ​

Iterates over the array resolved at itemsPath, executing the subgraph attached to item with loop = { item, index, count } before routing aggregated results to done (outputs: ['item', 'done', 'error']). Bounded by MAX_LOOP_CAP = 100; final output is { items, count, totalCount, maxIterations, truncated, results }.

control.loop Config
ParameterTypeDefaultDescription
itemsPathrequired
stringdata.itemsPath to the array in execution context.
maxIterationsrequired
number100Iteration limit in range 1..100; values outside range throw FLOW_LOOP_LIMIT_EXCEEDED.
strictLimit
booleanfalseWhen true, throws FLOW_LOOP_LIMIT_EXCEEDED if array length exceeds maxIterations instead of truncating.

11. control.delay ​

Computes resumeAt from untilIso or Date.now() + durationSec * 1000 and suspends the run (status: 'suspended', outputs: ['main', 'error']). During dryRun, returns { delayed: true, simulated: true, resumeAt, durationSec } without suspending.

control.delay Config
ParameterTypeDefaultDescription
durationSec
number60Delay duration in seconds when untilIso is omitted.
untilIso
string""Target ISO-8601 wake-up timestamp (supports {{path}} templates).

12. control.approval ​

Inserts a pending approval into latticeAiApprovalQueue and suspends the run (outputs: ['approved', 'rejected', 'error']) with a SHA-256 resumeTokenHash and expiration resumeAt. Calling resumeRun as an authorized approverRole or active delegate routes execution to approved or rejected.

control.approval Config
ParameterTypeDefaultDescription
approverRolerequired
stringldx_managerRole required (directly or via active delegation) to decide the approval.
titlerequired
stringCần phê duyệtApproval item title shown in the HITL queue.
summary
string""Decision summary shown to reviewers (supports {{path}}).
riskLevel
stringmediumRisk classification: low, medium, high, or critical.
ttlHours
number24Expiration window in hours (clamped 1..720).

13. control.subflow ​

Invokes another published rule (ruleKey) within the same organizationId via helpers.executeSubflow (outputs: ['main', 'error']). Blocks direct self-recursion (FLOW_SELF_RECURSIVE_SUBFLOW) and returns { ruleKey, depth, result }.

control.subflow Config
ParameterTypeDefaultDescription
ruleKeyrequired
string""Target workflow ruleKey within the same organization.
payloadMapping
json{}Object mapped and template-interpolated as data for the child flow.
maxDepth
number8Per-node recursion depth limit (1..8, bounded by MAX_SUBFLOW_DEPTH).

data Category (3 Nodes) ​

Data nodes (nodes/data.js) operate exclusively on ALLOWLISTED_BUSINESS_COLLECTIONS (latticeRequests, latticeOrders, latticeOrderLines, latticeServiceTickets, latticeParaDocuments, latticeIncidentCases, latticeLocations, latticeAssets, latticeAgentProposals) and custom collections matching ^latticeCustom[A-Z][A-Za-z0-9]{1,40}$. Every query or mutation injects organizationId and blocks FORBIDDEN_SYSTEM_COLLECTIONS.

On core voucher tables (latticeRequests, latticeOrders, latticeServiceTickets), sanitizeWriteValues strips id, organizationId, status, version, amendedFromId, amendmentNo, submittedAt, submittedBy, cancelledAt, cancelledBy, and cancelReason.

14. data.query ​

Queries tenant-scoped records (outputs: ['main', 'error']) using sanitizeDirectFilter and assertSafeDirectSort, returning { collection, count, items }.

data.query Config
ParameterTypeDefaultDescription
collectionrequired
stringlatticeRequestsAllowlisted business or latticeCustom* collection name.
filter
json{}Filter object merged with mandatory organizationId scope.
limit
number20Maximum records returned (1..200).
sort
json[]Validated sort field array (for example ["-createdAt"]).

15. data.create ​

Creates a tenant-scoped record inside runWithOrmDepth (incrementing ORM hook depth) and returns { collection, id, record }.

data.create Config
ParameterTypeDefaultDescription
collectionrequired
string""Allowlisted target collection name.
valuesrequired
json{}Record field values after {{path}} interpolation and protected-field stripping.

16. data.update ​

Queries matching records within organizationId using filter or recordId and applies sanitized updates up to limit (outputs: ['main', 'error']). Rejects empty filters (DATA_UPDATE_FILTER_REQUIRED) to prevent accidental full-table updates; returns { collection, matchedCount, updatedCount }.

data.update Config
ParameterTypeDefaultDescription
collectionrequired
string""Allowlisted target collection name.
recordId
string""Target record ID used when filter is omitted.
filter
json{}Non-empty filter expression (takes precedence over recordId).
valuesrequired
json{}Updated field values after protected-field stripping.
limit
number20Maximum matched records updated per call (1..200).

logic Category (2 Nodes) ​

17. logic.dmn ​

Evaluates an active decision table (tableKey) in latticeDecisionTables for the current tenant via evaluateDecisionTable (outputs: ['main', 'error']). Writes outputs to both context.dmn (accessible downstream as {{dmn.<field>}}) and context.dmnResult, and returns { tableKey, matched, hitPolicy, outputs, matchedRules }.

logic.dmn Config
ParameterTypeDefaultDescription
tableKeyrequired
string""Key of an active DMN table belonging to the current organization.
facts
json{}Additional fact overrides merged with event.data and upstream input.

18. logic.transform ​

Executes an ordered array of declarative operations without eval() or new Function() (outputs: ['main', 'error']). Each step reads from both the in-progress result object and the enclosing evalCtx.

logic.transform Config
ParameterTypeDefaultDescription
operationsrequired
json[]Ordered array of transform operations keyed by op.
baseFromInput
booleantrueInitializes result as a sanitized copy of input when true, or {} when false.

All 9 supported op primitives in logic.transform:

opKey FieldsBehavior
settarget, source or valueAssigns a value from source path or interpolated value into target.
templatetarget, expr / template / valueInterpolates a {{path}} string and writes it to target.
coerceNumbertarget, source / value, precision?, fallback?Parses a finite number with optional rounding (0..12), falling back on invalid input.
coerceBooleantarget, source / valueMaps 'false', '0', 'no', 'off', and '' to false; otherwise Boolean(raw).
mathtarget, operator (add, sub, mul, div), left/right or operands or expr, precision?Evaluates binary arithmetic safely and rejects division by zero (TRANSFORM_DIVIDE_BY_ZERO).
concattarget, parts / sources, separator?Joins resolved paths or templates using separator.
renamefrom / source, to / targetMoves a value from the source path to the target path and deletes the old key.
pickkeys / fields, target?Retains only listed keys (into target or replacing result).
omitkeys / fieldsDeletes listed keys from result.

ai Category (2 Nodes) ​

19. ai.llm ​

Calls the active OpenAI-compatible provider configured in llmServices via callConfiguredLlm (outputs: ['main', 'error']), applying PII redaction and assertSafeLlmUrl SSRF checks. If no LLM provider is configured and fallbackOutput is present, it returns mode: 'offline-fallback' on main.

ai.llm Config
ParameterTypeDefaultDescription
systemPrompt
string""System instruction prepended to the message array.
userPromptrequired
string""User prompt sent to the model (supports {{path}} interpolation).
responseFormat
stringjsonExpected output format: json or text.
temperature
number0.2Sampling temperature passed to the provider.
maxTokens
number1600Maximum completion tokens.
model
string""Optional model override; defaults to the active llmServices model.
fallbackOutput
jsonnullStatic or templated fallback returned in dryRun or unconfigured environments.

Successful calls return { mode, model, content, parsedJson, data, usage, piiRedactedCount }.

20. ai.agent ​

Supports two execution modes (outputs: ['main', 'error']) scoped to an allowlisted targetCollection:

  • single mode (default): Performs a single-turn structured triage call (with offline_fallback when unconfigured) and writes a proposed record to latticeAgentProposals (or latticeAiApprovalQueue).
  • react mode (mode: 'react', enableReact: true, or non-empty tools): Runs executeReactAgent up to maxTurns (1..12), emits OpenTelemetry GenAI spans (chat, execute_tool, invoke_agent), validates outputSchema with up to 1 self-repair turn, and suspends for HITL approval (suspend: { kind: 'approval' }) whenever the agent invokes a mutating tool (isMutatingTool).
ai.agent Config
ParameterTypeDefaultDescription
mode
stringsingleReasoning mode: single or react.
enableReact
booleanfalseEnables the ReAct loop when mode is not explicitly set to react.
maxTurns
number5Maximum ReAct turns in range 1..12.
tools
json[]Allowlisted tool names exposed to the ReAct agent.
outputSchema
jsonnullJSON Schema enforced on the final ReAct response.
memoryScope
stringorgLong-term memory scope: org, agent, user, or none.
enableMemory
booleanfalseAutomatically recalls matching latticeAiMemory items before reasoning.
systemPrompt
string""Custom system instruction for the agent.
targetCollectionrequired
stringlatticeAssetsAllowlisted business collection linked to proposals or triage items.
targetRecordId
string0Target record ID.
severity
stringmediumDefault triage severity: low, medium, high, or critical.
recommendation
string""Default recommendation text when LLM fallback applies.
prompt
string""Analysis instruction for the agent.
evidence
jsonnullStructured evidence payload attached to the proposal.
aiEmployee
stringops_triageAgent persona identifier.
toolName
stringtriage_flow_eventTool label recorded in HITL approval queue items.
model
string""Optional model override (for example ag/gemini-3.8-flash).
temperature
number0.2Sampling temperature.
maxTokens
number1000Maximum completion tokens per turn.

integration Category (4 Nodes) ​

21. integration.http ​

Dispatches HTTP requests through a Connector Vault entry (connectorKey, outputs: ['main', 'error']). Locks the target origin to connector.baseUrl (buildConnectorUrl), enforces synchronous and async DNS SSRF checks, injects Vault auth headers, signs X-Lattice-Signature-256 and Standard Webhooks (webhook-signature) when authType === 'hmac', disables HTTP redirects (redirect: 'error'), and scrubs secrets from { connectorKey, authType, method, url, status, ok, response }.

integration.http Config
ParameterTypeDefaultDescription
connectorKeyrequired
string""Connector key stored in latticeConnectors.
methodrequired
stringPOSTHTTP method: GET, POST, PUT, PATCH, or DELETE.
path
string""Relative path appended to connector baseUrl (origin changes rejected).
headers
json{}Additional headers; Authorization, Host, and signature headers are stripped.
body
jsonnullJSON request body for POST, PUT, and PATCH methods.
timeoutMs
number5000Request timeout in milliseconds (clamped 100..60000).

22. iot.twin_command ​

Calls digitalTwinMod.requestDesiredSetpoint to update desired state (desiredPatch) on assetEntityId (outputs: ['main', 'error']). Setpoint changes exceeding the Digital Twin HITL delta threshold route into the approval queue before publishing downlinks to Node-RED / Mosquitto.

iot.twin_command Config
ParameterTypeDefaultDescription
assetId
string""Optional latticeAssets record ID.
assetEntityIdrequired
string""NGSI-LD / Digital Twin entity ID (for example urn:ngsi-ld:ColdRoom:HCM-01).
desiredPatchrequired
json{}Desired twin property patch object.
downlinkUrl
string""Optional downlink override URL (validated against static SSRF rules).

23. notify.send ​

Delivers tenant-scoped notifications to roleNames via notificationCenter.dispatchRoleNotifications (outputs: ['main', 'error']), returning { roleNames, notifyChannels, templateKey?, dispatched, title }.

notify.send Config
ParameterTypeDefaultDescription
roleNamesrequired
json["ldx_operator"]Target role names receiving the notification.
titlerequired
string""Notification title after {{path}} interpolation.
body
string""Notification message body.
severity
stringwarningSeverity level: info, warning, high, or critical.
category
stringsystemCategory: system, mention, voucher, sla, alarm, or approval.
targetCollection
string""Linked business collection name.
targetRecordId
string""Linked record ID.
targetPath
string""Portal route opened when clicking the notification.
notifyChannels
json["in_app"]Delivery channels: in_app, email_smtp, telegram, slack, webhook.
templateKey
string""Optional notification template key (max 120 chars).
channelConfig
json{}Per-channel metadata such as connectorKey.

24. event.emit ​

Publishes a tenant-scoped CloudEvent onto the Lattice Event Bus (outputs: ['main', 'error']) and returns { published: true, eventType, subject, depth }. Automatically increments depth by 1 and throws RECURSION_DEPTH_LIMIT_EXCEEDED if depth > MAX_HARD_DEPTH (8).

event.emit Config
ParameterTypeDefaultDescription
eventTyperequired
string""CloudEvent type string to publish.
subject
string""Optional business subject identifier.
data
json{}Event data payload after {{path}} interpolation and prototype sanitization.
json
{
  "nodes": [
    {
      "id": "tx_1",
      "type": "logic.transform",
      "config": {
        "baseFromInput": false,
        "operations": [
          { "op": "set", "target": "lotCode", "source": "data.lotCode" },
          { "op": "math", "target": "overThresholdC", "operator": "sub", "left": "data.mktCelsius", "right": "data.thresholdCelsius", "precision": 2 },
          { "op": "template", "target": "summary", "expr": "Lot {{result.lotCode}} exceeded by {{result.overThresholdC}}C" }
        ]
      }
    },
    {
      "id": "http_1",
      "type": "integration.http",
      "config": {
        "connectorKey": "n8n-coldchain-orchestrator",
        "method": "POST",
        "path": "/webhook/mkt-alert",
        "body": { "lotCode": "{{steps.tx_1.lotCode}}", "summary": "{{steps.tx_1.summary}}" },
        "timeoutMs": 5000
      }
    }
  ]
}

Apache-2.0 · LatticeDX v0.4.2 · Powered by NocoBase · v2.2.50 · Apache-2.0 (Clause 5.2)