{"record":{"id":"b19408fad66d8c0c","repo":"conductor-oss/conductor","slug":"error-retrieving-all-workflow-defs","errorCode":null,"errorMessage":"Error retrieving all workflow defs","messagePattern":"Error retrieving all workflow defs","errorType":"exception","errorClass":"TransientException","httpStatus":null,"severity":"error","filePath":"cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraMetadataDAO.java","lineNumber":296,"sourceCode":"                LOGGER.info(\"No workflow definitions were found.\");\n                return Collections.EMPTY_LIST;\n            }\n            return rows.stream()\n                    .map(\n                            row -> {\n                                String defNameVersion =\n                                        row.getString(WORKFLOW_DEF_NAME_VERSION_KEY);\n                                var nameVersion = getWorkflowNameAndVersion(defNameVersion);\n                                return getWorkflowDef(nameVersion.getLeft(), nameVersion.getRight())\n                                        .orElse(null);\n                            })\n                    .filter(Objects::nonNull)\n                    .collect(Collectors.toList());\n        } catch (DriverException e) {\n            Monitors.error(CLASS_NAME, \"getAllWorkflowDefs\");\n            String errorMsg = \"Error retrieving all workflow defs\";\n            LOGGER.error(errorMsg, e);\n            throw new TransientException(errorMsg, e);\n        }\n    }\n\n    @Override\n    public List<WorkflowDef> getAllWorkflowDefsLatestVersions() {\n        try {\n            ResultSet resultSet =\n                    session.execute(\n                            selectAllWorkflowDefsLatestVersionsStatement.bind(\n                                    WORKFLOW_DEF_INDEX_KEY));\n            List<Row> rows = resultSet.all();\n            if (rows.size() == 0) {\n                LOGGER.info(\"No workflow definitions were found.\");\n                return Collections.EMPTY_LIST;\n            }\n            Map<String, PriorityQueue<WorkflowDef>> allWorkflowDefs = new HashMap<>();\n\n            for (Row row : rows) {","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraMetadataDAO.java#L278-L314","documentation":"Thrown when a DriverException occurs while getAllWorkflowDefs scans the workflow-definition index and hydrates each entry via getWorkflowDef. Wrapped as TransientException - the listing could not be completed due to an infrastructure failure.","triggerScenarios":"The SELECT on the workflow_def index (selectAllWorkflowDefsStatement) or one of the per-entry getWorkflowDef reads raises a DriverException during the full listing.","commonSituations":"Large index scanned during a cluster degradation; read timeout because many rows must be hydrated; a single unavailable replica fails the read consistency.","solutions":["Retry the listing call with backoff.","Verify cluster health and read consistency can be satisfied.","For very large definition sets, prefer paginated/latest-version endpoints over the full scan.","Inspect the wrapped DriverException for the root driver error."],"exampleFix":"// before: one-shot full listing\nList<WorkflowDef> all = metadataDAO.getAllWorkflowDefs();\n\n// after: retry transient listing failures\nList<WorkflowDef> all = RetryUtils.retryOn(TransientException.class, 3,\n        Duration.ofMillis(200), metadataDAO::getAllWorkflowDefs);","handlingStrategy":"retry","validationCode":"// Pre-flight: check session health before a full listing\nif (cassandraSession.isClosed()) {\n    throw new IllegalStateException(\"Cassandra session is closed; cannot list workflow defs\");\n}","typeGuard":null,"tryCatchPattern":"// Retry the full listing on transient failure\ntry {\n    return metadataDAO.getAllWorkflowDefs();\n} catch (TransientException e) {\n    return backoffAndRetry(metadataDAO::getAllWorkflowDefs, 3);\n}","preventionTips":["Retry full listings on TransientException with backoff.","Prefer paginated/latest-version endpoints for large definition sets.","Keep read consistency and timeouts sized for wide index scans.","Cache listing results short-term to cut driver load."],"tags":["cassandra","workflow-definition","transient","network","driver","list"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}