Workflow Actions
Content entry workflow state transition controls with comment support and async transitions.
On this page
The Workflow Actions component provides workflow state transition controls for content entries. It loads the workflow definition and current instance on mount, then renders available transitions as actionable buttons.
Props
| Prop | Type | Description |
|---|---|---|
collectionId |
string |
Parent collection identifier |
entryId |
string |
Content entry identifier |
Behavior
- On Mount: Fetches both the workflow definition (
/api/workflows?collectionId=...) and current workflow instance (/api/workflows?entryId=...) in parallel - State Loading: Displays a loading indicator until both fetches resolve
- Transition Selection: User selects a target state from available transitions
- Optional Comment: Can include an editorial comment with the transition
- Async Execution: Transitions are executed via
PATCH /api/workflowswith the entry ID, target state, and comment
State
| Variable | Type | Description |
|---|---|---|
workflow |
WorkflowDefinition \| null |
The loaded workflow definition (states, transitions) |
instance |
WorkflowInstance \| null |
Current workflow instance for the entry |
loading |
boolean |
Loading state indicator |
comment |
string |
User-provided transition comment |
showComment |
boolean |
Whether the comment input is visible |
selectedTargetStateId |
string |
Currently selected target state |
Features
- Parallel Loading: Workflow definition and instance loaded concurrently
- Comment Support: Optional editorial comments on each transition
- Toast Notifications: Success/failure feedback via the toast store
- Svelte Transitions: Uses
fadeandslidefor smooth UI transitions
Usage
<WorkflowActions collectionId="posts" entryId="entry_abc123" />
Related
Was this page helpful?