flowable/flowable-engine · error · ActivitiObjectNotFoundException

No process definition found for id ''

Error message

No process definition found for id ''

What it means

Thrown by GetStartFormCmd as ActivitiObjectNotFoundException when the deployment manager cannot find a deployed process definition for the given processDefinitionId while fetching StartFormData. Unlike 4550 (rendered form) this is the plain start-form retrieval path.

Source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/GetStartFormCmd.java:46

 * @author Tom Baeyens
 */
public class GetStartFormCmd implements Command<StartFormData>, Serializable {

    private static final long serialVersionUID = 1L;
    protected String processDefinitionId;

    public GetStartFormCmd(String processDefinitionId) {
        this.processDefinitionId = processDefinitionId;
    }

    @Override
    public StartFormData execute(CommandContext commandContext) {
        ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) commandContext
                .getProcessEngineConfiguration()
                .getDeploymentManager()
                .findDeployedProcessDefinitionById(processDefinitionId);
        if (processDefinition == null) {
            throw new ActivitiObjectNotFoundException("No process definition found for id '" + processDefinitionId + "'", ProcessDefinition.class);
        }

        StartFormHandler startFormHandler = processDefinition.getStartFormHandler();
        if (startFormHandler == null) {
            throw new ActivitiException("No startFormHandler defined in process '" + processDefinitionId + "'");
        }

        return startFormHandler.createStartFormData(processDefinition);
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Validate the id with repositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult().
  2. Re-deploy the BPMN and use the fresh definition id if the deployment was deleted.
  3. Ensure the FormService call goes to the same engine instance/database that holds the deployment.
  4. Resolve the id dynamically via processDefinitionKey + latestVersion rather than hardcoding.

Example fix

// before
formService.getStartForm("invoice:3:1234"); // deleted deployment
// after
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
    .processDefinitionKey("invoice").latestVersion().singleResult();
formService.getStartForm(pd.getId());
Defensive patterns

Strategy: validation

Validate before calling

ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
    .processDefinitionId(processDefinitionId).singleResult();
if (pd == null) throw new IllegalArgumentException("Unknown process definition: " + processDefinitionId);

Try / catch

try {
    formService.getStartForm(processDefinitionId);
} catch (ActivitiObjectNotFoundException e) {
    // look up latest version by key
}

Prevention

When it happens

Trigger: Calling FormService.getStartForm(processDefinitionId) with an id not present in the repository (never deployed, deleted deployment, wrong engine/database, or malformed id).

Common situations: Cached/stale ids after redeploy; id copied from a different environment; definition removed by deleteDeployment; unit test running against an in-memory engine while ids came from a persistent one.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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