From abb4b9326f1cf57a179092af533af6386d935cc0 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Mon, 23 Nov 2026 13:07:26 -0500 Subject: [PATCH] Run multi-target commands in parallel (#26) - Workflow execute steps send to all targets at once and wait for every result (Promise.all), so one slow or hung worker no longer holds up the rest; any failed target fails the step. parallel: false keeps the old one-at-a-time order, stopping at the first failure, for rolling changes. (Log appends are atomic in SQL, so concurrent targets can't lose entries.) - Quick Command's multi-worker mode sends to every selected worker at once. - Integration tests: 3 workers x 2 s finish in about 2 s; parallel: false takes 6 s or more; one failing target fails the step after all report. - README: the parallel field. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- public/assets/pages/quick.js | 16 +++++----- server.js | 49 ++++++++++++++++-------------- tests/integration/workflows.int.js | 29 ++++++++++++++++++ 4 files changed, 63 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 2b690de..2a66808 100644 --- a/README.md +++ b/README.md @@ -354,7 +354,7 @@ A workflow is a JSON definition with a list of steps, created on the **Workflows | Step type | Fields | What it does | |---|---|---| -| `execute` | `command`, `targets` (`["all"]` or worker names/ids; default all), `condition`, `timeout` (seconds, 5 to 600), `retries` (0 to 5), `retryDelayMs` | Runs the command on each target; a failure fails the workflow | +| `execute` | `command`, `targets` (`["all"]` or worker names/ids; default all), `condition`, `timeout` (seconds, 5 to 600), `retries` (0 to 5), `retryDelayMs`, `parallel` (default true) | Runs the command on all targets at once (`parallel: false`: one after another, stopping at the first failure); a failure on any target fails the workflow | | `parse` | `condition` | Reads `KEY=VALUE` lines (key in capitals) from the last command's output into `state.key` (lower case) | | `route` | `conditions`: `[{ "if", "goto", "label" }, { "default": true, "goto" }]` | Jumps to the first matching condition's step | | `prompt` | `message`, `options`, `key`, `routes` (`{ "