Skip to content

Commit e919087

Browse files
os-zhuangclaude
andauthored
docs(automation): hand-written connector authoring guide — the declarative connectors: path gets its page (#4289) (#4293)
ADR-0097 made connectors tenant-authored metadata, but no hand-written page taught how to write an entry. New content/docs/automation/connectors.mdx covers the three entry shapes, the per-provider `providerConfig` contracts (rest / openapi / mcp — factory-validated at boot, invisible to `os validate`), credentialRef-based auth incl. why `oauth2` is deliberately absent from the declarative shape (enterprise tier, ADR-0015), the configuration-vs-operational failure split, and the showcase as the runnable reference. The two connector-auth exemptions in packages/spec/variant-docs.json flip to governed docs bindings per their own "when one is written, bind it" note, so the #4177 gate now enforces all five auth variants against the guide. Every example parses against the real schemas: the four full examples and the auth fragments via DeclarativeConnectorEntrySchema (including the documented rejections: inline `authentication` on a provider-bound instance, auth / providerConfig without provider, authored actions), the dispatch snippet via defineFlow, and the four marked blocks type-check under check:skill-examples (202 examples). check:variant-docs green at 8 governed / 12 exempt; check-doc-authoring clean. Closes #4289. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 2053714 commit e919087

8 files changed

Lines changed: 390 additions & 10 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
---
3+
4+
docs-only: hand-written connector authoring guide at
5+
`content/docs/automation/connectors.mdx` (#4289) — the declarative
6+
`connectors:` path (ADR-0097) finally has a page: the three entry shapes,
7+
per-provider `providerConfig` contracts (`rest` / `openapi` / `mcp`),
8+
`credentialRef`-based auth with the enterprise-tier `oauth2` absence stated
9+
explicitly, boot/reload failure modes, and the showcase pointer. The two
10+
connector-auth entries in `packages/spec/variant-docs.json` flip from
11+
`exempt` to governed, so future auth variants must update the guide.
12+
Releases nothing.

content/docs/ai/connect-mcp.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,4 @@ skill and a guided `/objectstack:connect` command.
204204
- [Actions](/docs/ui/actions) — defining the actions you expose
205205
- [Your app as an MCP server](/docs/api#your-app-as-an-mcp-server) — the API-level view
206206
- [AI Agents](/docs/ai/agents) — building agents *inside* your app (the other direction)
207+
- [Connectors](/docs/automation/connectors) — the outbound counterpart: *consuming* an external MCP server as a flow-dispatchable connector (`provider: 'mcp'`)

content/docs/automation/connectors.mdx

Lines changed: 363 additions & 0 deletions
Large diffs are not rendered by default.

content/docs/automation/flows.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Each node performs a specific action in the flow.
119119
| `map` | Sequential multi-instance — run a per-item subflow for each element, one at a time (each may pause); batch approval (ADR-0039) |
120120
| `connector_action` | Execute an external connector action |
121121

122-
`connector_action` dispatches against the runtime **connector registry**, which connector plugins populate. The three **generic executors**`rest`, `openapi`, and `mcp` — double as provider factories: with them in your app's `plugins:`, a declarative `connectors:` entry that names a `provider` is materialized into a live, dispatchable connector at boot with no plugin code (ADR-0097). Scaffolded projects (`npm create objectstack`) ship all three executors by default — paired with the `automation` capability that performs the materialization — and the showcase wires them too. Brand connectors (Slack, …) are installed separately. One security note: a declarative `mcp` instance using a **stdio** transport spawns a local process from metadata and is therefore denied by default — the host opts in with `new ConnectorMcpPlugin({ declarativeStdio: ['<trusted-command>'] })`; `http` transports need no opt-in.
122+
`connector_action` dispatches against the runtime **connector registry**, which connector plugins populate. The three **generic executors** — `rest`, `openapi`, and `mcp` — double as provider factories: with them in your app's `plugins:`, a declarative `connectors:` entry that names a `provider` is materialized into a live, dispatchable connector at boot with no plugin code (ADR-0097). Scaffolded projects (`npm create objectstack`) ship all three executors by default — paired with the `automation` capability that performs the materialization — and the showcase wires them too. Brand connectors (Slack, …) are installed separately. One security note: a declarative `mcp` instance using a **stdio** transport spawns a local process from metadata and is therefore denied by default — the host opts in with `new ConnectorMcpPlugin({ declarativeStdio: ['<trusted-command>'] })`; `http` transports need no opt-in. [Connectors](/docs/automation/connectors) is the full authoring guide — provider config contracts, `credentialRef` auth, and failure modes.
123123

124124
### Node Structure
125125

content/docs/automation/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Automation
3-
description: Hooks, flows, workflows, approvals, scheduled jobs, and durable webhooks — the process engine that reacts to your data.
3+
description: Hooks, flows, workflows, approvals, scheduled jobs, durable webhooks, and connectors — the process engine that reacts to your data.
44
---
55

66
# Automation
@@ -33,6 +33,7 @@ export const OpportunityStageHook: Hook = {
3333
- **Workflows** model a record's lifecycle as a **finite state machine**: states, transitions, and guards ([Workflows](/docs/automation/workflows)).
3434
- **Approvals** are flow nodes with approver resolution, approve/reject decisions, and escalation ([Approvals](/docs/automation/approvals)).
3535
- **Webhooks** deliver events to external systems through a **durable outbox** — exponential/linear/fixed retry with dead-lettering, HMAC signing, and an admin redeliver endpoint ([Webhook Delivery](/docs/automation/webhooks)).
36+
- **Connectors** package external systems behind named actions that flows dispatch — registered by plugins, or **declared as pure metadata** (`provider: 'rest' | 'openapi' | 'mcp'`) and materialized at boot, with reference-based credentials ([Connectors](/docs/automation/connectors)).
3637
- **Scheduled jobs** run on `setInterval` or cron via the job service, alongside `schedule`-type flows.
3738

3839
Rule of thumb: model *state* with workflows, model *steps* with flows, use hooks for *code-level* reactions, and webhooks to *notify the outside world*.
@@ -46,6 +47,7 @@ Rule of thumb: model *state* with workflows, model *steps* with flows, use hooks
4647
<Card href="/docs/automation/workflows" title="Workflows" description="State-machine lifecycle modeling" />
4748
<Card href="/docs/automation/approvals" title="Approvals" description="Approval nodes: approvers, decisions, escalation" />
4849
<Card href="/docs/automation/webhooks" title="Webhook Delivery" description="Durable outbox, retries, HMAC signing" />
50+
<Card href="/docs/automation/connectors" title="Connectors" description="Declarative rest/openapi/mcp instances, credentialRef auth" />
4951
</Cards>
5052

5153
## Related

content/docs/automation/meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"flows",
88
"workflows",
99
"approvals",
10-
"webhooks"
10+
"webhooks",
11+
"connectors"
1112
]
1213
}

content/docs/capabilities/integrations.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A business system earns its keep by fitting into the systems — and habits —
1212
- **Generated REST APIs** — every object gets standard endpoints automatically, so your website, mini-program, or ERP reads and writes through the same permission gate as people.
1313
- **Webhooks out** — data changes notify external systems (*deal won → billing system opens an invoice*).
1414
- **Triggers in** — external systems start platform [flows](/docs/capabilities/automation).
15-
- **Connectors** — ready-made Slack and generic REST connectors drop into flows.
15+
- **Connectors** — ready-made Slack and generic REST connectors drop into flows; an HTTP API, OpenAPI document, or MCP server can be [declared as metadata](/docs/automation/connectors) and goes live at boot, no plugin code.
1616
- **Federated external databases** — point at an existing database and query it in place: no migration, visible in views, usable in flows.
1717
- **Marketplace templates** — install complete apps (HotCRM among them) with one click: objects, views, flows, dashboards, and seed data included, then customize in Studio.
1818
- **Deploy anywhere** — cloud or fully self-hosted; your data and your app definition stay yours.
@@ -27,4 +27,4 @@ Interface text — labels, options, messages — is translatable per language, a
2727

2828
> **In HotCRM**: the interface ships in four languages (English, Chinese, Japanese, Spanish); the Slack connector and web-to-lead intake demonstrate both directions of integration.
2929
30-
**For developers**: [API & SDK](/docs/api), [connectors and webhooks](/docs/automation), and [translations](/docs/ui/translations).
30+
**For developers**: [API & SDK](/docs/api), [connectors](/docs/automation/connectors), [webhooks](/docs/automation/webhooks), and [translations](/docs/ui/translations).

packages/spec/variant-docs.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
" - the remaining exemptions now state the gap plainly instead of pointing at the",
2929
" generated page as if it settled the question. Connector authentication is the one",
3030
" worth acting on: it is tenant-authored (ADR-0097 declarative `connectors:`) and the",
31-
" repo has no hand-written connector guide at all."
31+
" repo has no hand-written connector guide at all. (Since closed: #4289 wrote",
32+
" content/docs/automation/connectors.mdx and both connector-auth entries are governed.)"
3233
],
3334
"entries": [
3435
{
@@ -80,14 +81,14 @@
8081
{
8182
"key": "type:api-key|basic|bearer|none|oauth2",
8283
"label": "connector authentication",
83-
"exempt": "generated-reference-only",
84-
"reason": "DOCUMENTATION GAP, not a non-authorable surface — the strongest candidate among the exemptions for a real guide. Connector auth IS tenant-authored (ADR-0097 materializes a declarative `connectors:` entry naming a `provider` into a live connector at boot), but the repo has no hand-written connector page at all: the only prose is one paragraph inside automation/flows.mdx about the `connector_action` node. Until a guide exists there is nothing for this entry to bind to; when one is written, bind it and delete this exemption."
84+
"docs": ["content/docs/automation/connectors.mdx"],
85+
"note": "The runtime auth shape (ConnectorAuthConfigSchema) — five variants including the enterprise-tier `oauth2`. Was exempt generated-reference-only while no hand-written connector page existed; #4289 wrote the guide and bound it, per the old exemption's own instruction."
8586
},
8687
{
8788
"key": "type:api-key|basic|bearer|none",
8889
"label": "connector auth (environment-artifact projection)",
89-
"exempt": "generated-reference-only",
90-
"reason": "The declarative connector-instance auth shape (ADR-0097), reached via EnvironmentArtifactSchema.metadata.connectors[].auth. It carries a `credentialRef` rather than an inline secret, and omits `oauth2` because the authorization-code/refresh lifecycle is the enterprise tier (ADR-0015) — not because the artifact narrows it. Inherits the gap above; a connector guide would govern both."
90+
"docs": ["content/docs/automation/connectors.mdx"],
91+
"note": "The declarative connector-instance auth shape (ADR-0097), reached via EnvironmentArtifactSchema.metadata.connectors[].auth: `credentialRef` references only, and `oauth2` deliberately absent (enterprise tier, ADR-0015) — the guide states that absence explicitly so authors don't read it as an omission."
9192
},
9293
{
9394
"key": "strategy:isolated_db|isolated_schema|shared_schema",

0 commit comments

Comments
 (0)