Workflows API
Workflow orchestration for long-running operations. Built on Trigger.dev.Design Principle: All infrastructure mutations flow through workflows.
This provides durable execution, automatic retries, audit trails, and
observability. Workflows double as the event log for the platform.
Workflow Runs
Query and manage workflow executions.- List Runs
- Get Run Details
- Retry Failed Run
| Parameter | Type | Description |
|---|---|---|
type | string | Filter by workflow type |
status | string | pending, running, completed, failed, cancelled |
resourceType | string | server, cluster, vm |
resourceId | string | Specific resource ID |
triggeredBy | string | User ID who triggered |
since | ISO date | Runs started after this time |
until | ISO date | Runs started before this time |
Workflow Types
Available workflow types and their purposes:| Type | Trigger Source | Description |
|---|---|---|
server.register | Atlas API | Register new bare metal server |
server.inspect | Atlas API | Hardware inspection |
server.provision | Atlas API | OS provisioning |
server.lifecycle | Atlas/Arc API | Lifecycle actions (power, provision, etc.) |
server.decommission | Atlas API | Remove from inventory |
cluster.create | Arc API | Create Kubernetes cluster |
cluster.scale | Arc API | Scale cluster nodes |
cluster.upgrade | Arc API | Upgrade Kubernetes version |
cluster.delete | Arc API | Delete cluster |
vm.create | Arc API | Create virtual machine |
vm.power | Arc API | VM power actions |
vm.delete | Arc API | Delete VM |
sync.server-state | Projector | Sync K8s state to cache |
sync.cluster-state | Projector | Sync cluster state to cache |
Workflow Metrics
Aggregate statistics for workflow performance.Workflow Operations
Long-running operations that interact with infrastructure (BMC, Kubernetes) return202 Accepted immediately with a Trigger.dev workflow ID for tracking. All infrastructure mutations flow through durable Trigger.dev workflows.
Design Principles
- Immediate Response: Return 202 within < 1 second, donβt wait for completion
- Workflow ID: Provide Trigger.dev run ID for polling or webhook correlation
- Estimated Duration: Give clients a hint for progress UI
- Status Endpoint: Query workflow status via
/v1/workflows/runs/:id - Webhook Integration: Support webhooks for completion notifications
Workflow Orchestration
Use Trigger.dev for durable, retryable task execution:Pattern: Compensating Actions. Use
onFailure to clean up partial state.
Release allocated resources, update status to error, notify via webhook.Workflow Status Endpoint
Event Sourcing Pattern
- We will need to get updated to use event sourcing pattern for the workflows API.
- Need to decide on K8s Informers, Watchers, or Controller-based approach.