Resetting Temporal workflows

Temporal workflow reset resumes a stuck or failed workflow from an earlier point in its history after a code fix. This page covers choosing the reset point, resetting many workflows safely and planning the work.

On this page

Resetting Temporal workflows after a bug fix: when it is the right tool

Reset is the right tool when workflows failed or stalled because of a bug in workflow code, the code is now fixed, and the work already completed in each workflow should be kept. A reset moves a workflow back to an earlier point in its event history, and the workflow then continues from that point using the corrected code. Restarting from the beginning repeats completed work, and terminating stops the workflow for good, so neither fits a workflow that only needs its remaining steps to run again. Teams usually reach for reset after a deterministic failure, where the same workflow task fails on every retry, or after a workflow took a wrong branch that retrying an activity cannot undo. Confirm the reset behavior for running and closed workflows and the available reset point options in the Temporal docs for your server version before you rely on them.

Reset sits between three other responses. Retries come first: activity retry policies handle transient failures such as a dropped network connection without human action, so a workflow that is already recovering on its own does not need a reset. Reset is for failures that retries cannot clear, such as a workflow task that fails the same way each time because of a code defect. Cancellation suits work that must run cleanup, and termination suits work that should never continue. Repair, meaning changing data or sending a signal to steer the workflow, fits when the bad state lives in data and the code path is sound. Before choosing reset, check that the fixed code is deployed to every worker polling the task queue, because a reset replays history on any worker still running the old code, and that worker will fail again.

Reset point options and when each fits

This table compares the reset points Temporal offers, the first workflow task, the last completed workflow task and a specific event ID, and the reset types the CLI exposes. Read each row against the kind of bug you are fixing, since workflow code defects and activity logic defects call for different points and different checks afterward.

Reset pointTypical fitMain riskWhat the team must verify
First workflow taskWorkflow code bug that affected decisions from the start, such as a wrong branch taken early in the runRe-runs all history, so side effects in activities may repeat unless they are idempotentActivities are idempotent or guarded, and the corrected code replays the full history cleanly
Last completed workflow taskWorkflow code bug that surfaced late, after earlier decisions were correctEarlier wrong decisions remain in history if the bug started before this pointThe bad decision was made after this point, and the next commands match what the corrected code expects
Specific event IDPrecise recovery when you have traced the bad decision to one event in the historyChoosing an event that is not a workflow task boundary can fail or skip workThe chosen event is a valid reset point, and the workflow resumes at the intended step
Activity logic bug, activity retried or failedBug inside an activity where the workflow state is correct and only the external work needs redoingOften a reset is unnecessary, since fixing the activity and letting retries run may be enoughThe activity result is correct on retry, and no completed side effects need compensating
Reset type: single workflowOne affected execution, or a canary run before any batchOperator error on a single run is still possible, so record the run ID and reasonThe resumed run completes, and the original run ID and reset event are recorded for audit
Reset type: batchMany executions hit the same workflow code defect, selected by a visibility queryA wrong query or reset point multiplies the damage across every matched runThe query matches only intended runs, a sample run is verified first, and batch progress is tracked to completion

How to plan and run a reset safely

This sequence takes a reset from a suspected bug fix to a verified batch, so each stage proves the fix works before the next one widens the blast radius. The output is a documented reset plan with a known set of affected workflows and a sample run you have checked.

  1. Confirm the fix is deployed and deterministic

    The engineering owner confirms the corrected workflow code is deployed to every worker build that will pick up the reset workflows, and that the fix passes replay tests against the real event histories of the failing executions, not only unit tests. Replay tests load a copy of the history and re-run the workflow code to confirm it produces the same commands. Done when the replay run for each representative history completes without non-determinism errors and the owner records which worker build version was tested. Also confirm which task queues and workers serve the affected workflow type, since a reset sends work back to whatever workers are running.

  2. Identify affected workflow IDs with a visibility query

    The operator runs a visibility query against the affected workflow type, status and time window to produce the list of workflow IDs that need the reset. Visibility queries depend on the advanced visibility store, so confirm your deployment's visibility backend supports the search attributes you filter on before relying on the results. Save the list and its query text with the change record. Done when the count from the query matches a second query built with different filters, and the operator has checked a few IDs by hand in the Web UI or CLI.

  3. Pick the reset point for each workflow

    For each affected workflow, the engineer reviews its event history and chooses the reset point, which is usually the last workflow task completed before the non-deterministic or buggy logic ran. Group workflows that share the same failure shape, because one reset point rule can cover many IDs. Record the chosen event ID per group and note any workflow whose history does not fit the rule, since those need individual handling. Done when every ID on the list has either a reset point or a documented reason it will be excluded or handled separately.

  4. Dry-run the reset on one workflow

    The operator resets a single workflow in a non-production namespace first, using the chosen reset point and the same worker build that will run in production. Watch the workflow until it moves forward past the point of failure, and check that activities already completed are not run again unless your design expects that. Done when the workflow reaches the state the owner expected, the history shows the reset event with the reset type and point recorded, and no new failures appear in the worker logs.

  5. Reset a sample in production

    After the dry run passes, the operator resets a small, reviewed sample of production workflows chosen from different reset point groups, with the change owner watching. Keep the sample deliberately small so a wrong reset point affects few executions. Monitor failure counts, activity retries and worker errors for the sample during the window the team has agreed. Done when every sampled workflow completes or continues as expected and the team signs off on the results in the change record.

  6. Scale the reset to the full batch

    Once the sample is signed off, the operator runs the remaining resets in batches, using the reset point groups from the plan and the same query-based list. Batch jobs report progress, so track the job until it finishes and compare the number of completed resets with the list from the earlier visibility query. Pause and investigate if the failure rate rises above what the sample showed. Done when the batch job reports completion, the counts reconcile, and any exceptions are listed with an owner for each.

  7. Verify outcomes and record the reset

    The operator checks that each reset workflow has reached a healthy state or a documented end state, and that no workflow is stuck waiting on work that was never sent back. Confirm whether any downstream systems received duplicate effects from re-run activities, and log those for follow-up. Store the query, reset points, batch results and exceptions with the change record so the reset can be audited later. Done when every affected workflow has a recorded outcome and the team has closed out the exception list.

