apache/dolphinscheduler · error · ServiceException

50008

50008

Error message

workflow definition {0} does not allow edit

What it means

Thrown in WorkflowDefinitionServiceImpl.updateWorkflowDefinition when the workflow's releaseState is ReleaseState.ONLINE: a published (online) workflow definition is immutable and cannot be edited. The guard fires on any update request against an online workflow, independent of whether the payload is valid.

Source

Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowDefinitionServiceImpl.java:648

            throw new ServiceException(Status.DESCRIPTION_TOO_LONG_ERROR);
        }

        globalParamsValidator.validate(globalParams);

        List<TaskDefinitionLog> taskDefinitionLogs = generateTaskDefinitionList(taskDefinitionJson);
        List<WorkflowTaskRelationLog> taskRelationList = generateTaskRelationList(taskRelationJson, taskDefinitionLogs);

        WorkflowDefinition workflowDefinition = workflowDefinitionDao.queryByCode(code).orElse(null);
        // check workflow definition exists
        if (workflowDefinition == null || projectCode != workflowDefinition.getProjectCode()) {
            log.error("workflow definition does not exist, workflowDefinitionCode:{}.", code);
            throw new ServiceException(Status.WORKFLOW_DEFINITION_NOT_EXIST, String.valueOf(code));
        }
        if (workflowDefinition.getReleaseState() == ReleaseState.ONLINE) {
            // online can not permit edit
            log.warn("workflow definition is not allowed to be modified due to {}, workflowDefinitionCode:{}.",
                    ReleaseState.ONLINE.getDescp(), workflowDefinition.getCode());
            throw new ServiceException(Status.WORKFLOW_DEFINITION_NOT_ALLOWED_EDIT, workflowDefinition.getName());
        }
        if (!name.equals(workflowDefinition.getName())) {
            // check whether the new workflow define name exist
            WorkflowDefinition definition = workflowDefinitionDao.verifyByDefineName(project.getCode(), name);
            if (definition != null) {
                log.warn("workflow definition with the same name already exists, workflowDefinitionCode:{}.",
                        definition.getCode());
                throw new ServiceException(Status.WORKFLOW_DEFINITION_NAME_EXIST, name);
            }
        }
        WorkflowDefinition workflowDefinitionDeepCopy =
                JSONUtils.parseObject(JSONUtils.toJsonString(workflowDefinition), WorkflowDefinition.class);
        workflowDefinition.set(projectCode, name, description, globalParams, locations, timeout);
        workflowDefinition.setExecutionType(executionType);
        return updateDagDefine(loginUser, taskRelationList, workflowDefinition, workflowDefinitionDeepCopy,
                taskDefinitionLogs);
    }

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Take the workflow offline (releaseWorkflow / UI set offline) before editing
  2. Re-release it ONLINE after the update completes
  3. Skip ONLINE workflows in batch scripts and only edit offline ones

Example fix

// before
updateWorkflowDefinition(user, projectCode, code, ...) // workflow is ONLINE
// after
releaseWorkflowDefinition(user, projectCode, code, ReleaseState.OFFLINE);
updateWorkflowDefinition(user, projectCode, code, ...);
releaseWorkflowDefinition(user, projectCode, code, ReleaseState.ONLINE);
Defensive patterns

Strategy: validation

Validate before calling

WorkflowDefinition wf = workflowDefinitionDao.queryByCode(code).orElse(null);
if (wf != null && wf.getReleaseState() == ReleaseState.ONLINE) { /* take offline first */ }

Type guard

boolean isEditable(WorkflowDefinition wf) { return wf != null && wf.getReleaseState() != ReleaseState.ONLINE; }

Try / catch

try { ... } catch (ServiceException e) { if (e.getCode() == 50008) { /* release offline, retry, re-release */ } }

Prevention

When it happens

Trigger: Calling updateWorkflowDefinition (or batch operations routed through updateDagDefine) against a workflow with releaseState == ReleaseState.ONLINE.

Common situations: Editing a production workflow from the API without scheduling it offline first, automation that assumes draft state, batch scripts hitting ONLINE workflows.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/37d3ae1adc941e3f. Report an issue: GitHub.