flowable/flowable-engine · error · FlowableObjectNotFoundException

Form with formKey '" + formKey + "' does not exist

Error message

Form with formKey '" + formKey + "' does not exist

What it means

Thrown by JuelFormEngine.getFormTemplateString when the resource identified by the form key does not exist in the deployment that owns the form data. Flowable looks up the template file (e.g. a JUEL/HTML form) by deployment id + resource name and throws FlowableObjectNotFoundException when no resource row matches.

Solutions

  1. Ensure the form template file is included in the deployment (BAR) and matches the formKey exactly (case-sensitive path)
  2. Fix the flowable:formKey / formKey reference to the actual resource name
  3. Redeploy the application including the missing form resource

Example fix

// before
<flowable:form flowable:key="approv-form" /> // file is approval.form
// after
<flowable:form flowable:key="approval.form" /> <!-- matches deployed resource -->
Defensive patterns

Strategy: validation

Validate before calling

Resource r = repositoryService.getResourceAsStream(deploymentId, formKey); // or check DeploymentQuery/resource exists before rendering

Try / catch

try { return formService.getRenderedTaskForm(taskId); } catch (FlowableObjectNotFoundException e) { if (String.class.equals(e.getObjectClass())) { /* fallback form or alert deployment packaging */ } else throw e; }

Prevention

When it happens

Trigger: Calling TaskService.getTaskFormModel / FormService.getRenderedForm with a formKey pointing to a template file not present in the process deployment.

Common situations: Form key typo, template file not packaged in the BAR/deployment, deploying the process without the form resource, or renaming the file after the key was authored.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — 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/1de6a960cbedd673. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/form/JuelFormEngine.java:79

        ExecutionEntity executionEntity = null;
        if (task.getExecutionId() != null) {
            executionEntity = CommandContextUtil.getExecutionEntityManager().findById(task.getExecutionId());
        }

        ScriptEngineRequest.Builder builder = ScriptEngineRequest.builder()
                .script(formTemplateString)
                .language(ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE)
                .scopeContainer(executionEntity);
        return scriptingEngines.evaluate(builder.build()).getResult();
    }

    protected String getFormTemplateString(FormData formInstance, String formKey) {
        String deploymentId = formInstance.getDeploymentId();

        ResourceEntity resourceStream = CommandContextUtil.getResourceEntityManager().findResourceByDeploymentIdAndResourceName(deploymentId, formKey);

        if (resourceStream == null) {
            throw new FlowableObjectNotFoundException("Form with formKey '" + formKey + "' does not exist", String.class);
        }

        return new String(resourceStream.getBytes(), StandardCharsets.UTF_8);
    }
}

View on GitHub (pinned to d6d39ce1c6)