flowable/flowable-engine · error · FlowableObjectNotFoundException

No process definition found for id '

Error message

No process definition found for id '

What it means

GetStartFormCmd.execute resolves the deployed process definition by id via DeploymentManager.findDeployedProcessDefinitionById and throws FlowableObjectNotFoundException carrying ProcessDefinition.class when nothing is deployed under that id. It is a lookup failure on the ACT_RE_PROCDEF table, not a form problem.

Solutions

  1. Fetch a fresh id at runtime via RepositoryService.createProcessDefinitionQuery().processDefinitionKey(key).latestVersion().singleResult() instead of hard-coding the id
  2. Verify the id exists with repositoryService.getProcessDefinition(id) before calling the form API
  3. Check you are connected to the same database the definition was deployed to (inspect ACT_RE_PROCDEF)
  4. Redeploy the process definition if the deployment was removed

Example fix

// before
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionId("myProc:1:123").singleResult();
formService.getStartFormMetadata("myProc:1:123");
// after
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionKey("myProc").latestVersion().singleResult();
formService.getStartFormMetadata(pd.getId());
Defensive patterns

Strategy: validation

Validate before calling

ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
        .processDefinitionId(processDefinitionId).singleResult();
if (pd == null) throw new IllegalStateException("Process definition not deployed: " + processDefinitionId);

Type guard

boolean processDefinitionExists(RepositoryService rs, String id) {
    return id != null && rs.createProcessDefinitionQuery().processDefinitionId(id).count() > 0;
}

Try / catch

try {
    return formService.getStartFormData(processDefinitionId);
} catch (FlowableObjectNotFoundException e) {
    if (e.getObjectClass() == ProcessDefinition.class) {
        log.warn("Process definition {} not found; refreshing id", processDefinitionId);
        return null;
    }
    throw e;
}

Prevention

When it happens

Trigger: FormService.getStartFormMetadata / getStartFormData or TaskService equivalents invoked with a processDefinitionId that does not exist in the repository (wrong id, deleted deployment, other database/tenant).

Common situations: Hard-coded process definition ids that change between deployments; running against a test/h2 database while the definition was deployed to another DB; cluster nodes pointing at different datasources; stale cached ids after redeployment deleted the old definition; tenant confusion where the definition exists but under a different tenant.

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

Appendix: source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetStartFormCmd.java:45

import org.flowable.engine.repository.ProcessDefinition;

/**
 * @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) {
        ProcessDefinition processDefinition = CommandContextUtil.getProcessEngineConfiguration(commandContext).getDeploymentManager().findDeployedProcessDefinitionById(processDefinitionId);
        if (processDefinition == null) {
            throw new FlowableObjectNotFoundException("No process definition found for id '" + processDefinitionId + "'", ProcessDefinition.class);
        }

        if (Flowable5Util.isFlowable5ProcessDefinition(processDefinition, commandContext)) {
            return Flowable5Util.getFlowable5CompatibilityHandler().getStartFormData(processDefinitionId);
        }

        FormHandlerHelper formHandlerHelper = CommandContextUtil.getProcessEngineConfiguration(commandContext).getFormHandlerHelper();
        StartFormHandler startFormHandler = formHandlerHelper.getStartFormHandler(commandContext, processDefinition);
        if (startFormHandler == null) {
            throw new FlowableException("No startFormHandler defined in process definition '" + processDefinitionId + "'");
        }

        return startFormHandler.createStartFormData(processDefinition);
    }

}

View on GitHub (pinned to d6d39ce1c6)