Skip to content

💥 Workflow delete now prompts for confirmation - #1029

Merged
fretz12 merged 3 commits into
mainfrom
jiechenz/add-warning-to-deletion
May 19, 2026
Merged

💥 Workflow delete now prompts for confirmation#1029
fretz12 merged 3 commits into
mainfrom
jiechenz/add-warning-to-deletion

Conversation

@jiechenz

@jiechenz jiechenz commented May 18, 2026

Copy link
Copy Markdown
Contributor

What was changed

  1. Added a warning to temporal workflow delete explaining that deleting Workflow Executions in a
    global Namespace removes them from all replicas, and that requests sent to a passive cluster are forwarded to the active cluster by default unless --grpc-meta xdc-redirection=false is specified.

  2. Delete workflow now prompts for confirmation

Why?

The CLI should make that blast radius clear before users confirm deletion.

The passive-cluster note helps users who intentionally want to target a passive cluster avoid the default frontend forwarding behavior.

Checklist

  1. Closes

  2. How was this tested:

unit-test and local run.

single deletion

go run ./cmd/temporal  workflow delete -w pay-retention-92728
WARNING: Deleting Workflow Executions in a global Namespace removes them from all replicas. Requests sent to a passive cluster are forwarded to the active cluster by default; to target the passive cluster directly, specify `--grpc-meta xdc-redirection=false`.
Delete Workflow "pay-retention-92728"? y/N
Error: user denied confirmation
exit status 1

batch deletion

go run ./cmd/temporal workflow delete --query "WorkflowId = 'pay-retention-92728'"

WARNING: Deleting Workflow Executions in a global Namespace removes them from all replicas. Requests sent to a passive cluster are forwarded to the active cluster by default; to target the passive cluster directly, specify `--grpc-meta xdc-redirection=false`.
Start batch against approximately 1 workflow(s)? y/N y
Started batch for job ID: ddab94d3-719f-4a4a-b379-12cdd8229e36
  1. Any docs updates needed?

@jiechenz
jiechenz requested a review from a team as a code owner May 18, 2026 19:53
@CLAassistant

CLAassistant commented May 18, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

