Skip to main content

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.
Query Parameters:Response:

Workflow Types

Available workflow types and their purposes:

Workflow Metrics

Aggregate statistics for workflow performance.
Example:
Response:

Workflow Operations

Long-running operations that interact with infrastructure (BMC, Kubernetes) return 202 Accepted immediately with a Trigger.dev workflow ID for tracking. All infrastructure mutations flow through durable Trigger.dev workflows.

Design Principles

  1. Immediate Response: Return 202 within < 1 second, don’t wait for completion
  2. Workflow ID: Provide Trigger.dev run ID for polling or webhook correlation
  3. Estimated Duration: Give clients a hint for progress UI
  4. Status Endpoint: Query workflow status via /v1/workflows/runs/:id
  5. 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.