Skip to main content
Without a workflow, a deployment group sends each release to every device in the group at once, limited only by the group’s concurrency. A workflow splits a release into ordered steps, for example a small canary batch, a sign-off, then everyone else. Each step chooses its own devices, its own concurrency, and how many devices may fail before the rollout stops. You write a workflow as a JSON file and upload it to a deployment group.
Workflows are an early release feature. Post feedback on the NervesHub issue tracker.

Requirements

  • NervesHub 2.5.0 or later.
  • network_interfaces conditions rely on the interface a device reports when it connects. nerves_hub_link reports it from 2.11.0.

An example workflow

This workflow has four steps: canaries on Wi-Fi and Ethernet, then cellular canaries, then devices tagged for one city, then an approval. NervesHub appends a fifth step, a catch-all named Remaining devices, so the devices no earlier step covers are updated after the approval. See Step types.

The file

No other top-level fields are allowed. Steps run in the order they are listed. Each step takes these fields and no others: The smallest valid workflow is one named step:

Step types

Every release ends in a catch_all step. If the last step in your file is not a catch_all, NervesHub adds one named Remaining devices. The catch-all never completes. It stays in progress for the life of the release and updates devices that join the group later. If you write your own catch_all step, put it last. Because it never completes, steps listed after it do not start.

Choose devices for a step

matching_conditions narrows the devices an update_devices step covers. A device belongs to at most one step of a release. Leaving out tags or network_interfaces means that condition does not narrow the step.
If you give matching_conditions without match_limit, the step covers at most 10 devices. A step with no matching_conditions at all has no limit.
A step waits for every device it claimed, including devices that are offline. A claimed device that never comes back holds the workflow at that step. See When a step is held by a device that does not come back. A step that matches no devices completes straight away.

Pacing and failure

failure_tolerance is an object with exactly one of two keys:
A device counts as failed once it is in the penalty box. When the number of failed devices reaches the tolerance, the step fails and the rollout stops there. If you leave failure_tolerance out, an update_devices step fails on the first device that fails. approval_required and catch_all steps never fail.

Upload a workflow

1

Open the group's settings

Open the deployment group and select the Settings tab.
2

Upload the file

On the Workflow card, select Upload and pick your .json file. The upload starts as soon as you pick the file.
3

Check the steps

The Workflow card lists the steps a release will walk through, including the trailing Remaining devices step.
A workflow applies from the next release. The current release keeps the steps it was created with. The file is validated on upload. If it is not valid, nothing is stored and the error lists every problem with the path that failed, for example steps/1/concurrent_updates: Type mismatch. Expected Integer but got String. On a group that already has a workflow, the card has three actions:
  • Replace uploads a new file.
  • JSON downloads the stored definition.
  • Remove workflow deletes it. Releases made from then on go to every device in the group at once. A release already walking through its steps carries on with them.

Follow a rollout

Each new release starts again at step 1. The group’s status badge shows Awaiting approval or Stopped when the release needs someone to act. The Deployment groups page lists those groups under Needs you.

Approve a step

When a release reaches an approval_required step, the group’s Overview tab shows that the step is waiting for approval. Select Approve and continue. NervesHub records who approved the step and when, and the release moves to the next step.

Retry or skip a failed step

When a step fails, the Overview tab shows that the step stopped on failures. Nothing further is sent until you choose one of these:
  • Retry step lets the failed devices out of the penalty box, clears their attempts, and runs the step again.
  • Skip step releases the step’s devices so a later step, usually the catch-all, updates them.
Both buttons appear only while a step has failed. The trailing catch-all step cannot be skipped.

Where you can act on a step

All three actions need the deployment_group:release:manage permission. See Roles. Slack needs the Slack app connected. Workflow step events are also sent to webhooks.

When a step is held by a device that does not come back

A step that is running has not failed, so it has no Skip step button, in the web UI or in Slack. To move the rollout on:
  • Remove the device from the deployment group, or delete the device. A device that has left the group no longer counts toward the step. In the web UI, open the device and click Remove… in the Deployment group row of the Firmware updates card.
  • Or create a new release. Each new release starts again at step 1.

What a workflow changes on the group

While a group has a workflow, the Sending updates card on its Settings tab disables two settings: Queue order and the Penalty box settings still apply. See Rollout controls.