return err
} else if exec != nil {
_, err := cl.WorkflowService().DeleteWorkflowExecution(cctx, &workflowservice.DeleteWorkflowExecutionRequest{
yes, err := cctx.promptYes(workflowDeleteSingleConfirmationMessage(exec), c.Yes)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prompting would be a breaking change if used in a script. Can you follow this in the PR title/description?

Breaking changes must be treated with high review rigor, marked with 💥 (:boom:) in commit messages and the PR title/description, and called out with 💥 in the release notes with a clear explanation.

FYI we're in process of standardizing this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

defer cl.Close()

exec, batchReq, err := c.workflowExecOrBatch(cctx, c.Parent.Namespace, cl, singleOrBatchOverrides{})
cctx.Printer.Println(workflowDeleteWarning)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will print for all namespace types including non-global ones. I'd suggest either

  • Making the message more specific, i.e. "WARNING: If this Namespace is global, deleting Workflow Executions in the namespace removes them ..."
  • Or better UX at the cost of extra RPC: Call DescribeNamespace, check GetIsGlobalNamespace and print warning conditionally

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on this, would it be possible to show this warning only for replicated users in a easier way? Users running a single cluster might be confused with this warning.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Updated to check on global namespace.

return nil
}

func workflowDeleteConfirmationMessage(action string) string {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we can just inline this

defer cl.Close()

exec, batchReq, err := c.workflowExecOrBatch(cctx, c.Parent.Namespace, cl, singleOrBatchOverrides{})
cctx.Printer.Println(workflowDeleteWarning)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the warning goes to stdout, so --output json callers get a non-JSON line with their output. Send to stderr for warnings:

Suggested change
cctx.Printer.Println(workflowDeleteWarning)
fmt.Fprintln(cctx.Options.Stderr, workflowDeleteWarning)

jiechenz and others added 2 commits May 18, 2026 17:08
Single-workflow `temporal workflow delete` now requires interactive
confirmation (or `--yes`/`-y`). Scripts that previously relied on the
command running non-interactively will break unless they pass `--yes`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jiechenz jiechenz changed the title Add warning message to workflow deletion command 💥 Add warning message to workflow deletion command May 19, 2026
@jiechenz jiechenz changed the title 💥 Add warning message to workflow deletion command 💥 Workflow delete in global namespace now prompts for confirmation May 19, 2026
@jiechenz jiechenz changed the title 💥 Workflow delete in global namespace now prompts for confirmation 💥 Workflow delete now prompts for confirmation May 19, 2026
@fretz12
fretz12 merged commit b281f4b into main May 19, 2026
10 checks passed
@fretz12
fretz12 deleted the jiechenz/add-warning-to-deletion branch May 19, 2026 16:13
chaptersix added a commit that referenced this pull request Jul 6, 2026
…#1104)

## Summary

Backports server-independent changes from `main` into `release/1.8.x`.
Every commit here was verified to build and pass codegen against the
release line's current dependency pins (`server v1.31.0`, `sdk v1.41.1`,
`api v1.62.8`) — nothing pulls in the newer server/SDK/API that landed
on `main` via #1017.

Scope agreed as: bug fixes + CLI changes + CI/tooling. Dependency bumps
(#1040, #1052, #1063) and server-version-dependent features are
intentionally excluded.

## Included (22 commits, cherry-picked with `-x`)

**CLI / bug fixes**
- #1006 Fix help with value flags (addresses #1003 — `--help` with value
flags like `--address 123` surfaced `pflag: help requested` as an error)
- #1012 skip CountWorkflow in batch operations when `--yes` is set
- #1016 Sort output of listing search attributes
- #1029 Workflow delete now prompts for confirmation
- #1033 Add persistence info to start-dev banner
- #1047 Add `temporal schedule list-matching-times` command
- #1056 Fix task-queue config set help: use real fairness weight flag
names
- #1059 Prefix dev server cluster ID with `dev-server-`
- #1089 fix: tls is not added for profiles without tls
- #1099 Clarify activity pause timeout behavior
- #941 auto-generate deprecation warnings from YAML config

**Tests**
- #1005 Fix flakey test by disabling EC2 metadata lookup
- #1020 Remove `time.Sleep()` in commands.taskqueue_test.go

**CI / tooling**
- #1015 pin alpine docker image to 3.23.4
- #1024 remediate missing-dependency-cooldown
- #1034 Bump actions/upload-artifact from 4 to 7
- #1044 improve dependabot config
- #1045 add PR template
- #1054 pin and bump GitHub Actions to latest versions
- #1057 use allow instead of ignore for dependency-type in dependabot
config
- #1080 Bump the github-actions group with 2 updates

## Excluded (rely on the new server/SDK version)
#1017 (server bump v1.31.0 -> v1.32.0-157.0), #1046, #1087, #1001,
#1091, #1084

## Verification
- `go build ./...` passes
- all test packages compile
- `make gen` reports no codegen drift
- server/sdk/api pins unchanged from `release/1.8.x`



## CI endpoint fix (added)
Also backports the API-key CI test endpoint change from #1087
(`us-east-1` -> `ca-central-1`) as a standalone CI-only commit. This
resolves the `Request unauthorized` failure in the "Test cloud API key"
steps on `release/1.8.x`. The rest of #1087 (Nexus Operation command
code) is excluded as it depends on the new server version.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Co-authored-by: Kevin Woo <3469532+kevinawoo@users.noreply.github.com>
Co-authored-by: Rodrigo Zhou <rodrigo.zhou@temporal.io>
Co-authored-by: Stephan Behnke <stephanos@users.noreply.github.com>
Co-authored-by: Jiechen Zhong <jiechen.zhong@temporal.io>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Kent Gruber <kent.gruber@temporal.io>
Co-authored-by: picatz <14850816+picatz@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: John Votta <jpvotta@gmail.com>
Co-authored-by: Nasit  Sarwar Sony <nasitsony96@gmail.com>
Co-authored-by: hussam-salah <156124396+hussam-salah@users.noreply.github.com>
Co-authored-by: Sai Asish Y <say.apm35@gmail.com>
Co-authored-by: Bitalizer <23104115+bitalizer@users.noreply.github.com>
Co-authored-by: Sean Kane <spkane31@gmail.com>
Co-authored-by: Jessica Laughlin <JLDLaughlin@users.noreply.github.com>
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.

6 participants