{"record":{"id":"e8f807a0b62ba214","repo":"apache/dolphinscheduler","slug":"condition-task-params-taskparams-is-invalid","errorCode":null,"errorMessage":"Condition task params: ${taskParams} is invalid.","messagePattern":"Condition task params: (.+?) is invalid\\.","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/graph/SuccessorFlowAdjuster.java","lineNumber":88,"sourceCode":"        }\n\n        final String taskType = taskExecution.getTaskInstance().getTaskType();\n        if (TaskTypeUtils.isConditionTask(taskType)) {\n            adjustConditionTaskSuccessorFlow(taskExecution);\n            return;\n        }\n\n        if (TaskTypeUtils.isSwitchTask(taskType)) {\n            adjustSwitchTaskSuccessorFlow(taskExecution);\n            return;\n        }\n    }\n\n    private void adjustConditionTaskSuccessorFlow(final ITaskExecution taskExecution) {\n        final String taskParams = taskExecution.getTaskInstance().getTaskParams();\n        final ConditionsParameters conditionsParameters = JSONUtils.parseObject(taskParams, ConditionsParameters.class);\n        if (conditionsParameters == null) {\n            throw new IllegalArgumentException(\"Condition task params: \" + taskParams + \" is invalid.\");\n        }\n        final ConditionsParameters.ConditionResult conditionResult = conditionsParameters.getConditionResult();\n        if (conditionResult == null) {\n            throw new IllegalArgumentException(\"ConditionResult: is null in taskParam: \" + taskParams);\n        }\n        final List<Long> needSkippedBranch;\n        if (conditionResult.isConditionSuccess()) {\n            needSkippedBranch = conditionResult.getFailedNode();\n        } else {\n            needSkippedBranch = conditionResult.getSuccessNode();\n        }\n        markTaskSkipped(taskExecution, needSkippedBranch);\n    }\n\n    private void adjustSwitchTaskSuccessorFlow(final ITaskExecution taskExecution) {\n        final String taskParams = taskExecution.getTaskInstance().getTaskParams();\n        final SwitchParameters switchParameters = JSONUtils.parseObject(taskParams, SwitchParameters.class);\n        if (switchParameters == null) {","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/graph/SuccessorFlowAdjuster.java#L70-L106","documentation":"Thrown by SuccessorFlowAdjuster.adjustConditionTaskSuccessorFlow when the condition task instance's taskParams JSON cannot be parsed into a ConditionsParameters object (JSONUtils.parseObject returns null). The master needs the conditions params to decide which successors to skip; unparseable params mean the task definition is corrupt or empty. It aborts successor adjustment with IllegalArgumentException.","triggerScenarios":"A condition task instance whose stored taskParams is null, empty, or not valid JSON for ConditionsParameters when the adjuster runs after the task finishes.","commonSituations":"Manually edited taskParams in the DB; API calls that save condition tasks with malformed params; schema drift where the params JSON structure changed between versions; empty params from a failed task save.","solutions":["Inspect the condition task's taskParams in the DB (t_ds_task_definition) and fix the JSON to match ConditionsParameters (conditionResult with successNode/failedNode lists).","Re-save the condition task through the UI so valid params are generated, then re-run the workflow.","If a version upgrade changed the params schema, migrate old task definitions to the current format."],"exampleFix":"// before: invalid taskParams\n\"\"\n// after: valid ConditionsParameters JSON\n{\"conditionResult\":{\"successNode\":[1001],\"failedNode\":[1002],\"dependTaskList\":[],\"relation\":\"AND\"}}","handlingStrategy":"validation","validationCode":"// validate condition taskParams parse before execution\nConditionsParameters p = JSONUtils.parseObject(taskInstance.getTaskParams(), ConditionsParameters.class);\nif (p == null) throw new IllegalStateException(\"Invalid condition task params: \" + taskInstance.getTaskParams());","typeGuard":null,"tryCatchPattern":"try {\n    adjuster.adjustSuccessorFlow(taskExecution);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Condition task params:\")) {\n        // repair taskParams for this condition task instance\n    } else throw e;\n}","preventionTips":["Never hand-edit taskParams in the DB without validating JSON shape.","Use the UI/API to create condition tasks so params are serialized correctly.","Check params schema after upgrading DolphinScheduler versions."],"tags":["workflow","condition-task","json"],"backgroundTag":"json-unmarshal-failed","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}