Risks that make a reset unsafe

A reset re-runs part of a workflow's history on new code, so the same change that fixed one execution can damage others. The risks below connect because each one comes from replaying history against code that has changed, or from applying that change to more executions than intended.

Non-determinism still present

A reset only helps if the new code replays the retained history without a mismatch. If the fix leaves another change in the workflow code that alters command order or types, the reset will fail again with a non-determinism error. Before resetting, replay the affected histories against the candidate build in a test environment and confirm that every reset point replays cleanly.

Temporal deployment docs

Activities that run again

Resetting replays activities from the reset point, so any activity after that point runs again. An activity that already charged a card, sent an email or wrote a record will repeat that side effect unless it is idempotent. List the activities between the reset point and the failure, and confirm each one either checks for prior completion or is safe to repeat.

Reset points the new code cannot replay

Choosing a reset point that the new code path cannot reach can leave the workflow stuck in a state no version of the code understands. This often happens when a reset point sits before a versioning or patching marker that the fix depends on. Confirm the chosen event leads to a state the patched code expects, and keep the old and new versions deployed until the reset workflows finish.

Batch jobs that reach too far

A visibility query that matches more executions than intended will reset workflows that never had the bug, including completed or unrelated ones. Test the query first and count the matches, and check that the filter includes workflow type, status and time range. Keep the batch small enough that you can stop it and review progress before the next group starts.

Lost signals and updates

Work that arrived after the reset point, such as signals, updates or cancellation requests, may not be applied the way callers expect once history is rewound. Callers that already received success for an update can find its effect gone after the reset. Before resetting, list in-flight signals and updates for each affected execution, and decide whether callers must send them again.

Missing audit trail

A reset changes what the workflow has done, and the reason for that change must be recoverable later. Record who ran the reset, the reason, the bug ticket, the chosen reset point, the build used and the executions affected. Confirm that your visibility store and logging retain these records for as long as your audit policy requires.

Resetting many workflows with batch jobs and visibility queries

A batch reset is only as safe as the visibility query that selects its targets. Temporal selects executions by querying search attributes, so the query should narrow the set to the workflows that actually need the reset. Combine the workflow type with a custom search attribute that your code sets at start, such as a version or release marker, and add a status and time range where they help. Before you run anything, count the matches and pull a sample of workflow IDs to check that each one has the failing history you expect. Confirm which search attributes are registered in your namespace and that your workflow code populates them for every execution in scope. Batch operations themselves are covered on the sibling page on batch operations from the CLI, so this section focuses on choosing and checking the set.

The visibility store determines whether that query stays practical at volume. Temporal's visibility documentation recommends Elasticsearch or OpenSearch for anything beyond a few workflow executions. The documented options include Elasticsearch 7 and 8, and OpenSearch 2 or later from Temporal Server 1.30.1. Cassandra visibility was removed in 1.24, so an older Cassandra-based visibility setup cannot be assumed to support the queries you need. Check the visibility backend and server version before planning a large batch, and run the same query against a realistic copy of the data to see how long it takes. A query that is quick on a small development namespace can behave very differently across millions of executions.

Pace the batch so that replayed workflow tasks do not overwhelm your workers. Start with a small slice, watch the task queue backlog, worker error rates and workflow task failures, then widen the batch only when those signals stay healthy. Track batch progress through the batch job status, and if you see new failures, unexpected non-determinism or a rise in backlog, stop the batch, fix the cause and resume only the remaining executions. After the batch completes, rerun the original visibility query to confirm that no executions still match the pre-reset state. Then sample event histories and confirm that the reset point and the resumed workflows behave as the fix intends. Record the query, the batch ID and the sample results so the change can be audited.

