{"record":{"id":"99c1a76d60e02f1e","repo":"apache/dolphinscheduler","slug":"the-workflowdefinition-should-be-online","errorCode":null,"errorMessage":"The workflowDefinition should be online","messagePattern":"The workflowDefinition should be online","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/validator/workflow/BackfillWorkflowDTOValidator.java","lineNumber":65,"sourceCode":"    public void validate(final BackfillWorkflowDTO backfillWorkflowDTO) {\n        final BackfillWorkflowDTO.BackfillParamsDTO backfillParams = backfillWorkflowDTO.getBackfillParams();\n        if (backfillParams == null) {\n            throw new IllegalArgumentException(\"backfillParams is null\");\n        }\n        if (CollectionUtils.isEmpty(backfillParams.getBackfillDateList())) {\n            throw new IllegalArgumentException(\"backfillDateList is empty\");\n        }\n        if (backfillParams.getExpectedParallelismNumber() < 0) {\n            throw new IllegalArgumentException(\"expectedParallelismNumber should >= 0\");\n        }\n        if (backfillWorkflowDTO.getExecType() != CommandType.COMPLEMENT_DATA) {\n            throw new IllegalArgumentException(\"The execType should be START_PROCESS\");\n        }\n        if (backfillWorkflowDTO.getWorkflowDefinition() == null) {\n            throw new IllegalArgumentException(\"The workflowDefinition should not be null\");\n        }\n        if (backfillWorkflowDTO.getWorkflowDefinition().getReleaseState() != ReleaseState.ONLINE) {\n            throw new IllegalStateException(\"The workflowDefinition should be online\");\n        }\n\n        tenantExistValidator.validate(backfillWorkflowDTO.getTenantCode());\n\n        startParamListValidator.validate(backfillWorkflowDTO.getStartParamList());\n    }\n}\n","sourceCodeStart":47,"sourceCodeEnd":73,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/validator/workflow/BackfillWorkflowDTOValidator.java#L47-L73","documentation":"BackfillWorkflowDTOValidator.validate requires the target workflow definition to be released/online before it can be backfilled. If workflowDefinition.getReleaseState() != ReleaseState.ONLINE, it throws IllegalStateException('The workflowDefinition should be online'). Backfilling an offline (draft or unpublished) workflow is disallowed.","triggerScenarios":"Requesting a backfill for a workflow whose releaseState is OFFLINE, i.e. it was never published, or was taken offline after the DTO was built.","commonSituations":"Trying to backfill a newly created draft workflow; someone unpublished the workflow between listing it and submitting the backfill; copying a workflow and forgetting to publish the copy; CI scripts backfilling against a staging workflow left offline.","solutions":["Publish the workflow first: set its release state to ONLINE via the release API/UI, then retry the backfill.","Verify you selected the intended (published) workflow, not a draft copy.","Refresh the workflow's current release state before backfilling to avoid a stale OFFLINE snapshot.","Add a pre-check in automation: skip/abort backfill if releaseState != ONLINE."],"exampleFix":"// before\nif (definition.getReleaseState() != ReleaseState.ONLINE) { backfill(dto); } // throws\n// after\nreleaseService.onlineWorkflow(definition.getCode(), user);\n// then retry backfill once releaseState == ReleaseState.ONLINE","handlingStrategy":"validation","validationCode":"if (definition.releaseState !== 'ONLINE') {\n  throw new Error('Workflow must be ONLINE (published) before backfill');\n}","typeGuard":"function isOnline(definition) {\n  return definition?.releaseState === 'ONLINE';\n}","tryCatchPattern":"try {\n  backfill(dto);\n} catch (IllegalStateException e) {\n  if (e.getMessage().contains(\"should be online\")) {\n    // publish workflow via release API, then retry\n  }\n}","preventionTips":["Publish (release) the workflow before scheduling backfills.","Re-check releaseState immediately before submission to avoid stale snapshots.","In CI, assert releaseState == ONLINE in a preflight step.","Don't run backfills against draft/copied workflows."],"tags":["backfill","release-state","workflow"],"backgroundTag":"invalid-state-transition","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}