flowable/flowable-engine · error · ActivitiIllegalArgumentException
executionId is null
Error message
executionId is null
What it means
FindActiveActivityIdsCmd returns the ids of currently active activities for an execution. It requires a non-null executionId; without it no execution can be located, so ActivitiIllegalArgumentException is thrown before the lookup.
Solutions
- Pass a non-null executionId obtained from ExecutionEntity.getId() or startProcessInstance results
- Verify the process instance is still running and its executions not yet ended
- Guard the call site with a null check on the executionId variable
Example fix
// before
List<String> ids = runtimeService.getActiveActivityIds(executionId);
// after
if (executionId != null) {
List<String> ids = runtimeService.getActiveActivityIds(executionId);
} Defensive patterns
Strategy: validation
Validate before calling
if (executionId == null) { throw new IllegalArgumentException("executionId required"); } Type guard
boolean hasExecutionId(String id) { return id != null && !id.isEmpty(); } Try / catch
try { runtimeService.getActiveActivityIds(executionId); } catch (ActivitiIllegalArgumentException e) { LOGGER.error("Missing executionId", e); } Prevention
- Store the execution id from startProcessInstance or ExecutionEntity.getId() immediately
- Null-check ids captured from prior API calls before reuse
- Avoid reusing execution ids after instance termination
When it happens
Trigger: Calling RuntimeService.getActiveActivityIds(executionId) with a null execution id, e.g. when the execution variable was never set or a previous step returned null.
Common situations: Custom code tracking execution state after a process instance terminated (execution references gone); forgetting to store the execution id returned from startProcessInstanceByX; passing a variable that failed to initialize.
Related errors
- comment is null
- Deployment id is null
- event is null
- executionId is null
- Invalid case definition id : null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/79f3350cc0f96b31.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/FindActiveActivityIdsCmd.java:41
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti.engine.runtime.Execution;
/**
* @author Tom Baeyens
*/
public class FindActiveActivityIdsCmd implements Command<List<String>>, Serializable {
private static final long serialVersionUID = 1L;
protected String executionId;
public FindActiveActivityIdsCmd(String executionId) {
this.executionId = executionId;
}
@Override
public List<String> execute(CommandContext commandContext) {
if (executionId == null) {
throw new ActivitiIllegalArgumentException("executionId is null");
}
ExecutionEntity execution = commandContext
.getExecutionEntityManager()
.findExecutionById(executionId);
if (execution == null) {
throw new ActivitiObjectNotFoundException("execution " + executionId + " doesn't exist", Execution.class);
}
return execution.findActiveActivityIds();
}
}
View on GitHub (pinned to d6d39ce1c6)