Decision path from a failed workflow to a reset

The path starts with a workflow that has failed or stalled and asks whether the cause is a code bug. If it is, the reader confirms the fix is deployed and replay-safe before choosing a reset point in the event history. A single workflow is reset and verified first, and only then is the same reset applied in batch. If the cause is not a fixable code bug, the path leads to repair or termination instead. Check each hand-off before moving on.

Decision path from a stuck workflow to a verified batch reset.

Security and access controls for reset operations

A workflow reset rewrites execution history, so the people and systems allowed to run one need the same scrutiny as any production change. The cards below cover authorization, audit, credential handling and network exposure, which together decide whether a reset is a controlled fix or an unreviewed change to live work.

Confirm an Authorizer is configured

If no Authorizer is configured, self-hosted Temporal uses the default noopAuthorizer, which allows every API request with no authentication or access control. That includes reset calls, so anyone who can reach the frontend can reset any workflow in any namespace. Before running resets in production, confirm which Authorizer and ClaimMapper your deployment uses, and test with a non-admin identity that a reset is refused.

Security docs

Map reset rights to namespace roles

Temporal's ClaimMapper maps JWT or certificate claims to namespace roles, so reset rights can be tied to the same roles that govern starts, cancels and terminations. Decide which roles may reset workflows in a given namespace, and keep write-capable roles separate from read-only operator access. Review role membership on a schedule, since a reset affects execution history that teams depend on for debugging.

Require a second approver for batch resets

A single reset of one workflow is a routine repair, but a batch reset across many executions can replay work at scale. Treat batch resets as a change that needs a written reason, a visibility query that was reviewed before it ran, and a named approver outside the person running the command. Your change process should record the query text, the reset point and the count of matched executions.

Audit every reset action

Record who ran each reset, against which namespace, workflow ID and run ID, and which event ID was used as the reset point. Pair Temporal's own event history with your API gateway or identity provider logs so that the caller identity is traceable. Ask the platform team to confirm where these logs are retained and who can read them, because the audit trail is what an incident reviewer will need first.

Protect CLI credentials and certificates

Resets are often run from a shell with the Temporal CLI, which means the certificates, tokens or API keys used to authenticate are sitting on a laptop or in a CI variable. Use short-lived credentials issued to named people, keep client keys out of shell history and repository files, and revoke access when someone changes role. Check that a reset run from an operator workstation uses the same identity model as the service.

Keep services off the public internet

The Temporal deployment docs say Temporal services should run on hosts not reachable from the public internet, with network access restricted to trusted internal networks. Reset operations reach the frontend, so an exposed frontend turns a weak authorization setting into an internet-facing risk. Confirm that the frontend, the Web UI and the internode ports are reachable only from approved networks, and that operator access goes through a controlled path such as a bastion or VPN.

Deployment docs

Questions teams ask before resetting Temporal workflows

Can our in-house team reset Temporal workflows without a partner?

Yes, a team that already runs Temporal and understands its event history can do a reset in-house, and many do. The temporal workflow reset command is available to any operator with access to the namespace. The harder questions are whether the team can confirm the reset point is correct, whether the fixed code replays cleanly against existing histories, and whether it can run the batch safely while watching the results. If none of your engineers has reset a workflow in production before, a short review of a dry run with someone who has is a sensible first step. Ask any partner to show how they would verify the reset point before you agree on scope.

What drives the effort and cost of a Temporal reset engagement?

The main drivers are scope, the number of workflows, and the surrounding setup. Scope covers how many workflow types are affected and whether one bug fix or several are involved. Volume matters because a few hundred executions and millions behave very differently in visibility queries and batch progress tracking. The codec setup matters because encrypted payloads need the right codec or codec server available while you inspect histories. Visibility setup matters because batch selection depends on search attributes in your visibility store. Testing matters most, since each reset needs a replay check against the fixed code. Costs are mainly one-time for analysis, dry runs and runbooks, with ongoing cost only if you add retainers. Ask any quote to itemize these components separately.

How long does a Temporal reset take for a large batch of workflows?

Duration depends on the batch size, the risk of each reset, and how long your environment takes to validate changes. Small batches of well-understood workflows can move through analysis, dry run and execution quickly. Large batches or workflows with side effects in activities need more time for selecting executions, checking that reset points are consistent and monitoring progress. Your visibility store also affects pace, since query performance changes with the backend. Your environment's change windows and approval steps add elapsed time that no tool removes. Ask for a timeline that separates analysis, testing, the staged batch run and post-run verification, and state the batch size and risk level it assumes.

