{"record":{"id":"c70cd32412f0c97b","repo":"conductor-oss/conductor","slug":"workflow-s-is-non-restartable","errorCode":null,"errorMessage":"Workflow: %s is non-restartable","messagePattern":"Workflow: (.+?) is non-restartable","errorType":"exception","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java","lineNumber":236,"sourceCode":"                                    () ->\n                                            metadataDAO\n                                                    .getWorkflowDef(\n                                                            workflow.getWorkflowName(),\n                                                            workflow.getWorkflowVersion())\n                                                    .orElseThrow(\n                                                            () ->\n                                                                    new NotFoundException(\n                                                                            \"Unable to find definition for %s\",\n                                                                            workflowId)));\n        }\n\n        if (!workflowDef.isRestartable()\n                && workflow.getStatus()\n                        .equals(\n                                WorkflowModel.Status\n                                        .COMPLETED)) { // Can only restart non-completed workflows\n            // when the configuration is set to false\n            throw new NotFoundException(\"Workflow: %s is non-restartable\", workflow);\n        }\n\n        // Reset the workflow in the primary datastore and remove from indexer; then\n        // re-create it\n        executionDAOFacade.resetWorkflow(workflowId);\n\n        workflow.getTasks().clear();\n        workflow.setReasonForIncompletion(null);\n        workflow.setFailedTaskId(null);\n        workflow.setCreateTime(System.currentTimeMillis());\n        workflow.setEndTime(0);\n        workflow.setLastRetriedTime(0);\n        // Change the status to running\n        workflow.setStatus(WorkflowModel.Status.RUNNING);\n        workflow.setOutput(null);\n        workflow.setExternalOutputPayloadStoragePath(null);\n\n        try {","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java#L218-L254","documentation":"restart checks WorkflowDef.isRestartable(); if it is false AND the workflow status is COMPLETED, the engine throws a NotFoundException with the 'non-restartable' message. The intent is to allow restarting failed/timed-out workflows even when restart is disabled, but to block restarting successfully completed workflows when the definition opts out.","triggerScenarios":"Calling restart on a COMPLETED workflow whose WorkflowDef has restartable=false.","commonSituations":"A workflow definition intentionally marked non-restartable to protect audit trail of successful runs; trying to restart a completed workflow that the owner configured as non-restartable.","solutions":["Set WorkflowDef.restartable=true if completed workflows should be restartable.","If the workflow is in a non-COMPLETED terminal state, restart is allowed even with restartable=false — terminate/fail it first if appropriate.","Treat this as a policy decision, not a bug; confirm with the workflow owner before flipping the flag."],"exampleFix":"// before\n{ \"name\": \"order\", \"restartable\": false }\n\n// after\n{ \"name\": \"order\", \"restartable\": true }","handlingStrategy":"validation","validationCode":"WorkflowDef def = metadataDAO.getWorkflowDef(name, version).orElseThrow();\nWorkflowModel wf = executionDAOFacade.getWorkflowModel(workflowId, true);\nif (!def.isRestartable() && wf.getStatus() == WorkflowModel.Status.COMPLETED) {\n    // restart blocked by policy; either flip the flag or fail it first\n    throw new IllegalStateException(\"workflow is non-restartable by policy\");\n}\nworkflowExecutor.restart(workflowId, useLatestDefinitions);","typeGuard":null,"tryCatchPattern":"try {\n    workflowExecutor.restart(workflowId, useLatestDefinitions);\n} catch (NotFoundException e) {\n    if (e.getMessage().contains(\"non-restartable\")) {\n        // policy decision: flip restartable=true or fail the workflow first\n    }\n}","preventionTips":["Set WorkflowDef.restartable=true if completed runs must be restartable.","Note: non-COMPLETED terminal workflows remain restartable even with restartable=false.","Treat the flag as an audit-trail policy, confirm before changing it."],"tags":["conductor","workflow","lifecycle","restart","not-found","workflow-definition"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}