Skip to content

refactor(automation): remove Workflow Rules; reclaim workflow for state machines#1398

Merged
os-zhuang merged 1 commit into
mainfrom
refactor/remove-workflow-rules
May 30, 2026
Merged

refactor(automation): remove Workflow Rules; reclaim workflow for state machines#1398
os-zhuang merged 1 commit into
mainfrom
refactor/remove-workflow-rules

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

What & why

Workflow Rules (WorkflowRuleSchema + its 7 action sub-schemas: field_update, email_alert, http_call, task_creation, push_notification, custom_script, connector_action) was a spec-only paradigm with no runtime — nothing ever executed it. It also squatted on the workflow metadata-type slot, even though the workflow core service contract is the State Machine Engine + approval state management (getWorkflowConfig / workflowTransition / workflowApprove / workflowReject). The slot was mis-bound.

As a next-gen low-code platform, a separate declarative rule engine is redundant with Flow (Flow is a strict superset; this mirrors Salesforce retiring Workflow Rules in favor of Flow). The low-altitude authoring experience it served is better delivered as a simplified entry over the one Flow engine (and via NL→Flow, ADR-0010).

Changes

Removed

  • packages/spec/src/automation/workflow.zod.ts, workflow.form.ts, workflow.test.ts

Reclaimed workflowStateMachineSchema (matches the service contract; core service / /api/v1/workflow routes / client SDK unchanged)

  • kernel/metadata-type-schemas.tsworkflow: StateMachineSchema
  • stack.zod.tsStack.workflows: StateMachineSchema[]
  • api/protocol.zod.tsGetWorkflowConfigResponse.workflows: StateMachineSchema[]
  • Dropped the now-inapplicable workflow→object cross-reference check (state machines carry no objectName; approval/hook cross-ref coverage retained)

Cleanup — barrel exports, form registry, skill-reference build list, a stale comment

Docs — adds ADR-0018: Unified Node/Action Registry documenting the broader direction: one registry-backed node/action contract across Flow / Workflow-Rule / Approval, Workflow Rules compiled down to Flow rather than run as a separate engine, and the duplicated outbound verbs (http_request/http_call/webhook/notify) consolidated onto the ADR-0012 outbox.

Verification

  • tsc --noEmit on spec — clean
  • Full spec suite — 234 files / 6598 tests green
  • spec build OK; client + objectql typecheck clean
  • Repo-wide scan for the removed symbols — 0 dangling references

Notes

  • The objectui simplified WorkflowDesigner (separate repo) corresponds to this deleted paradigm; it converges once ADR-0018's registry-driven palette lands.
  • Scope intentionally narrow: only the declarative-rules content is removed; the workflow state-machine/approval service is preserved.

…tate machines

Workflow Rules (`WorkflowRuleSchema` + its 7 action sub-schemas) was a
spec-only paradigm with no runtime, squatting on the `workflow` metadata-type
slot. Meanwhile the `workflow` *core service* contract is the State Machine
Engine + approval state management — so the slot was mis-bound.

- Delete `automation/workflow.zod.ts`, `workflow.form.ts`, `workflow.test.ts`.
- Repoint the `workflow` metadata type, `Stack.workflows`, and
  `GetWorkflowConfigResponse.workflows` to `StateMachineSchema`, matching the
  service contract. Core service / `/api/v1/workflow` routes / client SDK
  unchanged.
- Drop the now-inapplicable workflow→object cross-reference check (state
  machines carry no `objectName`); approval/hook cross-ref coverage retained.
- Add ADR-0018 (Unified Node/Action Registry) documenting the direction:
  one registry-backed node/action contract across Flow / Workflow-Rule /
  Approval, with Workflow Rules compiled down to Flow rather than run as a
  separate engine.

Verified: spec tsc clean, full spec suite (234 files / 6598 tests) green,
spec build OK, client + objectql typecheck clean, zero dangling references.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment May 30, 2026 11:47pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:system size/xl tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants