conductor-oss/conductor · error · TransientException
Workflow can not be serialized to json
Error message
Workflow can not be serialized to json
What it means
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).
Source
Thrown at core/src/main/java/com/netflix/conductor/core/dal/ExecutionDAOFacade.java:371
*
* @param workflowId the id of the workflow to be removed
* @param archiveWorkflow if true, the workflow and associated tasks will be archived in the
* {@link IndexDAO} before removal from {@link ExecutionDAO}.
*/
public void removeWorkflow(String workflowId, boolean archiveWorkflow) {
WorkflowModel workflow = getWorkflowModelFromDataStore(workflowId, true);
// Index operations happen before DAO removal to prevent data loss on index failures.
try {
removeWorkflowIndex(workflow, archiveWorkflow);
} catch (NotFoundException e) {
if (archiveWorkflow) {
throw e;
}
// Idempotent deletion: missing index records should not block DAO removal.
LOGGER.info("Workflow {} not found in index during removal, continuing", workflowId, e);
} catch (JsonProcessingException e) {
throw new TransientException("Workflow can not be serialized to json", e);
}
// Task index removals run before DAO deletion for the same consistency guarantees.
workflow.getTasks()
.forEach(
task -> {
try {
removeTaskIndex(workflow, task, archiveWorkflow);
} catch (NotFoundException e) {
if (archiveWorkflow) {
throw e;
}
// Idempotent deletion: missing index records should not block DAO
// removal.
LOGGER.info(
"Task {} of workflow {} not found in index during removal, continuing",
task.getTaskId(),
workflowId,View on GitHub (pinned to cf7c3e4a8a)
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.
Defensive patterns
Strategy: try-catch
Try / catch
try {
executionDAOFacade.removeWorkflow(workflowId, /* archive */ true);
} catch (TransientException e) {
// serialization failed during archival; DAO record preserved -> safe to retry after fix
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Task %s of workflow %s can not be serialized to json
- Error reading workflow: %s
- Error resetting workflow state: {}
- Error creating workflow: %s
- Failed to update workflow: %s
AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14).
Data as JSON: /api/errors/92a5c1ec72c60a90.
Report an issue: GitHub.