{"record":{"id":"9f95cdc9dd872a3b","repo":"conductor-oss/conductor","slug":"error-resetting-workflow-state","errorCode":null,"errorMessage":"Error resetting workflow state: {}","messagePattern":"Error resetting workflow state: (.+?)","errorType":"exception","errorClass":"TransientException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/netflix/conductor/core/dal/ExecutionDAOFacade.java","lineNumber":487,"sourceCode":"    }\n\n    /**\n     * Reset the workflow state by removing from the {@link ExecutionDAO} and removing this workflow\n     * from the {@link IndexDAO}.\n     *\n     * @param workflowId the workflow id to be reset\n     */\n    public void resetWorkflow(String workflowId) {\n        getWorkflowModelFromDataStore(workflowId, true);\n        executionDAO.removeWorkflow(workflowId);\n        try {\n            if (properties.isAsyncIndexingEnabled()) {\n                indexDAO.asyncRemoveWorkflow(workflowId);\n            } else {\n                indexDAO.removeWorkflow(workflowId);\n            }\n        } catch (Exception e) {\n            throw new TransientException(\"Error resetting workflow state: \" + workflowId, e);\n        }\n    }\n\n    public List<TaskModel> createTasks(List<TaskModel> tasks) {\n        tasks.forEach(this::externalizeTaskData);\n        return executionDAO.createTasks(tasks);\n    }\n\n    public List<Task> getTasksForWorkflow(String workflowId) {\n        return getTaskModelsForWorkflow(workflowId).stream()\n                .map(TaskModel::toTask)\n                .collect(Collectors.toList());\n    }\n\n    public List<TaskModel> getTaskModelsForWorkflow(String workflowId) {\n        return executionDAO.getTasksForWorkflow(workflowId);\n    }\n","sourceCodeStart":469,"sourceCodeEnd":505,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/core/src/main/java/com/netflix/conductor/core/dal/ExecutionDAOFacade.java#L469-L505","documentation":"Thrown by resetWorkflow when the indexDAO.asyncRemoveWorkflow / removeWorkflow call inside its try block raises any Exception. resetWorkflow first verifies the workflow exists (getWorkflowModelFromDataStore) and removes it from the ExecutionDAO, then attempts to clear it from the index; an index failure at that step aborts with this TransientException.","triggerScenarios":"Calling resetWorkflow(workflowId) when the ExecutionDAO removal succeeded but the subsequent index removal threw. Note the DAO record is already gone at this point, so the index is left with a dangling entry.","commonSituations":"Index (Elasticsearch) unavailable during a reset/restart workflow operation. A 'restart workflow' API call that resets state and then re-runs. Index overloaded or rejecting deletes.","solutions":["Check the wrapped exception — typically an index connectivity/timeout issue.","Because the DAO record was already removed, manually remove the orphaned index document for that workflowId if consistency matters.","Retry the reset once the index is healthy; or run a separate index-cleanup.","Ensure the indexDAO backend has capacity for the delete load."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    executionDAOFacade.resetWorkflow(workflowId);\n} catch (TransientException e) {\n    // DAO record already removed; index may be orphaned -> retry/cleanup index\n}","preventionTips":["After a resetWorkflow TransientException, plan to reconcile the index separately (DAO is already clean).","Ensure the indexDAO backend is healthy before batch resets.","Wrap reset operations in a retry-with-backoff that tolerates partial completion."],"tags":["workflow","index-dao","reset","transient","removal"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}