修 #4439 时顺手扫到的,不是那次改动造成的,单独开。 `packages/services/service-automation/README.md` 的「Step 类型」几节整体描述的是一套**从来没有存在过**的 DSL。逐项对照现行 schema: | README 写的 | 现行真值 | |:---|:---| | `type: 'record_create'` / `'record_update'` / `'record_delete'` | `create_record` / `update_record` / `delete_record` | | `type: 'query'` | `get_record` | | `object: 'account'` | `objectName`(`object` 别名已在 protocol 17 由 `flow-node-crud-object-alias` 转换层收口) | | `recordId: '{!trigger.recordId}'` | 没有 `recordId` 这个键;按 id 取记录是 `filter: { id: '{recordId}' }` | | `filters: [{ field, operator, value }]` | `filter`(对象形式,`filters` 已由 `flow-node-crud-filter-alias` 收口) | | `output: 'opportunities'` | `outputVariable` | | `{!trigger.record.amount}` | 单花括号 `{record.amount}`;`{!…}` 是 Salesforce 方言,平台从不解析 | | `type: 'decision'` 顶层带 `conditions` | `conditions` 在 `config` 里 | | `conditions[].steps` / `defaultSteps` | 不存在。分支是 DAG 的边(`edge.condition` + `isDefault`),不是嵌套 steps | 也就是说,照着这个 README 写出来的 flow **没有一个节点能跑**。 ## 为什么现在值得修 原来这只是「文档没用」。#4414 + #4439 之后,其中 decision 那一块的写法(`expression: '{!trigger.record.amount} > 10000'`)会**直接构建失败** —— 因为 `conditions[].expression` 进了表达式账本,花括号谓词在 `registerFlow` / `objectstack validate` 就被拒。作者照 README 抄,拿到的是一条 CEL 报错,而报错说的("去掉花括号")对这个例子来说甚至不是完整的修法,因为它整个节点形状都是错的。 #4439 里我只改了 `content/docs/automation/flows.mdx` 和 `FlowNodeSchema` 的 `@example`(那两处是真会被作者读到的入口)。这个 README 没动 —— 单修其中一块,会让它和周围同样错的例子更不一致,而且这属于整篇重写,不该塞进那个 PR。 ## 建议 按现行 schema 重写这几节,或者干脆删掉 Step 类型那一段、指向 `content/docs/automation/flows.mdx`(那是维护中的真文档)。倾向后者 —— 一份包内 README 再维护一套节点参考,本身就是 #4027/#3569 那类「两份手写清单不对账」的形状。 顺带值得查一下别的 package README 有没有同样的陈旧片段;我只扫了 `expression: '{`,没做全面对照。 相关: #4414、#4439。
Activity
docs(service-automation): rewrite the README against the real flow DSL (
docs(service-automation): note that parallel/try_catch are built-in t…
docs(service-automation): fix run-on sentence in the expressions sect…
fix(docs,test): 文档失真修正与 ReDoS 断言去负载敏感 (objectstack-ai#4485, objectsta…