feat: add workflow resume command#69
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
kh workflowexposedpausewith no inverse. The subcommands were create, delete, get, go-live, list, pause, run, update - andgo-livepublishes a workflow as a public template, which is a different concept from re-enabling a paused one.Workflows created via
kh workflow createstart 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 manualUPDATE workflows SET enabled = true.Change
kh workflow resume <workflow-id>(aliasactivate), a direct mirror ofpause: the samePATCH /api/workflows/<id>, with{"enabled": true}instead of{"enabled": false}. No new API surface.Design note: the confirmation prompt is deliberate
resumekeeps the same confirmation prompt and--yesflag aspause. 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.--yesbypasses it for scripting, and non-TTY invocations auto-proceed exactly aspausedoes.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 thepausesuite:PATCHto the right path withenabled: true(the assertion that distinguishes it from pause)--yesskips confirmationactivatealias routes to the same handlerTestWorkflowCmdHas8Subcommandscorrectly failed on the new count and is updated to 9.Full suite passes (
go test ./..., 11 packages) andgo vet ./...is clean.Verified end to end against a running server, not only via httptest:
Not addressed here
gofmt -lreports 40 pre-existing unformatted files in this repo, including files touched by this change. They were already unformatted onmain, so reformatting them is left out to keep this diff reviewable. The two new files are gofmt-clean.