Skip to content

feat: add workflow resume command#69

Merged
suisuss merged 1 commit into
mainfrom
feat/KEEP-1019-workflow-resume
Jul 23, 2026
Merged

feat: add workflow resume command#69
suisuss merged 1 commit into
mainfrom
feat/KEEP-1019-workflow-resume

Conversation

@suisuss

@suisuss suisuss commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Problem

kh workflow exposed pause with no inverse. The subcommands were create, delete, get, go-live, list, pause, run, update - and go-live publishes a workflow as a public template, which is a different concept from re-enabling a paused one.

Workflows created via kh workflow create start paused, so a workflow created with the CLI could not be activated with the CLI. Re-enabling required the web UI or a direct database update, which makes the CLI unusable for the create-then-activate flow that scripted and automated callers need. This surfaced while replicating Solana demo workflows into a local environment - the only way to activate them was a manual UPDATE workflows SET enabled = true.

Change

kh workflow resume <workflow-id> (alias activate), a direct mirror of pause: the same PATCH /api/workflows/<id>, with {"enabled": true} instead of {"enabled": false}. No new API surface.

kh wf resume abc123
kh wf resume abc123 --yes
kh wf activate abc123

Design note: the confirmation prompt is deliberate

resume keeps the same confirmation prompt and --yes flag as pause. Resuming looks like the safe direction, but it restarts automation that submits on-chain transactions and spends funds, so it warrants the same friction as pausing. --yes bypasses it for scripting, and non-TTY invocations auto-proceed exactly as pause does.

If reviewers prefer resume to be frictionless, dropping the prompt is a small change - but the asymmetry felt wrong given what resuming actually starts.

Tests

Four new tests in resume_test.go, mirroring the pause suite:

  • sends PATCH to the right path with enabled: true (the assertion that distinguishes it from pause)
  • --yes skips confirmation
  • the activate alias routes to the same handler
  • a non-2xx response surfaces as an error

TestWorkflowCmdHas8Subcommands correctly failed on the new count and is updated to 9.

Full suite passes (go test ./..., 11 packages) and go vet ./... is clean.

Verified end to end against a running server, not only via httptest:

active -> kh wf pause    -> paused
paused -> kh wf resume   -> active
paused -> kh wf activate -> active

Not addressed here

gofmt -l reports 40 pre-existing unformatted files in this repo, including files touched by this change. They were already unformatted on main, so reformatting them is left out to keep this diff reviewable. The two new files are gofmt-clean.

kh workflow exposed pause with no inverse. go-live publishes a workflow
as a public template, which is a different concept from re-enabling a
paused one, so there was no CLI path back to active.

Workflows created via kh workflow create start paused, which meant a
workflow created with the CLI could not be activated with the CLI -
re-enabling required the web UI or a direct database update. That makes
the CLI unusable for the create-then-activate flow that scripted and
automated callers need.

resume is the direct mirror of pause: the same PATCH /api/workflows/<id>
with enabled true instead of false. No new API surface. Aliased as
activate.

The confirmation prompt and --yes flag are kept deliberately. Resuming
looks like the safe direction, but it restarts automation that submits
on-chain transactions and spends funds, so it warrants the same friction
as pausing.

The existing subcommand-count assertion moves from 8 to 9.
@suisuss
suisuss merged commit 84949e9 into main Jul 23, 2026
4 checks passed
@suisuss
suisuss deleted the feat/KEEP-1019-workflow-resume branch July 23, 2026 09:03
@eskp eskp mentioned this pull request Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant