Skip to content

fix(example-crm): migrate workflows to state-machine schema - #1403

Merged
os-zhuang merged 1 commit into
mainfrom
fix/migrate-example-workflows-to-state-machine
May 31, 2026
Merged

fix(example-crm): migrate workflows to state-machine schema#1403
os-zhuang merged 1 commit into
mainfrom
fix/migrate-example-workflows-to-state-machine

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

What

Migrate app-crm's two example workflows from the legacy Automation.WorkflowRule to the state-machine StateMachineConfig (the workflow metadata type now maps to StateMachineSchema).

Why

The workflow type was reclaimed for state machines, but the example workflows were never migrated — so defineStack validation fails (workflows.0.id / initial / states required) and the example build/boot is broken on main. This also blocks every framework PR, since CI's Build Core compiles the example app.

Changes

  • high-value-deal: openUPDATE[amount>100k]→ high_value (email_alert to sales managers); won/lost final.
  • stale-opportunity: activeSTALE_30D[open]→ flagged (email_alert + task_creation follow-up); UPDATED clears back to active; won/lost final.

Both preserve the original rules' intent as guarded transitions + entry actions.

Notes

@objectstack/example-crm is private → no changeset. Prerequisite for the datasource-action refactor PR (#1402), which will rebase onto this.

The `workflow` metadata type was reclaimed for state machines
(`StateMachineSchema`), but app-crm's two example workflows were still
declared as the legacy `Automation.WorkflowRule`, so `defineStack`
validation rejects them and the example build/boot fails.
Migrate both to `StateMachineConfig`, preserving the original intent as
guarded transitions:
- high-value-deal: `open` --UPDATE[amount>100k]--> `high_value` (email_alert
to sales managers); closes won/lost.
- stale-opportunity: `active` --STALE_30D[open]--> `flagged` (email_alert +
task_creation follow-up); `UPDATED` clears back to `active`; closes
won/lost.
@vercel

vercelBot commented May 31, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
specReadyReadyPreview, CommentMay 31, 2026 1:35am

Request Review

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@xuyushun441-sys@os-zhuang