Visual Workflow Engine
Complete guide to building and managing content lifecycles using the visual FSM engine in SveltyCMS.
On this page
The SveltyCMS Workflow Engine allows you to define complex, non-linear content lifecycles using a visual Finite State Machine (FSM) editor. This ensures strict governance and compliance across multi-stage editorial processes.
ποΈ Core Concepts
States
A State represents a stage in the content lifecycle (e.g., Draft, Legal Review, Live).
- Start State: The initial state for all new entries.
- Terminal States: States from which no further transitions are possible (e.g.,
Archived).
Transitions
Transitions define the valid paths between states.
- Triggers: Actions that initiate a move (e.g., βSubmit for Reviewβ).
- Guards: Conditional logic that must pass for a transition to occur (e.g., βRequires valid SEO titleβ).
- Actions: Automated side effects (e.g., βSend notification to Legal teamβ).
π¨ The Workflow Builder
Located at Config > Workflows, the builder provides a node-based interface for architecting your lifecycles.
Creating a Workflow
- Click New Workflow and assign it to a collection.
- Add States: Use the canvas to place nodes for each stage.
- Connect Nodes: Drag from one state to another to create a transition.
- Configure Details: Click a transition to define its label, color, and requirements.
Integration with Content Editor
Once active, the workflow replaces the standard βPublishβ dropdown in the entry editor with a dynamic Action Hub matching the current stateβs valid transitions.
π Governance & Security
Multi-Stage Review Pipeline
SveltyCMS supports non-binary editorial review pipelines beyond standard draft/published toggles:
[Draft] ββ> [In Review] ββ> [Approved] ββ> [Scheduled] ββ> [Published]
β β β β
βββ<βββββββββββ΄βββββββ<ββββββββ΄ββββββββββββββ<ββββββββββββββββ΄ββ> [Archived]
Standard editorial stages include:
draft: Initial authoring and scratch editing.in_review: Submitted for editorial or peer review.approved: Formally approved by editors/legal.scheduled: Queued for automated time-delayed release.published: Live in production and exposed to public readers.archived: Deprecated or unlisted historical content.
Role-Based Transition Gates
Stage changes are gated through the workflow:transition RBAC permission and stage-specific role constraints:
- Authors can submit content from
draft$\to$in_review. - Only Senior Editors or Legal reviewers can transition from
in_review$\to$approved. - Publishers can transition from
approved$\to$published.
Immutable Audit Trail & Editorial Comments
Every transition automatically creates an audit history record:
interface WorkflowHistoryEntry {
transitionId: string;
fromState: string;
toState: string;
performedBy: string; // User ID
performedAt: ISODateString;
comment?: string; // Editorial review feedback
}
History can be inspected in the UI or retrieved programmatically:
const history = await cms.workflow.getHistory("articles", "entry_123");
Programmatic SDK Transition
Workflows can be advanced programmatically via the LocalCMS SDK:
const result = await cms.workflow.transition({
collectionId: "articles",
entryId: "entry_123",
targetState: "approved",
comment: "Legal review completed, approved for release.",
user: currentUser,
});
Signed Approval Links
For external stakeholders without CMS access, the engine can generate HMAC-signed one-click approval links via the Automation System.
π€ AI & Automation
The Workflow Engine integrates deeply with:
- Automation System: Automatically trigger workflows based on events.
- AI Agent: Use the agent to βAnalyze and advanceβ content based on quality checks.
π Related Documentation
- Automation System: For triggering transitions via events.
- Content System Architecture: For understanding node structures.
- Access management: Roles that may run a transition.