What do we need to provide before a Temporal reset engagement starts?

You need to provide access and information that the reset depends on. The list usually includes:

  • A non-production namespace that mirrors production code and workflow types
  • Read access to the Temporal Web UI or CLI and the visibility queries that identify affected executions
  • The fixed workflow code and its version, plus the deployed code history
  • Codec or codec server access if payloads are encrypted
  • Details of activities with external side effects, such as payments or messages
  • A named approver and a change window for production runs

With these in place, the work can focus on the reset point and the verification plan. Confirm each item with your platform and security teams before the kickoff date, especially access to encryption keys.

When should we reset a Temporal workflow instead of terminating or repairing it?

Reset fits when a workflow is correct in intent but failed or took a wrong path because of a bug, and fixing the code lets it continue from an earlier point. Termination stops the workflow immediately and suits work that should no longer run, while cancellation lets workflow code clean up. Repair means changing state or history in another way, which is rarely the right first choice. Reset preserves completed work before the reset point, which matters when activities are expensive or have already run side effects. Choose reset only after confirming that the fixed code replays the history up to that point. If the bug is a non-determinism error from an unpatched change, check the patching and versioning options first.

Does a Temporal reset create compliance or security exposure?

A reset can re-run activities after the reset point, so it can repeat external calls, notifications or data writes. Your controls should make those effects idempotent or confirm that they are safe to repeat. Access to the reset command should be limited to the operators who approve and run batches, and the namespace's authorization settings should reflect that. If your deployment does not configure an Authorizer, Temporal's default noopAuthorizer allows every API request, so confirm access control before running batches in a shared environment. Keep records of who approved each batch, the reset points used and the verification results. Your auditors will decide whether these records meet your requirements.

How do we check a Temporal reset before running it on production?

Verify the reset in a non-production namespace with a copy of representative histories. Confirm that the fixed workflow code replays each history up to the chosen reset point without a non-determinism failure. Check the reset point against the event history of a sample of executions, including ones with retries, timers and child workflows. Then run a staged batch with a small set of executions, review their behavior and only then continue. Track the batch's progress and failure counts, and be ready to pause or stop if activities behave unexpectedly. Document the results so the production run can be repeated or audited later.

Can DeployOpen help us plan and run Temporal resets safely?

DeployOpen plans, implements and supports self-hosted open-source platforms in infrastructure you control, and reset work falls under that operational scope when it is agreed in writing. A typical engagement would define which workflows are affected, prepare the reset points and replay checks, run a dry run in a non-production namespace and support a staged production batch. Most engagements are fixed-scope, so the scope, deliverables and timelines are agreed before work starts. Ask for the written scope and state which parts of the reset your team will run itself.

Official Temporal sources for reset and operations

Before you run a reset, read the Temporal GitHub releases page for the server version you operate. Each release entry lists fixes and behavior changes, and a bug fix that touches replay or history handling may be the reason a reset is needed in the first place. Find your running server version, check whether a newer patch on the same minor line addresses the issue you are working around, and note the exact version in your change record so the reset procedure can be matched to it later. The release page is linked here as the natural first read: Temporal GitHub releases.

Next, read the self-hosted deployment guide to confirm how your environment is built. Reset behavior and the commands around it depend on how your services, persistence and visibility store are set up, so check which deployment method you use (Docker Compose, binaries, Helm or a custom Go build) and which Helm chart version you pin. The Temporal self-hosted deployment guide covers those choices. Confirm them against your own environment rather than assuming a default.

Then read the upgrade documentation, since a reset often follows a server upgrade or a worker deployment that changed workflow code. Check the upgrade order your version requires and whether schema changes must run first. Finally, open the Temporal CLI reference for your exact version and look up the reset and batch reset commands, their flags and how reset points are specified. Command names and options can differ between CLI releases, so test them against a non-production namespace before any production use. The upgrade guide is at Upgrade the Temporal Server.

How DeployOpen scopes, delivers and supports Temporal resets

A one-off incident reset covers a bounded set of workflows that stopped or went wrong after a defect, usually a non-deterministic change or a bad activity result. The work is fixed-scope: the list of namespaces, workflow types, reset points and acceptance checks is agreed in writing before any command runs. Because the work is urgent, the scope is narrow and the decision on each reset point stays with your engineers.

  • Scope agreement: Named namespaces, workflow types, the fix that must be deployed first and the workflows excluded from reset.
  • Assessment: Review of the affected event histories and the code change to confirm which reset point restores correct behavior.
  • Dry run: Reset of a sample of workflows in a non-production namespace, followed by replay of the fixed code against the results.
  • Controlled execution: Reset of the production workflows, with your on-call contact available and a stop condition agreed in advance.
  • Verification: Checks that resumed workflows complete, with a written record of what was reset and what remains.

Before signing, confirm who approves the production run and how a halt is requested during execution.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.