Skip to content

Workflow Lifecycle

A workflow in KubeOrch represents a complete Kubernetes application topology — the set of resources, their configurations, and the connections between them.

Workflow State Machine

  • Draft — Initial state. Workflow is being designed on the canvas.
  • Published — Workflow is finalized and ready for deployment.
  • Archived — Workflow is no longer active but preserved for reference.

A new workflow requires a name and a target cluster. The cluster determines where resources will be deployed.

POST /v1/api/workflows
{
"name": "My Web App",
"cluster_id": "production-cluster"
}

On the visual canvas, users:

  • Add nodes from the Command Palette (Cmd+K) or by dragging from the sidebar
  • Configure nodes by clicking them to open the settings panel
  • Connect nodes by drawing edges between ports (e.g., Service → Deployment, Ingress → Service)
  • Auto-save — changes are debounced and saved automatically

Saving persists the current canvas state (nodes + edges) to the database without creating a version snapshot:

POST /v1/api/workflows/:id/save
{
"nodes": [...],
"edges": [...]
}

Running a workflow:

  1. Creates a version snapshot — captures current nodes/edges as a numbered version
  2. Executes the workflow — processes each node and applies resources to Kubernetes
  3. Starts watchers — monitors deployed resources for status changes
  4. Streams status — sends real-time updates via SSE
POST /v1/api/workflows/:id/run
{
"trigger_data": {}
}

The response includes a run_id for tracking the execution.

During and after deployment, users can:

  • Watch node status on the canvas (green = healthy, yellow = partial, red = error)
  • Stream pod logs in the mini-logs panel or resource detail page
  • Open a terminal into running containers via the WebSocket terminal
  • View diagnostics for failing nodes with suggested auto-fixes

Every run creates an automatic version. Users can also create manual versions with tags and descriptions.

Key version operations:

  • List versions — paginated history of all versions
  • Compare versions — side-by-side diff showing added, removed, and modified nodes/edges
  • Restore version — roll back to a previous version (creates a new version from old state)

Edges (connections between nodes) carry semantic meaning:

Source NodeTarget NodeEdge Meaning
ServiceDeploymentService routes traffic to this Deployment’s pods
IngressServiceIngress path forwards to this Service
HPADeployment/StatefulSetHPA scales this workload
ConfigMapDeployment/StatefulSetConfigMap is volume-mounted into containers
SecretDeployment/StatefulSetSecret is volume-mounted into containers
PVCDeployment/StatefulSetPVC is volume-mounted for persistent storage
NetworkPolicyAny workloadPolicy applies to this workload’s pods

When an edge is drawn, the UI automatically updates the linked fields in the node data (e.g., _linkedDeployment, _linkedConfigMaps).

A workflow run tracks:

FieldDescription
statusrunning, completed, failed, cancelled
versionWhich version was deployed
started_atWhen execution began
completed_atWhen execution finished
durationTotal execution time in milliseconds
node_statesPer-node execution state and status
logsExecution log messages
triggered_bymanual, schedule, or webhook