Skip to content

fix(flows): make record_change/schedule flows actually fire (engine contract)#17

Merged
xuyushun441-sys merged 2 commits into
mainfrom
fix/record-change-flow-contracts
Jun 3, 2026
Merged

fix(flows): make record_change/schedule flows actually fire (engine contract)#17
xuyushun441-sys merged 2 commits into
mainfrom
fix/record-change-flow-contracts

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

Problem

Every template flow was authored against a start-node + CRUD-node shape the automation engine does not recognize, so record_change flows registered at startup but never fired on data writes (and the CRUD nodes silently no-op'd). Root cause traced + fixed upstream in the objectstack-automation skill (framework PR #1565); this PR fixes the templates to match the real engine contract.

Verified end-to-end on a running 7.7 stack: a corrected flow (helpdesk escalate_angry_customer) fires on update and applies its update_record (ticket → escalated); both RecordChangeTriggerPlugin and ScheduleTriggerPlugin load once the capability is enabled.

Changes (30 flows + 9 package configs)

  • Enable the triggers capability (+ job for project's scheduled flows) in every package's requires. Without it the trigger plugins never load → flows can't bind.
  • Start-node binding: criteria + criteriaDialect / triggerOntriggerType: 'record-after-{create|update}' + condition (bare CEL). Legacy Salesforce-flavor predicates (!= NULL, AND, TODAY(), ISNEW(), ISCHANGED(x), PRIOR(), IN (...)) translated to valid CEL (the 7.6+ ADR-0032 validator rejects them).
  • update_record / create_record: data key valuesfields; record selection recordId/recordIdsfilter (the executor reads fields + filter).
  • Triggering-record id placeholders ({ticketId}, {pieceId}, {reportId}, …) → {record.id}.

Verification

  • 9/9 packages build green, full tsc clean, 0 residual criteriaDialect/triggerOn/recordId/values: in flows.
  • Trigger plugins load; helpdesk escalate flow verified firing end-to-end.

Notes / follow-ups

  • A few flows are inherently time-based (overdue/expiring/SLA) yet authored as record_change; they now bind as record-after-update (fire on the next write). Converting them to scheduled flows is a possible future refinement.
  • Project's 2 scheduled flows had their CRUD keys corrected; the schedule firing path itself (cron) wasn't runtime-verified here.
  • Unused flow input variables (e.g. {reportId}) were left declared (harmless) to keep the diff minimal.

🤖 Generated with Claude Code

os-zhuang and others added 2 commits June 3, 2026 17:53
…ontract)

Every template flow used a start-node + CRUD-node shape the automation engine
does not recognize, so record-change flows registered but never fired. Aligned
all 30 flows + 9 package configs with the real engine contract (verified
end-to-end on a running 7.7 stack — a corrected flow now fires and applies its
update_record):

- Enable the `triggers` capability (+ `job` for project's scheduled flows) in
  every package's `requires` — without it RecordChangeTriggerPlugin/
  ScheduleTriggerPlugin never load and flows can't bind.
- Start-node binding: `criteria` + `criteriaDialect` / `triggerOn` →
  `triggerType: 'record-after-{create|update}'` + `condition` (bare CEL). Legacy
  Salesforce-flavor predicates (`!= NULL`, `AND`, `TODAY()`, `ISNEW()`,
  `ISCHANGED(x)`, `PRIOR()`, `IN (...)`) translated to valid CEL (the 7.6+
  validator rejects them).
- update_record / create_record: data key `values` → `fields`; record selection
  `recordId`/`recordIds` → `filter` (the executor reads `fields` + `filter`).
- Triggering-record id placeholders (`{ticketId}`, `{pieceId}`, `{reportId}`, …)
  → `{record.id}`.

9/9 packages build green, typecheck clean; both trigger plugins load; the
helpdesk escalate flow verified firing (ticket → escalated).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@xuyushun441-sys xuyushun441-sys merged commit 1e4ca42 into main Jun 3, 2026
1 of 3 checks passed
@xuyushun441-sys xuyushun441-sys deleted the fix/record-change-flow-contracts branch June 3, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants