{"record":{"id":"92a5c1ec72c60a90","repo":"conductor-oss/conductor","slug":"workflow-can-not-be-serialized-to-json","errorCode":null,"errorMessage":"Workflow can not be serialized to json","messagePattern":"Workflow can not be serialized to json","errorType":"exception","errorClass":"TransientException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/netflix/conductor/core/dal/ExecutionDAOFacade.java","lineNumber":371,"sourceCode":"     *\n     * @param workflowId the id of the workflow to be removed\n     * @param archiveWorkflow if true, the workflow and associated tasks will be archived in the\n     *     {@link IndexDAO} before removal from {@link ExecutionDAO}.\n     */\n    public void removeWorkflow(String workflowId, boolean archiveWorkflow) {\n        WorkflowModel workflow = getWorkflowModelFromDataStore(workflowId, true);\n\n        // Index operations happen before DAO removal to prevent data loss on index failures.\n        try {\n            removeWorkflowIndex(workflow, archiveWorkflow);\n        } catch (NotFoundException e) {\n            if (archiveWorkflow) {\n                throw e;\n            }\n            // Idempotent deletion: missing index records should not block DAO removal.\n            LOGGER.info(\"Workflow {} not found in index during removal, continuing\", workflowId, e);\n        } catch (JsonProcessingException e) {\n            throw new TransientException(\"Workflow can not be serialized to json\", e);\n        }\n\n        // Task index removals run before DAO deletion for the same consistency guarantees.\n        workflow.getTasks()\n                .forEach(\n                        task -> {\n                            try {\n                                removeTaskIndex(workflow, task, archiveWorkflow);\n                            } catch (NotFoundException e) {\n                                if (archiveWorkflow) {\n                                    throw e;\n                                }\n                                // Idempotent deletion: missing index records should not block DAO\n                                // removal.\n                                LOGGER.info(\n                                        \"Task {} of workflow {} not found in index during removal, continuing\",\n                                        task.getTaskId(),\n                                        workflowId,","sourceCodeStart":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/core/src/main/java/com/netflix/conductor/core/dal/ExecutionDAOFacade.java#L353-L389","documentation":"Thrown as a TransientException when objectMapper.writeValueAsString(workflow) raises a JsonProcessingException during removeWorkflowIndex while archiving a terminal workflow. The code writes the full workflow as RAW_JSON_FIELD plus an ARCHIVED_FIELD=true into the index before removing it from the DAO; if serialization fails the whole removal is aborted to avoid data loss (the DAO record is kept so it can be retried).","triggerScenarios":"Archiving (archiveWorkflow=true) a workflow whose model graph contains a value Jackson cannot serialize — e.g. a non-serializable task input/output, a self-referencing object, or a type without a matching Jackson serializer.","commonSituations":"A workflow task payload holds a custom Java type or an unserializable runtime object. A Jackson ObjectMapper configuration mismatch (missing modules) between the producing and archiving paths. Circular references in dynamic payload data.","solutions":["Inspect the workflow's tasks and payloads for non-serializable or circular-reference values.","Ensure the ObjectMapper bean has all required Jackson modules registered (e.g. jdk8, JavaTime).","If you must remove the workflow despite serialization failure, call remove with archiveWorkflow=false so the index entry is deleted instead of archived.","Retry after fixing the payload; the DAO record is preserved, so nothing is lost."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    executionDAOFacade.removeWorkflow(workflowId, /* archive */ true);\n} catch (TransientException e) {\n    // serialization failed during archival; DAO record preserved -> safe to retry after fix\n}","preventionTips":["Ensure all task/workflow payloads are Jackson-serializable before they are stored.","If archival is optional, fall back to archive=false to delete from index instead.","Unit-test serialization of representative workflow graphs in your test harness."],"tags":["workflow","serialization","archival","index-dao","transient"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}