apache/dolphinscheduler · error · ServiceException

MOVE_WORKFLOW_DEFINITION_ERROR

MOVE_WORKFLOW_DEFINITION_ERROR

Error message

MOVE_WORKFLOW_DEFINITION_ERROR: move workflow definition from project {0} to project {1} error, failed workflows: {2}

What it means

The MOVE counterpart of error 438: thrown by checkBatchOperateResult when a batch MOVE of workflow definitions to another project left at least one workflow in failedWorkflowList (isCopy=false branch). It reports source project, target project, and the failed 'code[name]' list. A move re-points the workflow at the target project via updateDagDefine; per-workflow failures are collected and surfaced here as one aggregate error.

Source

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

     * @param result            result
     * @param failedWorkflowList failedWorkflowList
     * @param isCopy            isCopy
     */
    private void checkBatchOperateResult(long srcProjectCode, long targetProjectCode,
                                         List<String> failedWorkflowList, boolean isCopy) {
        if (!failedWorkflowList.isEmpty()) {
            String failedWorkflow = String.join(",", failedWorkflowList);
            if (isCopy) {
                log.error(
                        "Copy workflow definition error, srcProjectCode:{}, targetProjectCode:{}, failedWorkflowList:{}.",
                        srcProjectCode, targetProjectCode, failedWorkflow);
                throw new ServiceException(Status.COPY_WORKFLOW_DEFINITION_ERROR, srcProjectCode, targetProjectCode,
                        failedWorkflow);
            }
            log.error(
                    "Move workflow definition error, srcProjectCode:{}, targetProjectCode:{}, failedWorkflowList:{}.",
                    srcProjectCode, targetProjectCode, failedWorkflow);
            throw new ServiceException(Status.MOVE_WORKFLOW_DEFINITION_ERROR, srcProjectCode, targetProjectCode,
                    failedWorkflow);
        }
        log.info("Batch {} workflow definition complete, srcProjectCode:{}, targetProjectCode:{}.",
                isCopy ? "copy" : "move", srcProjectCode, targetProjectCode);
    }

    /**
     * query the pagination versions info by one certain workflow definition code
     *
     * @param loginUser   login user info to check auth
     * @param projectCode project code
     * @param pageNo      page number
     * @param pageSize    page size
     * @param code        workflow definition code
     * @return the pagination workflow definition versions info of the certain workflow definition
     */
    @Override
    public Result queryWorkflowDefinitionVersions(User loginUser, long projectCode, int pageNo, int pageSize,

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Identify the failed workflows from the message, check the server log for each workflow's 'Move workflow definition error' stack trace, fix the root cause, and move only those again.
  2. Ensure no concurrent edits are running on the workflows being moved (lock/coordinate users), then retry.
  3. Validate the source workflows' DAG and taskParams integrity before moving (e.g. via UI save or a JSON validation pass).
  4. Confirm the DB is healthy and the metadata schema matches your DolphinScheduler version, then re-run the failed moves.

Example fix

// before: single move call containing a broken workflow -> MOVE_WORKFLOW_DEFINITION_ERROR
POST /projects/{src}/workflow-definition/move  targetProjectCode=X  codes=111,222(bad)
// after: fix 222 (e.g. its task relations), then move it alone
codes=111 -> moved; repair 222 -> codes=222 -> moved
Defensive patterns

Strategy: validation

Validate before calling

// Validate DAG/task definitions before moving workflows to another project
boolean dagIntegrityOk(WorkflowDefinition wf) {
  List<WorkflowTaskRelation> rels = workflowTaskRelationDao
      .queryWorkflowTaskRelationsByWorkflowDefinitionCode(wf.getCode(), wf.getVersion());
  return rels.stream().allMatch(r -> r.getPostTaskCode() > 0);
}

Try / catch

try {
    workflowDefinitionService.moveWorkflowDefinitionToOtherProject(user, srcProjectCode, targetProjectCode, codes);
} catch (ServiceException e) {
    // message lists failed "code[name]" workflows; fix root causes in server logs and re-move them
}

Prevention

When it happens

Trigger: Calling the move-workflows endpoint where updateDagDefine threw for any workflow — e.g. invalid DAG/task relations, task code remap failures, or DB write errors while changing the workflow's projectCode.

Common situations: Moving workflows with corrupted task definitions; moving between projects while other users edit the same workflows; metadata DB issues during the update; moving imported workflows whose task codes don't line up.

Related errors


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