Skip to main content

Flow Deployments

Deploy flows to edge devices with four strategies: all-at-once, rolling, canary, and blue-green. Auto-rollback, health checks, and deployment tracking.

Overview

EdgeFlow supports managed flow deployments from the cloud to edge devices. Flows are authored and published in the cloud, then deployed to one or more devices using configurable strategies. Each deployment is tracked with full status reporting, health checks, and automatic rollback on failure.

Flow Lifecycle

┌─────────┐   edit   ┌───────────┐   publish   ┌───────────┐   deploy   ┌──────────┐
│  Draft  │────────>│   Draft   │───────────>│ Published │──────────>│ Deployed │
└─────────┘         └───────────┘            └───────────┘           └──────────┘
                                                   │
                                              archive
                                                   │
                                                   ▼
                                             ┌───────────┐
                                             │ Archived  │
                                             └───────────┘

Flow States

State Description
Draft Flow is being edited, not ready for deployment
Published Flow is finalized and ready for deployment to devices
Archived Flow is inactive and hidden from default views

Cloud Flow Management

# Create a flow
POST /api/v1/flows
{
  "name": "Temperature Alert",
  "description": "Monitor temperature and send alerts",
  "tags": ["temperature", "alerts"],
  "definition": {
    "nodes": [
      {"id": "n1", "type": "dht", "name": "DHT22 Sensor", "config": {}, "x": 100, "y": 200},
      {"id": "n2", "type": "switch", "name": "Threshold", "config": {}, "x": 300, "y": 200},
      {"id": "n3", "type": "mqtt_out", "name": "Alert", "config": {}, "x": 500, "y": 200}
    ],
    "connections": [
      {"source": "n1", "target": "n2"},
      {"source": "n2", "target": "n3"}
    ],
    "variables": [
      {"name": "threshold", "type": "number", "value": "30"}
    ]
  }
}

# Publish a flow (makes it deployable)
POST /api/v1/flows/:id/publish

# List all flows
GET /api/v1/flows

# Update a flow (draft only)
PUT /api/v1/flows/:id

# Delete a flow
DELETE /api/v1/flows/:id

Deployment Strategies

All-at-Once

Deploy to all target devices simultaneously. Best for small fleets or non-critical updates.

SettingDefault
Timeout30 minutes
Auto-rollbackEnabled
Health checkEnabled

Rolling

Deploy in sequential batches. If any batch exceeds the failure threshold, deployment pauses and rolls back.

SettingDefault
Batch size10 devices
Batch delay5 minutes
Failure threshold20%
Timeout30 minutes
Auto-rollbackEnabled

Canary

Deploy to a small percentage of devices first. After a monitoring period, deploy to the rest.

SettingDefault
Canary percentage10%
Canary delay30 minutes
Timeout2 hours
Auto-rollbackEnabled

Blue-Green

Deploy to a parallel environment, verify, then switch traffic. Provides instant rollback capability.

SettingDefault
Switch delay10 minutes
Timeout1 hour
Auto-rollbackEnabled

Deployment Status

Status Description
pending Deployment created, awaiting start
running Actively deploying to devices
completed All target devices updated successfully
failed Deployment failed (check target statuses)
rolled_back Rolled back to previous version

Deployment API

# Create deployment
POST /api/v1/deployments
{
  "flow_id": "flow_abc123",
  "strategy": "rolling",
  "target_devices": ["dev_001", "dev_002", "dev_003"],
  "config": {
    "batch_size": 5,
    "batch_delay": "5m",
    "auto_rollback": true,
    "health_check": true
  }
}

# Start deployment
POST /api/v1/deployments/:id/start

# Check deployment status
GET /api/v1/deployments/:id
{
  "id": "dep_xyz789",
  "flow_id": "flow_abc123",
  "strategy": "rolling",
  "status": "running",
  "total_targets": 3,
  "completed_targets": 1,
  "failed_targets": 0,
  "targets": [
    {"device_id": "dev_001", "status": "success"},
    {"device_id": "dev_002", "status": "deploying"},
    {"device_id": "dev_003", "status": "pending"}
  ],
  "created_at": "2026-02-21T12:00:00Z",
  "started_at": "2026-02-21T12:01:00Z"
}

# Pause deployment
POST /api/v1/deployments/:id/pause

# Rollback deployment
POST /api/v1/deployments/:id/rollback

# List all deployments
GET /api/v1/deployments

Auto-Rollback

When enabled, auto-rollback automatically reverts failed deployments. For rolling deployments, rollback triggers when the failure rate exceeds 20% of any batch. For canary deployments, any failure in the canary group triggers a full rollback.