flowable/flowable-engine · error · FlowableIllegalArgumentException

executionId is null

Error message

executionId is null

What it means

NeedsActiveExecutionCmd is the base class for commands that operate on an execution which must be active (e.g. TriggerExecutionCmd). Its execute() first validates executionId is non-null and throws FlowableIllegalArgumentException 'executionId is null' otherwise.

Solutions

  1. Obtain a valid execution id via runtimeService.createExecutionQuery() before invoking trigger/signal APIs.
  2. Null-check the execution id at the call site, especially for ids extracted from external payloads.
  3. If you only have the process instance id, query for the waiting execution instead of passing null.
  4. Catch FlowableIllegalArgumentException where null indicates 'nothing to trigger' and skip gracefully.

Example fix

// before
runtimeService.trigger(executionId); // executionId may be null
// after
if (executionId == null) {
    return; // nothing waiting
}
runtimeService.trigger(executionId);
Defensive patterns

Strategy: validation

Validate before calling

if (executionId == null || executionId.isBlank()) {
    throw new IllegalArgumentException("executionId is required");
}

Type guard

boolean isValidExecutionId(String id) { return id != null && !id.isBlank(); }

Try / catch

try {
    runtimeService.trigger(executionId);
} catch (FlowableIllegalArgumentException e) {
    log.warn("Cannot trigger execution: {}", e.getMessage());
}

Prevention

When it happens

Trigger: Calling runtimeService.trigger(null), signal/signalEventReceived with a null executionId, or any subclass command (trigger, message/event correlation) constructed with a null executionId.

Common situations: The execution id variable was never assigned (null return of an earlier query); argument order swapped in trigger-like APIs; null propagation from deserialized webhook payloads.

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/ae2424f32768bce1. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/NeedsActiveExecutionCmd.java:42

import org.flowable.engine.runtime.Execution;

/**
 * @author Joram Barrez
 */
public abstract class NeedsActiveExecutionCmd<T> implements Command<T>, Serializable {

    private static final long serialVersionUID = 1L;

    protected String executionId;

    public NeedsActiveExecutionCmd(String executionId) {
        this.executionId = executionId;
    }

    @Override
    public T execute(CommandContext commandContext) {
        if (executionId == null) {
            throw new FlowableIllegalArgumentException("executionId is null");
        }

        ExecutionEntity execution = CommandContextUtil.getExecutionEntityManager(commandContext).findById(executionId);

        if (execution == null) {
            throw new FlowableObjectNotFoundException("execution " + executionId + " doesn't exist", Execution.class);
        }

        if (execution.isSuspended()) {
            throw new FlowableException(getSuspendedExceptionMessagePrefix() + " a suspended " + execution);
        }

        return execute(commandContext, execution);
    }

    /**
     * Subclasses should implement this method. The provided {@link ExecutionEntity} is guaranteed to be active (ie. not suspended).
     */

View on GitHub (pinned to d6d39ce1c6)