flowable/flowable-engine · error · FlowableIllegalArgumentException
process definition id is null
Error message
process definition id is null
What it means
SaveProcessDefinitionInfoCmd.execute throws FlowableIllegalArgumentException when the processDefinitionId supplied to the command is null. The command needs the id to look up or create the corresponding ProcessDefinitionInfoEntity, so a null id makes the operation meaningless. This is an argument-validation guard at the very start of the command.
Source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SaveProcessDefinitionInfoCmd.java:46
/**
* @author Tijs Rademakers
*/
public class SaveProcessDefinitionInfoCmd implements Command<Void>, Serializable {
private static final long serialVersionUID = 1L;
protected String processDefinitionId;
protected ObjectNode infoNode;
public SaveProcessDefinitionInfoCmd(String processDefinitionId, ObjectNode infoNode) {
this.processDefinitionId = processDefinitionId;
this.infoNode = infoNode;
}
@Override
public Void execute(CommandContext commandContext) {
if (processDefinitionId == null) {
throw new FlowableIllegalArgumentException("process definition id is null");
}
if (infoNode == null) {
throw new FlowableIllegalArgumentException("process definition info node is null");
}
ProcessDefinitionInfoEntityManager definitionInfoEntityManager = CommandContextUtil.getProcessDefinitionInfoEntityManager(commandContext);
ProcessDefinitionInfoEntity definitionInfoEntity = definitionInfoEntityManager.findProcessDefinitionInfoByProcessDefinitionId(processDefinitionId);
if (definitionInfoEntity == null) {
definitionInfoEntity = definitionInfoEntityManager.create();
definitionInfoEntity.setProcessDefinitionId(processDefinitionId);
CommandContextUtil.getProcessDefinitionInfoEntityManager().insertProcessDefinitionInfo(definitionInfoEntity);
}
try {
ObjectWriter writer = CommandContextUtil.getProcessEngineConfiguration(commandContext).getObjectMapper().writer();
CommandContextUtil.getProcessDefinitionInfoEntityManager().updateInfoJson(definitionInfoEntity.getId(), writer.writeValueAsBytes(infoNode));
} catch (Exception e) {View on GitHub (pinned to d6d39ce1c6)
Solutions
- Pass a valid, non-null process definition id string when calling saveProcessDefinitionInfo.
- Resolve the id first, e.g. via repositoryService.createProcessDefinitionQuery() ... singleResult().getId(), and check it for null before invoking.
- Ensure the process definition is actually deployed so a real id exists to pass.
Example fix
// before
managementService.saveProcessDefinitionInfo(null, infoNode);
// after
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionKey("myProcess").latestVersion().singleResult();
if (pd != null) {
managementService.saveProcessDefinitionInfo(pd.getId(), infoNode);
} Defensive patterns
Strategy: validation
Validate before calling
if (processDefinitionId == null || processDefinitionId.isEmpty()) {
throw new IllegalArgumentException("processDefinitionId must be provided");
}
managementService.saveProcessDefinitionInfo(processDefinitionId, infoNode); Type guard
boolean hasId = id instanceof String && !((String) id).isEmpty();
Prevention
- Resolve ids from repositoryService queries instead of hardcoding or caching them.
- Null-check all ids at service boundaries before invoking Flowable commands.
- Never forward the result of singleResult() without a null check.
When it happens
Trigger: Calling managementService.saveProcessDefinitionInfo(null, infoNode) or constructing new SaveProcessDefinitionInfoCmd(null, infoNode) and executing it.
Common situations: Passing an unassigned/uninitialized variable as the process definition id; a lookup that returned null upstream and its result was forwarded without checking; programmatic API misuse where the id field was never set.
Related errors
- Process definition id or key cannot be null
- process definition id is null
- The process definition version is mandatory, but 'null' has
- Error retrieving app engine info
- No deployment id available
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/968ace5e8cedc37d.
Report an issue: GitHub.