Skip to content

Commit f2cd1d9

Browse files
committed
docs(skills,automation): a connector_action input is judged against the action's inputSchema before dispatch
After #27995 (PR #28035) the evaluated connectorConfig.input is checked against the action's declared inputSchema (required, type with OpenAPI nullable, properties, items) and a breach fails the step as VALIDATION_ERROR, fault-routable, with nothing sent. The automation skill's connector_action row and the integration recipes still taught the input as sent unchecked, and the connectors docs page had no failure-modes row for the refusal. - SKILL.md: the connector_action row says what is judged, the code, that a fault edge routes it and that nothing is sent; os validate still does not judge the input (#27968). - integration-recipes.md: the same, plus null-on-optional reads as absent and the int() cast for a string-held id. - connectors.mdx: a failure-modes row with the code and the remedy. The new text is paid for by same-file deletion of restatement, so both skill files stay within their token ceilings without a ratchet change. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwp1Wc6nB6ePmS4ePn
1 parent 27e0bd5 commit f2cd1d9

3 files changed

Lines changed: 27 additions & 23 deletions

File tree

‎content/docs/automation/connectors.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ retry):
456456
| MCP server unreachable / `tools/list` fails; remote spec URL unreachable or transiently failing (408/429/5xx) | **Not fatal**: the instance registers **degraded** (visible on `GET /api/v1/automation/connectors` with the reason), dispatches fail with that reason, and the platform retries on a 5s→5min backoff — recovery is automatic |
457457
| A retry of a degraded instance reaches the upstream and meets a configuration fault (an `include` naming a tool or operation the upstream does not offer) | **Not fatal**: the instance stays **degraded**, now with the configuration reason, and is **not retried** — dispatches fail saying to edit its declaration; an edit of the entry (or a restart) re-attempts it |
458458
| Wrong spec URL (other 4xx) or unparseable document | Configuration fault — **hard boot error** |
459+
| A `connector_action` input that, once evaluated, breaks the action's `inputSchema` (a missing `required` parameter, a wrong `type`) | **The step fails before dispatch** with `VALIDATION_ERROR`, naming each parameter path, and nothing is sent; a `fault` edge or `try_catch` can route it. Supply the parameter or send the declared type: text is never converted, so cast it in a CEL envelope (`int()`, `double()`, `bool()`). `GET /api/v1/automation/connectors` lists the schema; `os validate` does not judge the input yet |
459460
| A bad entry arrives via **runtime reload** (a Studio publish, a direct active save through `PUT /api/v1/meta/connector/:name`, or a delete, made on any replica — peers reconcile on [cluster lane 2](/docs/kernel/cluster#62-the-cluster-invalidation-family); or a dev reload) | Logged and **skipped**, never crashing the live server; a changed instance's old connector keeps serving until its replacement materializes |
460461

461462
## Catalog descriptors: entries without a `provider`

‎skills/objectstack-automation/SKILL.md‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ Flows are built from **built-in node types** (plugins register more, e.g.
8585
|:-----|:--------|
8686
| `http` | Call an external HTTP API — always set `timeoutMs` (unset = no timeout). `url` and `headers` are served as written with the definition to every member who can read flows — only `signingSecret` and a start node's `secret` are withheld — so never a credential there: a credential means a declared connector called via `connector_action` |
8787
| `notify` | Send a notification through the messaging service (inbox by default) |
88-
| `connector_action` | Dispatch an action of a declared connector (§ *Integrations are declared, not coded*) or a plugin's. `connectorConfig.input` is a value-slot map like `subflow` `input`; `os validate` does not judge it yet, so a malformed envelope fails at run time |
88+
| `connector_action` | Dispatch an action of a declared connector (§ *Integrations are declared, not coded*) or a plugin's. `connectorConfig.input` is a value-slot map like `subflow` `input`, judged once evaluated against the action's `inputSchema` (`required`, `type`, `properties`, `items`) before dispatch: a breach fails the step `VALIDATION_ERROR` (`fault`-routable), nothing sent. `os validate` does not judge it yet |
8989
| `script` | Call a **registered** function named by `config.function` (see *Valid-but-silently-wrong* #3) |
9090
| `screen` | Display a UI form to the user (screen flows only). `config.fields[]`: `{ name, label, type, required, options, defaultValue }`, `type` an open widget hint; `'file'` renders the upload widget and resumes with the `sys_file` id bound to `name` — a later `create_record` / `update_record` writes it into a `file` field, which claims the file: collect first, write after the last screen. `'record_link'` (never `'record'`, an object field type) takes no input — it shows the `reference` record whose id `defaultValue` evaluates to, by display name, as a link to its record page: the result screen of a flow that created records, `{ name: 'account_link', type: 'record_link', reference: 'crm_account', defaultValue: { dialect: 'cel', source: 'account.id' } }` over a `create_record` `outputVariable: 'account'`. Both keys required; `required` / `options` / `placeholder` / `min` / `max` refused; a resume value under its name refused (`400 INVALID_SCREEN_INPUT`). A completed `end` `message` is refused and a markdown link in a screen `description` renders literally. Next / Submit and "Step N of M" are not authored: the engine reads the graph when the screen pauses and serves `progress` (`nextScreen: 'none' | 'possible' | 'certain'`; `step` / `stepCount` only when every path agrees), which alone labels the button and draws the counter. A `decision`, `fault` edge, loop back, non-screen pause (`approval`, `wait`) or `subflow` after a screen answers `possible` — "Next", no count. `progress` in a node `config` is refused; never hand-roll a button label or step counter into `fields` |
9191

9292
#### Human Decision
9393

9494
| Node | Purpose |
9595
|:-----|:--------|
96-
| `approval` | Route a record for human sign-off — **suspends** the run until a decision, then continues down the `approve` / `reject` branch (from `plugin-approvals`) |
96+
| `approval` | Route a record for human sign-off — **suspends** the run until a decision, then continues down the `approve` / `reject` branch |
9797

9898
### `notify` — the most-used node type
9999

@@ -193,13 +193,13 @@ type: 'text', isInput: true }, { name: 'approval_result', type: 'boolean', isOut
193193
A whole-string **query placeholder** (`{current_user_id}`, `{today}`,
194194
`{current_year_start}`) passes through verbatim for the query engine; a flow
195195
variable never shadows it, and only `filter` gets this hand-off.
196-
- **An operand that evaluates to `null` refuses the node** (not
197-
`fault`-routable): a dropped condition does not narrow a query, it widens
198-
it, so a routed `delete_record` would empty the object while the run reports
199-
success. Where the value may be absent, route around the node with a
200-
`decision`; to match an empty field, write the literal `null`. A relation
201-
hop (`record.owner.email`) needs the start node's `config.expand` to list
202-
the field — else the fault names the missing hop, not the remedy.
196+
- **An operand that evaluates to `null` refuses the node**: a dropped condition
197+
does not narrow a query, it widens it, so a routed `delete_record` would empty
198+
the object while the run reports success. Where the value may be absent,
199+
route around the node with a `decision`; to match an empty field, write the
200+
literal `null`. A relation hop (`record.owner.email`) needs the start node's
201+
`config.expand` to list the field — else the fault names the missing hop, not
202+
the remedy.
203203

204204
---
205205

@@ -244,8 +244,7 @@ write them right the first time:
244244

245245
3. **`script` nodes call a registered function — nothing else.** `config.function`
246246
(**required**: an empty node refuses at execute, an unregistered name fails
247-
loudly) names one registered via `defineStack({ functions: { my_fn: (ctx) => … } })`;
248-
`notify` delivers, `connector_action` reaches a vendor, a function computes.
247+
loudly) names one registered via `defineStack({ functions: { my_fn: (ctx) => … } })`.
249248

250249
**A flow `function` is a PURE compute step — it does NOT read/write the
251250
database.** It receives `ctx.input` and **returns** a value; `config.outputVariable`
@@ -408,7 +407,7 @@ A vendor system reachable over HTTP (OpenAPI, remote MCP, plain REST) is a
408407
`connectors:` entry inside the app — `provider: 'openapi' | 'mcp' | 'rest'`, a
409408
packaged spec, `auth.credentialRef` (the customer's administrator supplies the
410409
value) — dispatched by `connector_action`; an inbound vendor callback is an
411-
`api` flow. Never a plugin, never an `http` node holding a credential. Recipes,
410+
`api` flow. Never a plugin. Recipes,
412411
credential hand-off, loader limits: [references/integration-recipes.md](./references/integration-recipes.md).
413412
Platform code only when one holds — and then it is the platform's, filed as a
414413
card, the app still writing none: the protocol is not HTTP; the work writes

‎skills/objectstack-automation/references/integration-recipes.md‎

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ deployment and to the sender. Scaffolded apps list the three executors in
1616
- Actions come from the upstream (an OpenAPI `operationId`, an MCP tool name,
1717
the `rest` provider's single `request`) — authored on the entry, they are refused.
1818
- `connectorConfig.input` is a value-slot map like `subflow` `input`: a top-level
19-
CEL envelope is evaluated, any other value sent as written (`{…}`, `{{ }}` are
20-
literal text) — `input: { customer: { dialect: 'cel', source: 'record.stripe_id' } }`.
21-
`os validate` does not judge it yet, so a malformed envelope fails at run time.
19+
CEL envelope is evaluated, any other value kept as written (`{…}`, `{{ }}` are
20+
literal text). Before dispatch the result is judged against the action's
21+
`inputSchema`: `required`, `type` (with OpenAPI `nullable`), `properties`,
22+
`items`; `null` on an optional parameter is absent. A breach fails the step
23+
`VALIDATION_ERROR` (`fault`-routable) naming each path, nothing sent. Text
24+
is never converted: cast a string-held id,
25+
`path: { dialect: 'cel', source: '{"petId": int(record.vendor_id)}' }`.
26+
`os validate` does not judge it yet.
2227
- The answer lands as `<nodeId>.<key>` (`rest` / `openapi`: `{ status, ok, body }`;
2328
`mcp`: `{ ok, content, structuredContent? }`), read from a later node's value
2429
slot: `{ dialect: 'cel', source: 'bal.body.available[0].amount' }`.
@@ -63,7 +68,7 @@ dereference every `$ref` offline, in-document ones included: the loader skips a
6368
`$ref` parameter, request body or response, and the derived input/output schema
6469
silently loses it. `providerConfig.include` allowlists operation keys as the
6570
`mcp` provider's does (absent = every operation; a non-array or unknown entry is
66-
fatal); trimming still keeps the package small.
71+
fatal).
6772

6873
## 2 · Remote MCP server, static header — GitHub
6974

@@ -103,10 +108,10 @@ export const WarehouseApi = defineConnector({
103108
```ts
104109
export const CarrierCallback = defineFlow({
105110
name: 'carrier_callback', label: 'Carrier status callback', type: 'api',
106-
runAs: 'system', // an inbound post carries no trigger user
111+
runAs: 'system',
107112
nodes: [
108113
{ id: 'start', type: 'start', label: 'POST …/hooks/carrier_callback/carrier',
109-
config: { hookId: 'carrier', secretRef: 'CARRIER_HOOK_SECRET' } }, // never a literal secret
114+
config: { hookId: 'carrier', secretRef: 'CARRIER_HOOK_SECRET' } },
110115
{ id: 'apply', type: 'update_record', label: 'Apply status', config: {
111116
objectName: 'shipment', filter: { tracking_no: { dialect: 'cel', source: 'record.tracking_no' } },
112117
fields: { status: { dialect: 'cel', source: 'record.status' } } } },
@@ -127,7 +132,7 @@ name the gap and poll its status (recipe 1's shape) until vendor schemes verify.
127132
```ts
128133
export const LegacyErp = defineConnector({
129134
name: 'legacy_erp', label: 'Legacy ERP', type: 'api', provider: 'openapi',
130-
providerConfig: { spec: { // inline OpenAPI 3.x
135+
providerConfig: { spec: {
131136
openapi: '3.0.3', info: { title: 'Legacy ERP', version: '1' },
132137
servers: [{ url: 'https://erp.example.com' }],
133138
paths: { '/v2/open-orders': { get: { operationId: 'listOpenOrders',
@@ -138,16 +143,15 @@ export const LegacyErp = defineConnector({
138143
// connector_action { connectorId: 'legacy_erp', actionId: 'listOpenOrders', input: {} }
139144
```
140145

141-
Each `operationId` is a named action with its input schema, visible in the flow
142-
palette and to agents; `provider: 'rest'` instead when the path is per call.
146+
Each `operationId` is a named action in the flow palette and to agents;
147+
`provider: 'rest'` instead when the path is per call.
143148

144149
## Not yet — declare the rest, mark the integration blocked, write no plugin
145150

146151
- **OAuth-protected vendor** (DocuSign, Salesforce, Google): the declarative `auth`
147152
union has no `oauth2`; the authorization-code / refresh
148153
lifecycle is not delivered in the open tier. Do not park a short-lived access
149-
token behind a `bearer` ref. Declare the connector, fields and flows, mark the
150-
integration **blocked** on the platform's outbound-OAuth card, and say so.
154+
token behind a `bearer` ref. Blocked on the platform's outbound-OAuth card.
151155
- **Signature-authenticated vendor** (Alipay, WeChat Pay, Aliyun — RSA2 / HMAC
152156
canonical-request signing): no auth kind signs requests today; same handling,
153157
blocked on the request-signing card.

0 commit comments

Comments
 (0)