{"record":{"id":"10f9efa0b7d1ff84","repo":"conductor-oss/conductor","slug":"error-creating-workflow-definition-s-d","errorCode":null,"errorMessage":"Error creating workflow definition: %s/%d","messagePattern":"Error creating workflow definition: (.+?)/(.+?)","errorType":"exception","errorClass":"TransientException","httpStatus":500,"severity":"error","filePath":"cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraMetadataDAO.java","lineNumber":192,"sourceCode":"                        \"Workflow: %s, version: %s already exists!\",\n                        workflowDef.getName(), workflowDef.getVersion());\n            }\n            String workflowDefIndex =\n                    getWorkflowDefIndexValue(workflowDef.getName(), workflowDef.getVersion());\n            session.execute(\n                    insertWorkflowDefVersionIndexStatement.bind(\n                            workflowDefIndex, workflowDefIndex));\n            recordCassandraDaoRequests(\"createWorkflowDef\");\n            recordCassandraDaoPayloadSize(\n                    \"createWorkflowDef\", workflowDefinition.length(), \"n/a\", workflowDef.getName());\n        } catch (DriverException e) {\n            Monitors.error(CLASS_NAME, \"createWorkflowDef\");\n            String errorMsg =\n                    String.format(\n                            \"Error creating 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 void updateWorkflowDef(WorkflowDef workflowDef) {\n        try {\n            String workflowDefinition = toJson(workflowDef);\n            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());","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraMetadataDAO.java#L174-L210","documentation":"Thrown when the Cassandra driver raises a DriverException (connection loss, timeout, node unavailable, consistency not met, etc.) while createWorkflowDef executes its INSERT. The DAO wraps it in a TransientException, signalling the failure is retryable and not caused by bad input.","triggerScenarios":"session.execute(insertWorkflowDefStatement.bind(...)) throws a DriverException during workflow-definition creation - e.g. coordinator unavailable, write timeout, or the session being closed.","commonSituations":"Cassandra node down or restarting; network partition between Conductor and the cluster; keyspace/table not yet created (schema migration not run); connection pool exhausted under load; read/write timeout on a large payload.","solutions":["Verify Cassandra cluster health and that the conductor keyspace + workflow_def table exist (run the schema migration if missing).","Check conductor.cassandra.* properties (hosts, port, keyspace, consistency levels).","Retry the create call with backoff - TransientException is retryable by design.","Increase write timeouts or lower write consistency if timeouts recur under load."],"exampleFix":"// before: single shot, surfaces TransientException to caller\nmetadataDAO.createWorkflowDef(def);\n\n// after: retry on TransientException with backoff\nRetryUtils.retryOn(TransientException.class, 3, Duration.ofMillis(200),\n    () -> metadataDAO.createWorkflowDef(def));","handlingStrategy":"retry","validationCode":"// Pre-flight: ensure the Cassandra session is open before writing\nif (cassandraSession.isClosed()) {\n    throw new IllegalStateException(\"Cassandra session is closed; cannot create workflow def\");\n}","typeGuard":null,"tryCatchPattern":"// Retry transient driver failures during create\nint attempts = 0;\nwhile (true) {\n    try {\n        metadataDAO.createWorkflowDef(def);\n        break;\n    } catch (TransientException e) {\n        if (++attempts >= 3) throw e;\n        Thread.sleep(200L * attempts);\n    }\n}","preventionTips":["Wrap metadata writes in a retry-with-backoff for TransientException.","Monitor Cassandra cluster health and connection-pool saturation.","Ensure schema migrations (keyspace + workflow_def table) run before startup.","Size write timeouts to your largest workflow-definition payload."],"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"}