Why Temporal workflow executions fail and how to diagnose them
When a Temporal workflow is failed, timed out or sitting idle, the first job is to establish what the execution actually recorded before anyone changes code, retries or resets it. Temporal keeps an event history for each workflow execution, and that history is the record of every decision the workflow made: when it started, which activities were scheduled, which attempts failed, which timers fired and how the execution ended. Diagnosis starts by reading that record in the Web UI or with the CLI, not by guessing from application logs, because the history shows the order of events that the workflow code actually saw.
Keep two states apart. A failed execution is a workflow run that has reached a terminal state, such as Failed, Timed Out, Terminated or Canceled. A failed activity attempt is different: an activity can fail, and Temporal can schedule another attempt under the activity's retry policy while the workflow stays Running. Many incidents that look like failed workflows are really activities still retrying against a broken dependency, so the question to answer first is whether the workflow has closed or is merely waiting. The failure type recorded on the terminal event, and the retry policy configured on the activity, tell you which of these you are looking at.
Bring in outside help when the history does not explain the state, when many executions fail together, or when the fix would change workflow code that is already running in production. Those cases carry risks of their own, such as non-determinism errors on replay or resets that repeat side effects, so the team should agree who owns the decision between retry, reset and repair before an incident starts. Confirm with your own Temporal version and deployment which history and visibility tools you have available, since visibility depends on the store you configured, as described in the Temporal visibility documentation.
Reading failure types, timeouts and stuck states
A failed or stuck Temporal execution usually leaves a clear trail in its event history, but the trail points to a different cause depending on which layer failed. The six categories below separate workflow code errors, activity failures, workflow task failures, timeouts and waits, so you check the right thing first.
Workflow failure from an unhandled error
The workflow function itself threw an error that nothing in the workflow code caught. The history ends with a WorkflowExecutionFailed event that carries the failure type and stack trace from the workflow code. Your first check is that event's failure message and type: if it names a business error, the fix is usually in workflow logic or input validation, not in the worker infrastructure. Confirm whether the failure was expected by your design or is a bug before deciding to reset or repair.
Activity failure after retries are exhausted
An activity failed, Temporal retried it according to its retry policy, and the retries ran out. The history shows ActivityTaskFailed events with attempt-level details, and the workflow then receives the error as an ActivityError in its code. Check the last failure's type and whether your retry policy marks that type as non-retryable. A non-retryable error that should have been retried, or a retryable error that will never succeed, are both common causes.
Workflow task failure from non-determinism
A WorkflowTaskFailed event means the workflow code could not be replayed against its recorded history, or it threw while processing a task. Non-determinism, such as a changed command order after a code deploy, is the most frequent cause. Unlike a workflow failure, the execution keeps retrying the task and does not close, so it looks stuck. Read the failure cause on the event, find the code change that introduced the difference, and choose between patching, versioning and reset before redeploying.
Timeouts at workflow and activity level
Temporal records timeouts as distinct events, and each points to a different setting. A workflow run timeout closes the run, an activity start-to-close timeout fails a single attempt, a schedule-to-close timeout bounds the whole activity including queue time, and a heartbeat timeout fires when a long activity stops reporting progress. Identify which timeout event appears in history, then compare its configured value with the actual duration of that step in your workers and dependencies.
Pending activities that keep retrying
An activity can remain pending for a long time while Temporal retries it with no terminal failure. The pending activity entry shows the attempt count, the last failure and the next scheduled attempt. Repeated retries against a downstream outage are expected behavior, not a Temporal fault. Check the last failure message, confirm whether a dependency is down, and decide whether to pause the activity or let the retry policy run until the dependency recovers.
Executions waiting on a signal or timer
Some executions are healthy but idle, waiting on an external signal, a timer or a child workflow. The history ends with a timer started or a signal wait with no matching completion. Before treating it as stuck, confirm the expected signal sender is still running, the signal name and workflow ID match what the sender uses, and the timer duration is what you intended. Only after those checks should you signal, cancel or terminate the execution.
Retry, reset or repair: choosing the fix
When an activity fails because a dependency was briefly unavailable, timed out or rate limited, the workflow usually does not need a code change or a manual repair. The activity retry policy and, if the cause was on a worker, a worker restart are normally enough. Temporal retries activities according to the retry policy configured on the activity, so the first question is whether the failure type is retryable and whether the policy has a sensible maximum attempts and backoff for the dependency.
- Confirm the failure is retryable: Check the failure type on the last attempt. Errors you mark as non-retryable stop the activity immediately, which is correct for validation errors and wrong for a flaky API.
- Check the attempt count and backoff: A policy with unlimited attempts can keep a workflow running for a long time against a dependency that will not recover, so set a maximum that matches your business tolerance.
- Restart workers only when they are the cause: A worker that lost its connection or ran out of memory can be restarted, and Temporal reschedules the pending activities. Restarting does not fix a bad activity implementation.
- Watch for retries that amplify the outage: Aggressive retries against a struggling service add load. Pair retries with backoff or pause the activity during a known incident.
- Avoid retrying non-idempotent side effects blindly: A payment call retried after an ambiguous timeout may charge twice, so make the activity idempotent before relying on retries.
Before accepting a retry as the fix, confirm in the event history that later attempts succeeded and that the workflow continued past the failing step.
When the workflow logic itself is wrong, retries will keep failing the same way. The usual tool is a reset, which starts a new run from an earlier point in the event history using the corrected code. The reset point matters: resetting too late keeps the bad decision, and resetting too early repeats side effects that already happened. Resets change how the workflow runs from that point, so they belong to a deliberate, tested change rather than a quick workaround.
- Fix and deploy the code first: A reset replays history against the workers that are running, so the corrected code must be live before you reset.
- Choose the reset point by side effects: Activities that already completed are not re-executed when history replays, so an earlier point repeats only the work after it. Check which activities ran before the bad step.
- Consider patching for in-flight runs: If other executions are healthy and only some are affected, a versioning or patch approach may avoid resets altogether. Confirm the approach with the workflow owners.
- Plan batch resets carefully: Resetting many executions at once multiplies the effect of any mistake, so test on a sample first.
- Expect longer recovery for long histories: Replay cost grows with history length, so resets on long-running workflows take more worker capacity.
For the step-by-step reset procedure and reset point selection, use the sibling runbook on resetting Temporal workflows rather than repeating those steps here.
Some failures leave a workflow in a state that is valid to Temporal but wrong for the business, such as an order that should have been cancelled, a saga halfway through a multi-step change, or a record that was updated with bad input. A retry will not correct the data and a reset may replay the same wrong decision. Repair here means changing state through a defined path: sending a signal the workflow handles, running compensation logic, or ending the execution. Each option leaves a different record and needs a different sign-off.
- Send a signal when the workflow can recover: If the workflow code has a handler for the correction, a signal is the least disruptive way to change its state.
- Use compensation for multi-step effects: Compensating activities reverse completed steps and produce their own history, which auditors can follow.
- Terminate only when cleanup is not needed: Termination stops the execution immediately without running cleanup code, so it suits runs with no external side effects that need reversing.
- Choose cancel or terminate deliberately: The sibling runbook on cancelling versus terminating explains what each records in history.
- Record the decision: Note who approved the repair, the execution IDs, and the expected external state so the change can be reviewed later.
Before acting, confirm which external systems the workflow has already changed and whether those changes can be reversed, because that determines whether a compensation path exists.
How to triage a failed execution step by step
This sequence takes an operator from a failed, timed out or stuck workflow to a documented decision about retry, reset or repair, with a check that closes each step.
Identify the execution ID and status
The on-call engineer records the workflow ID, run ID, namespace, task queue and current status from the alert, the Web UI or the CLI describe command. Confirm that you are looking at the correct namespace and that the run is the latest run for that workflow ID, since a workflow ID can have several runs over time. The step is complete when the workflow ID, run ID and status are written into the incident ticket and someone else on the team can reproduce the lookup from those values alone.
Open the event history from the last event backward
Open the full event history and start at the final event, then move backward until you find the first event that carries an error, timeout or unexpected state. Note the event IDs, event types and timestamps for each step you read. Confirm that you have identified the earliest failing event in the chain, not just the last symptom, because the final event often reports a consequence such as a cancelled or terminated run rather than the cause.
Classify the failure type
Read the failure object attached to the failed event and sort it into its category, such as an application error raised by workflow or activity code, a timeout, a cancellation, a termination, or a workflow task failure. Workflow task failures usually point to code or versioning problems inside the workflow, while activity failures point to the work the activity performs. The step is complete when you can state in one sentence which layer failed and which event proves it.
Check retry and timeout settings against the activity
Pull the retry policy and timeout values set on the failing activity or child workflow, then compare them with what the activity actually does. Ask whether the operation is idempotent, how long a normal call takes under load, and whether non-retryable error types are listed for errors that will never succeed on retry. The step is complete when you have written down each configured timeout and retry value next to the observed duration and attempt count, and you can say whether the settings match the work.
Confirm worker health on the task queue
Check that workers are polling the task queue named in the execution, that the worker build version matches what the workflow expects, and that no worker is stuck or out of capacity. Review worker logs for the same time window as the failing events and confirm whether the failure is in your code or in the worker process itself. The step is complete when you have a dated statement that workers were healthy or a specific worker fault is recorded with its logs attached.
Decide between retry, reset and repair
Choose the recovery path using the evidence gathered so far. Retry suits transient failures in an activity that is safe to repeat. Reset suits a workflow whose code was fixed and can resume from an earlier event. Repair, such as signalling new input, terminating and restarting, or compensating external changes, suits data or business errors. Confirm the choice with the service owner and record the event ID you will use as the reset point or the reason no reset applies. The step is complete when the decision, the evidence and the approver are written in the incident record.
Verify the outcome and record the root cause
After the chosen action, watch the execution until it reaches a terminal state or progresses past the failing event, and confirm that no new failure of the same type appears on other executions with the same workflow type. Record the root cause, the fix, and any follow-up such as a retry policy change or a versioning change. The step is complete when the execution status is confirmed in the history, the follow-up items have owners, and the runbook entry for this failure type is updated.
Decision path from failed execution to fix
The path starts at a workflow reported as failed, timed out or stuck, then reads the event history to see where the failure sits. A failure in an activity, a workflow task, a timeout or a waiting state each leads to a different check. Most paths end at retry, reset, repair or escalation, so confirm the failure source before choosing a fix. Repeated retries that change nothing usually point to a code or configuration problem rather than a transient one.
Triage branches by where the event history shows the failure.
Which retry, timeout and recovery options fit each case
This table compares the activity retry fields, the timeout types, the workflow run timeout and the reset, signal, cancel and terminate actions. Read each row for when the option fits a failed or stuck execution and the trade-off to weigh before you use it.
| Option | When it fits | Main trade-off |
|---|---|---|
| Activity retry policy | Transient failures in a called service, such as a brief network drop or a rate limit that clears on its own | A long or unbounded retry policy can hide a stuck dependency, so the workflow looks healthy while work piles up |
| Non-retryable error types | Failures that will never succeed on retry, such as invalid input or a missing record | Marking an error type as non-retryable too broadly stops retries that would have recovered the work |
| Schedule-to-start timeout | Detecting that no worker has picked up an activity, which often points to a missing or overloaded task queue | Set too tight, it fails activities during brief worker restarts or scaling events |
| Start-to-close timeout | Bounding how long one attempt of an activity may run before Temporal retries or fails it | Set too short for slow but valid calls, it produces repeated retries of work that was still progressing |
| Heartbeat timeout | Long-running activities that must prove they are still alive between attempts | Heartbeats add code to the activity, and a missing heartbeat can cause retries of work that is still running |
| Workflow run timeout | Capping the total time a workflow run may take, so a stuck run is reported as timed out | A timed-out run is not repaired in place, so you may still need reset or a new run to finish the business process |
| Reset | A bug in workflow or activity code is fixed and the execution should replay from an earlier point in its history | Resetting re-executes events after the reset point, so side effects in that span may run again if they are not idempotent |
| Signal | Sending new input or a decision into a running workflow, such as an approval or a manual override | The workflow code must handle the signal, so a signal sent to code that does not expect it can be ignored or cause errors |
| Cancel | Asking a running workflow to stop cleanly so its code can run cleanup and compensation | Cancellation depends on the workflow code responding, so a blocked or misbehaving workflow may not stop promptly |
| Terminate | A run that cannot progress and must stop now, for example a poisoned execution that resets and retries do not fix | Terminate stops the run immediately and skips compensation, so downstream systems may need manual reconciliation |
Setting up visibility and access for diagnosis
This sequence prepares a self-hosted Temporal Service so operators can find failed executions, open their event histories and read them safely. It ends with a known failed test execution that appears in search and whose history loads in the Web UI and CLI.
Confirm frontend reachability from operator machines
The platform team checks that the Web UI host and the operator workstations or bastion hosts can reach the Temporal frontend service on its configured gRPC endpoint. Run a simple namespace describe command with the Temporal CLI against the frontend address and confirm it returns the namespace metadata. Also confirm the Web UI loads and lists the namespaces. Temporal services should run on hosts that are not reachable from the public internet, so this check usually happens from inside your trusted network. Record the frontend address and the CLI profile you agreed to use, so every operator connects the same way.
Choose advanced visibility for the cluster
The platform team decides which advanced visibility store backs failed-execution search. Temporal's visibility documentation recommends Elasticsearch or OpenSearch for anything beyond a few workflow executions, and the supported versions are listed in the visibility documentation for each server release. Confirm the versions you plan to run against the release notes for your Temporal Server version before installing anything. Basic visibility is not enough for filtering by status, workflow type or failure time across a busy namespace. Done means the visibility store is deployed, the server is configured to use it, and the decision is written down with its owner and upgrade path.
Configure the visibility connection and index
The platform team points the Temporal Server visibility settings at the chosen Elasticsearch or OpenSearch cluster and creates the visibility index using the schema setup the Temporal documentation provides for that version. Confirm the index exists and the server logs show a successful connection with no repeated indexing errors. Restart or roll the frontend and history services only as your deployment method requires. Done means a test workflow started in the namespace shows up in the visibility store within the time you expect, which you confirm in the next step rather than assuming from the configuration alone.
Grant operators read access to the right namespace
The security or platform owner assigns each diagnosing operator read-level access to the production or staging namespace they support, and no broader role. If the Authorizer and ClaimMapper are configured, map operator identities or certificate claims to the namespace read role. If no Authorizer is configured, Temporal uses a noop authorizer that allows every API request, so treat this step as a blocker for any shared environment. Confirm that an operator account can list and describe executions in the namespace and is refused when attempting a write action such as termination. Record the role mapping in your access register so audits can trace who can read workflow inputs and results.
Enable OIDC sign-in for the Web UI
The identity team connects the Web UI to your single sign-on provider using OIDC, so operators sign in with their corporate identity and access follows the roles from the previous step. Test sign-in with two accounts, one with read access and one without, and confirm the second account cannot reach the namespace views. Check that sessions expire according to your policy and that operator sign-outs are logged in your identity provider. Done means both test accounts behave as expected and the Web UI is no longer reachable through shared or default credentials.
Start a known failing test execution
The platform engineer starts a small test workflow in a non-production namespace whose activity is written to fail on purpose, with a distinct workflow ID such as a clearly labeled diagnostic prefix. Let its retries exhaust so the execution ends in a failed state. Record the workflow ID, run ID, namespace and the time it failed. This illustrative test gives you a known object to search for, so you are not relying on a live production failure to validate visibility. Store the test workflow definition in version control so it can be rerun after upgrades.
Verify the failed execution appears in search
An operator uses the Web UI search or the CLI list command with a visibility query that filters on the failed status and the test workflow ID or type. Confirm the test execution appears in the results within a reasonable time after it failed and that the displayed status, workflow type and close time match what you recorded. If it does not appear, check the visibility store health and indexing logs before proceeding. Done means the query returns the known execution and the filter works for status, which you will rely on for every later diagnosis.
Confirm the event history loads for that execution
From the search result, the operator opens the test execution and confirms the event history loads in the Web UI and returns through the CLI show command for the same workflow ID and run ID. Check that the history includes the workflow started event, the activity scheduled and failed events, and the final failure event with its failure type and message. Confirm the operator account can read the history but cannot terminate or reset the execution. Done means the history is readable end to end by the intended operators, and you have a documented baseline to compare future failures against.
Access, data exposure and operational safeguards
Diagnosing a failed execution means reading its event history, which can expose business data to anyone who can reach the API. The cards below cover the access, encryption and network controls that decide who can read that history and who can change running workflows. Set these up before the first incident, not during it.
Set an Authorizer before operators connect
If no Authorizer is configured, self-hosted Temporal uses the default noopAuthorizer, which allows every API request with no authentication or access control. Anyone who can reach the frontend could read histories, signal, reset or terminate workflows. Before giving operators access, configure an Authorizer and a ClaimMapper so JWT or certificate claims map to namespace roles, and confirm that read-only and administrative roles are separated.
Security docsMap operator roles to namespaces
A ClaimMapper translates identity claims into roles scoped to a namespace. Decide which people need read access to histories in each namespace, which need signal or cancel rights, and which may reset or terminate. Keep production and development namespaces separate so a troubleshooting role in one environment does not grant access in another. Review the mapping whenever team membership changes.
Treat event history as sensitive data
Event history records workflow inputs, activity arguments and results, and failure details. Those payloads often contain personal, financial or health data, and the Web UI and CLI display them to anyone with read access. Before granting broad read access, inspect a sample history from a staging workflow and list which fields would be visible. Agree with your data owners what operators may see.
Plan payload encryption and the codec server
Custom payload codecs encrypt payloads before they reach the server, and a codec server lets authorized users decode them in the Web UI and CLI. Operators who cannot reach the codec server will see encrypted blobs, which slows diagnosis but limits exposure. Decide who may call the codec server, where its keys live, and how key rotation affects histories that are still open. Test a failed execution end to end with the codec in place.
Security docsKeep frontend services off the public internet
Temporal services should run on hosts that are not reachable from the public internet, with network access restricted to trusted internal networks. Confirm that the frontend, the Web UI and any admin tools are only exposed on internal paths, and that operators reach them through VPN, a bastion or an internal load balancer. Use mTLS between services, with separate settings for internode and frontend traffic, so an exposed endpoint cannot be used to call the API anonymously.
Deployment docsAudit every reset and terminate
Resets rewrite where a workflow resumes, and terminations stop it without running cleanup code. Both can cause data loss or duplicate side effects, and both are hard to undo. Record who ran each action, the namespace, the workflow ID, the reason and the ticket reference, and retain those records with your other operational logs. Require a second person to approve batch resets or terminations before they run.
Common questions about diagnosing Temporal workflow failures
How much does outside help cost for diagnosing failed Temporal workflows?
Cost depends on the written scope, which DeployOpen agrees in writing before work starts, and DeployOpen does not publish a price list. The main drivers are the number of workflow types in play, how much event history the team can export, how sensitive the payloads are, and whether your team already runs Temporal in production. A team that already operates Temporal and has clear runbooks typically needs less time to explain its own system. Ask for a quote that lists the workflow types in scope, the namespaces and environments covered, the history sources, the handling rules for sensitive data, and whether a retest is included. Diagnosis is usually a one-time piece of work, while any follow-on monitoring or retainer support recurs.
How long does triage of a failed Temporal workflow usually take?
Triage time is set mostly by how quickly the team can reach the right event history and by how many distinct failure causes are present. A single failure type in one workflow type, with a clear history and a reproducible test environment, is quicker to work through than a batch of timeouts across several task queues. Delays usually come from missing access, from payloads that must be decoded before they can be read, and from unclear ownership of the code that changed. Ask any provider to state which steps depend on your access and which depend on their own analysis, and to separate the initial diagnosis from the fix and the verification.
What does the team need to provide for a Temporal failure investigation?
The investigation needs a defined set of access and people before work begins. Typical requirements include:
- Read access to the affected namespace, including workflow history and visibility queries, with an account that can be audited
- Exported event histories for representative failed, timed out or stuck executions, with any sensitive payloads handled under agreed rules
- A test environment that runs the same worker code and Temporal Server version as production, so fixes can be replayed safely
- Recent deployment records and the source of the worker version involved in each failure
- Named on-call contacts who can approve changes, pause work and confirm when a fix is live
Confirm with your platform team which of these already exist, because missing access is the most common reason triage stalls.
Can an internal team diagnose Temporal workflow failures without a partner?
Yes, an internal team can diagnose most workflow failures if it has engineers who understand Temporal's event history, failure types and retry policies, and if it can replay code against history in a test environment. The skills that matter most are reading WorkflowTaskFailed and ActivityTaskFailed events, separating a bug in workflow code from a bad activity or downstream outage, and choosing between a retry, a reset and a repair. A partner adds value when the team lacks that experience, when a backlog of failures is building up, or when an independent review is needed for a regulated system. Compare the cost of training and ongoing ownership with the cost of a scoped engagement before deciding.
How does a Temporal Cloud support plan change the response path for workflow failures?
A support plan changes how fast the vendor responds to a critical incident, not how the workflow is diagnosed. On Temporal's pricing page, the Business add-on starts at 500 US dollars per month and provides a 2-hour P0 response during business hours. Enterprise and Mission Critical are quoted by sales and offer 30-minute or 15-minute P0 response around the clock, with SCIM included. Check whether the plan covers the hours when your workflows run, whether your own on-call process can act on the response, and whether it fits a service level you have committed to internally. Your own runbook still decides which execution to reset, repair or terminate.
Should a team retry, reset or repair a failed Temporal workflow?
Retry suits transient failures such as a brief downstream outage, where the activity itself is correct and will succeed on another attempt. Reset suits a workflow that was broken by a code bug that is now fixed, because it resumes from an earlier point in history with the corrected code. Repair covers cases where the history itself needs a targeted fix or the workflow must be completed or compensated by hand. Choose only after identifying the root cause in the event history, and record who approved the choice. Reset and repair both change what happens to running business processes, so test the chosen path in a non-production namespace first.
Does diagnosing Temporal failures expose sensitive workflow data?
It can, because event history stores workflow inputs, activity results and failure details, and those may contain personal, financial or health data. Temporal's self-hosted security documentation describes payload encryption through custom codecs and a codec server, and an investigation should work within those controls rather than around them. Agree before work starts how exported histories are stored, who can decode payloads, how long copies are kept and where they are deleted. Without a Authorizer and a ClaimMapper, a self-hosted service can allow unrestricted API access, so confirm that access control is in place before anyone exports history.
How DeployOpen scopes Temporal failure investigations
DeployOpen is a Chainscore Labs company that plans, implements and supports self-hosted open-source platforms inside the client's own infrastructure, including cloud accounts, data centers and air-gapped networks. For a Temporal failure investigation, that means the work happens against your Temporal Service, your persistence and visibility stores and your worker fleet, and the evidence stays in your environment. Most engagements are fixed-scope, so the scope, deliverables and timelines are agreed in writing before any investigation starts. Useful scope inputs include which namespaces and workflow types are affected, which Temporal Server and SDK versions are running, whether event history can be exported, and whether the business needs a diagnosis, a fix, or both.
A written scope should state what the investigation will and will not touch. Ask whether the work includes reading event histories and failure causes, reviewing activity retry and timeout settings, checking worker logs and deployment records, and recommending a retry, reset or repair path for each affected execution. Ask whether production changes are in scope or whether DeployOpen delivers a runbook for your team to execute. Confirm how access is granted to the Web UI, the CLI and the database, and whether the investigation uses non-production replicas first. Quotes follow from this written scope, so the more precisely the affected population and access model are defined, the more accurately the quote reflects the work.
Ongoing support is available as a retainer for teams that expect recurring incidents, upgrades or continuous review of their Temporal operations. A retainer covers the periods between incidents, such as reviewing new failure patterns after a release or retesting fixes, and it is priced from its own written scope. DeployOpen does not publish a price list and does not claim certifications, partner status or specific outcomes for any client. Before you engage any implementation partner, ask for a sample written scope, confirm which people will perform the work, and confirm how handover documentation is delivered so that your own team can run the next investigation without an outside party.

