Workflows
Defining, deploying, and managing workflows within a space.
Workflows
A Workflow is the core unit of automation in Linea. It belongs to a Space and defines a sequence of steps that are executed together.
Schema
Lifecycle States
| State | Condition |
|---|---|
| Draft | deployedAt IS NULL and deletedAt IS NULL |
| Deployed | deployedAt IS NOT NULL and deletedAt IS NULL |
| Trashed | deletedAt IS NOT NULL |
Workflows can be trashed and restored. Trashed workflows are excluded from all list queries by default.
API Endpoints
| Method | Path | Description |
|---|---|---|
GET | /workspaces/:wId/spaces/:sId/workflows | List (supports ?trashed=true, ?starred=true) |
POST | /workspaces/:wId/spaces/:sId/workflows | Create workflow |
GET | /workspaces/:wId/spaces/:sId/workflows/:id | Get workflow |
PATCH | /workspaces/:wId/spaces/:sId/workflows/:id | Update name/description/definition |
PATCH | /workspaces/:wId/spaces/:sId/workflows/:id/star | Toggle starred |
PATCH | /workspaces/:wId/spaces/:sId/workflows/:id/trash | Soft delete |
PATCH | /workspaces/:wId/spaces/:sId/workflows/:id/restore | Restore from trash |
Service: Key Methods
findAll(spaceId, query)
trash(spaceId, id, membership)
Requires editor role or above. Sets deletedAt = now().
restore(spaceId, id, membership)
Requires editor role. Sets deletedAt = null.
Frontend
The workflows page lives at /spaces/[spaceId]/workflows and supports three view tabs:
- All: active (non-trashed) workflows
- Starred: active +
starred = true - Trash: trashed workflows with a Restore action
The "New workflow" button is currently disabled pending the visual workflow builder. The definition JSONB field is reserved for the step graph once the builder ships.