{"record":{"id":"739589410fafa47d","repo":"conductor-oss/conductor","slug":"error-updating-workflow-definition-s-d","errorCode":null,"errorMessage":"Error updating workflow definition: %s/%d","messagePattern":"Error updating workflow definition: (.+?)/(.+?)","errorType":"exception","errorClass":"TransientException","httpStatus":500,"severity":"error","filePath":"cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraMetadataDAO.java","lineNumber":218,"sourceCode":"            session.execute(\n                    updateWorkflowDefStatement.bind(\n                            workflowDefinition, workflowDef.getName(), workflowDef.getVersion()));\n            String workflowDefIndex =\n                    getWorkflowDefIndexValue(workflowDef.getName(), workflowDef.getVersion());\n            session.execute(\n                    insertWorkflowDefVersionIndexStatement.bind(\n                            workflowDefIndex, workflowDefIndex));\n            recordCassandraDaoRequests(\"updateWorkflowDef\");\n            recordCassandraDaoPayloadSize(\n                    \"updateWorkflowDef\", workflowDefinition.length(), \"n/a\", workflowDef.getName());\n        } catch (DriverException e) {\n            Monitors.error(CLASS_NAME, \"updateWorkflowDef\");\n            String errorMsg =\n                    String.format(\n                            \"Error updating workflow definition: %s/%d\",\n                            workflowDef.getName(), workflowDef.getVersion());\n            LOGGER.error(errorMsg, e);\n            throw new TransientException(errorMsg, e);\n        }\n    }\n\n    @Override\n    public Optional<WorkflowDef> getLatestWorkflowDef(String name) {\n        List<WorkflowDef> workflowDefList = getAllWorkflowDefVersions(name);\n        if (workflowDefList != null && workflowDefList.size() > 0) {\n            workflowDefList.sort(Comparator.comparingInt(WorkflowDef::getVersion));\n            return Optional.of(workflowDefList.get(workflowDefList.size() - 1));\n        }\n        return Optional.empty();\n    }\n\n    @Override\n    public Optional<WorkflowDef> getWorkflowDef(String name, int version) {\n        try {\n            recordCassandraDaoRequests(\"getWorkflowDef\");\n            ResultSet resultSet = session.execute(selectWorkflowDefStatement.bind(name, version));","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraMetadataDAO.java#L200-L236","documentation":"Thrown when a DriverException occurs during updateWorkflowDef's UPDATE against the workflow_def table. The DAO wraps it as TransientException, indicating an infrastructure-level, retryable failure rather than a data problem.","triggerScenarios":"session.execute(updateWorkflowDefStatement.bind(...)) raises a DriverException (timeout, unavailable host, closed session) while persisting an updated workflow definition.","commonSituations":"Cluster node loss mid-update; schema/table missing after a partial deploy; connection drop under heavy load; consistency level cannot be satisfied by live replicas.","solutions":["Confirm the Cassandra cluster is reachable and the workflow_def table is present.","Retry the update - TransientException denotes a retryable failure.","Review conductor.cassandra.writeConsistencyLevel against your replication factor.","Check driver logs for the underlying DriverException (UnavailableException, WriteTimeoutException, etc.) to pinpoint the cause."],"exampleFix":"// before: no retry, update fails on a momentary blip\nmetadataDAO.updateWorkflowDef(def);\n\n// after: retry transient failures\nRetryUtils.retryOn(TransientException.class, 3, Duration.ofMillis(200),\n    () -> metadataDAO.updateWorkflowDef(def));","handlingStrategy":"retry","validationCode":"// Pre-flight: confirm session is usable before updating\nif (cassandraSession.isClosed()) {\n    throw new IllegalStateException(\"Cassandra session is closed; cannot update workflow def\");\n}","typeGuard":null,"tryCatchPattern":"// Retry transient update failures\ntry {\n    metadataDAO.updateWorkflowDef(def);\n} catch (TransientException e) {\n    // backoff and retry, then surface if still failing\n    backoffAndRetry(() -> metadataDAO.updateWorkflowDef(def), 3);\n}","preventionTips":["Retry updateWorkflowDef on TransientException with backoff.","Keep read/write consistency levels aligned with your replication factor.","Run the schema migration so the workflow_def table exists.","Alert on recurring TransientException to catch cluster issues early."],"tags":["cassandra","workflow-definition","transient","network","driver"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}