flowable/flowable-engine · error · FlowableException

Cannot migrate process(es), not enough information

Error message

Cannot migrate process(es), not enough information

What it means

In ProcessInstanceMigrationCmd.execute, the command migrates either by process instance id, process definition id, or process definition key+version. If none of these selectors is set (all null or version < 0), there is no way to know which process instances to migrate, so the engine throws this exception. It indicates the migration command was constructed without any target selector populated.

Solutions

  1. Set a migration target: pass a processInstanceId, or a processDefinitionId, or a processDefinitionKey together with processDefinitionVersion >= 0
  2. Prefer the public API: managementService.createProcessInstanceMigrationBuilder().migrateToProcessDefinition(id) which sets the selector for you
  3. If migrating by key, ensure the version field is a real version number (>= 0), not the default/unset -1

Example fix

// before
ProcessInstanceMigrationCmd cmd = new ProcessInstanceMigrationCmd(doc); // no selector
// after
ProcessInstanceMigrationCmd cmd = new ProcessInstanceMigrationCmd(
    processDefinitionId, doc); // or key + version, or instanceId
Defensive patterns

Strategy: validation

Validate before calling

boolean hasTarget = processInstanceId != null
    || processDefinitionId != null
    || (processDefinitionKey != null && processDefinitionVersion >= 0);
if (!hasTarget) throw new IllegalArgumentException("Set instanceId, definitionId, or key+version");

Type guard

boolean migrationTargetSet(ProcessInstanceMigrationCmd cmd) { return cmd != null; }

Try / catch

try {
    cmd.execute(commandContext);
} catch (FlowableException e) {
    if (e.getMessage().contains("not enough information")) {
        throw new IllegalStateException("Migration target selector missing", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Executing a ProcessInstanceMigrationCmd whose processInstanceId, processDefinitionId, and (processDefinitionKey + processDefinitionVersion >= 0) are all unset — e.g. a constructor variant was called with nulls and no later selector was provided, or the document alone was supplied without identifying which instances to migrate.

Common situations: Using the internal command API directly and forgetting to set the target; building a custom migration path that only sets the document; key set but version left at its default -1 (key+version branch requires version >= 0); copy-pasted constructor arguments in wrong order.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/2e9603d32fe73de8. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/ProcessInstanceMigrationCmd.java:84

        this.processDefinitionKey = processDefinitionKey;
        this.processDefinitionVersion = processDefinitionVersion;
        this.processDefinitionTenantId = processDefinitionTenantId;
        this.processInstanceMigrationDocument = processInstanceMigrationDocument;
    }

    @Override
    public Void execute(CommandContext commandContext) {
        ProcessInstanceMigrationManager migrationManager = CommandContextUtil.getProcessEngineConfiguration(commandContext).getProcessInstanceMigrationManager();

        if (processInstanceId != null) {
            migrationManager.migrateProcessInstance(processInstanceId, processInstanceMigrationDocument, commandContext);
        } else if (processDefinitionId != null) {
            migrationManager.migrateProcessInstancesOfProcessDefinition(processDefinitionId, processInstanceMigrationDocument, commandContext);
        } else if (processDefinitionKey != null && processDefinitionVersion >= 0) {
            migrationManager.migrateProcessInstancesOfProcessDefinition(processDefinitionKey, processDefinitionVersion, processDefinitionTenantId, processInstanceMigrationDocument, commandContext);
        } else {
            throw new FlowableException("Cannot migrate process(es), not enough information");
        }
        return null;
    }

}

View on GitHub (pinned to d6d39ce1c6)