fix(automation): accept config.fieldValues as an alias for create/update_record fields#2419
fix(automation): accept config.fieldValues as an alias for create/update_record fields#2419os-zhuang wants to merge 1 commit into
Conversation
…pdate_record `fields` The create_record / update_record node executors read the write map from `config.fields`, but the AI build agent (and some legacy flows) author it under `config.fieldValues`. When the keys mismatch the executor interpolates an empty map and inserts/updates a blank record — required-field validation then fails and the automation silently does nothing. Alias `cfg.fields ?? cfg.fieldValues`, mirroring the existing `cfg.filter ?? cfg.filters` / `cfg.objectName ?? cfg.object` tolerance, so both authoring conventions write real data (`fields` wins when both are present). Tests: crud-output-var proves the alias through the real AutomationEngine (create + update, with interpolation); record-change-integration proves the full "status→lost auto-creates a linked follow-up" scenario end-to-end through the real kernel + record-change trigger + data engine, for both `fields` and `fieldValues`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📓 Docs Drift CheckThis PR changes 2 package(s): 5 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
|
Closing per design review: the right fix is to correct the metadata at the source (cloud#688 skill + lint) and keep a single strict |
Refreshes the bundled Console to objectui main including #2419, which propagates the action-param `visible` predicate through resolveActionParams. Completes the create-user phone fix end to end: the console now honors the served `visible: 'features.phoneNumber == true'` predicate on the create_user phoneNumber param, hiding the field when the phoneNumber auth plugin is off instead of offering a field the default backend rejects. objectui range: 9138e68413f3...2fb38edbeb12 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Problem
The
create_record/update_recordautomation node executors read their write map fromconfig.fields(packages/services/service-automation/src/builtin/crud-nodes.ts). But the AI build agent — and some hand-authored/legacy flows — emit the write map underconfig.fieldValues. When the keys mismatch,interpolate(cfg.fields ?? {}, …)resolves to an empty map, so the node inserts/updates a blank record; required-field validation then fails and the automation silently does nothing.This is the framework half of "AI-built record-change flows don't write end-to-end". The runtime/trigger half (flows never fired) was fixed in cloud#686; the authoring-convention half is fixed in the paired cloud PR (the skill now emits
fields). This PR makes the executor defensively tolerant so flows already stored underfieldValueskeep working without re-authoring.Change
Alias the write-map key, mirroring the executor's existing
cfg.filter ?? cfg.filtersandcfg.objectName ?? cfg.objecttolerance right alongside:fieldswins when both are present. Applied to bothcreate_recordandupdate_record.Tests
crud-output-var.test.ts— proves the alias through the realAutomationEngine(create + update, with{var.id}interpolation), plus afields-wins-over-fieldValuesprecedence case.record-change-integration.test.ts— boots a real kernel (ObjectQL + automation + record-change trigger + data engine) and drives the documented scenario "customer status → lost auto-creates a linked follow-up" end to end: a livedata.updatefires therecord-after-updatehook, the flow'screate_recordwrites a follow-up that is correctly linked ({record.id}→ the triggering row's id) and populated ({TODAY()}→ today's date). Asserted for both the canonicalfieldskey and the legacyfieldValuesalias.Full
service-automation(224) andtrigger-record-change(22) suites green.🤖 Generated with Claude Code