flowable/flowable-engine · error · FlowableIllegalArgumentException

The taskId or processDefinitionId parameter has to be…

Error message

The taskId or processDefinitionId parameter has to be provided

What it means

FormDataResource.getFormData exposes GET /form/form-data and requires exactly one lookup key: either taskId or processDefinitionId. When neither query parameter is supplied, FlowableIllegalArgumentException is thrown because there is nothing to fetch form data for.

Solutions

  1. Add exactly one of ?taskId=<id> or ?processDefinitionId=<id> to the request.
  2. Resolve the id client-side first (query tasks or process definitions) before calling the endpoint.
  3. If both are available, pick the taskId path — sending both raises the companion error (index 3419).
  4. Validate parameters in client code before issuing the request.

Example fix

// before
GET /flowable-rest/service/form/form-data
// after
GET /flowable-rest/service/form/form-data?taskId=125
Defensive patterns

Strategy: validation

Validate before calling

if (taskId == null && processDefinitionId == null) {
    throw new IllegalArgumentException("Provide taskId or processDefinitionId");
}

Try / catch

try { formData = api.getFormData(taskId, null); } catch (FlowableIllegalArgumentException e) { /* check request params */ }

Prevention

When it happens

Trigger: GET /form/form-data with no query parameters at all, or with both parameters absent due to a client bug (e.g. null/empty values dropped before the request).

Common situations: Hand-built REST URLs missing the query string, templated client calls where variables were not interpolated, or API explorers sending the path without params.

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

Appendix: source

Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/form/FormDataResource.java:69

    @Autowired
    protected RestResponseFactory restResponseFactory;

    @Autowired
    protected FormService formService;
    
    @Autowired(required=false)
    protected BpmnRestApiInterceptor restApiInterceptor;

    @ApiOperation(value = "Get form data", tags = { "Forms" }, notes = "")
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Indicates that form data could be queried."),
            @ApiResponse(code = 404, message = "Indicates that form data could not be found.") })
    @GetMapping(value = "/form/form-data", produces = "application/json")
    public FormDataResponse getFormData(@RequestParam(value = "taskId", required = false) String taskId,
            @RequestParam(value = "processDefinitionId", required = false) String processDefinitionId) {

        if (taskId == null && processDefinitionId == null) {
            throw new FlowableIllegalArgumentException("The taskId or processDefinitionId parameter has to be provided");
        }

        if (taskId != null && processDefinitionId != null) {
            throw new FlowableIllegalArgumentException("Not both a taskId and a processDefinitionId parameter can be provided");
        }

        FormData formData = null;
        String id = null;
        if (taskId != null) {
            formData = formService.getTaskFormData(taskId);
            id = taskId;
        } else {
            formData = formService.getStartFormData(processDefinitionId);
            id = processDefinitionId;
        }

        if (formData == null) {
            throw new FlowableObjectNotFoundException("Could not find a form data with id '" + id + "'.", FormData.class);

View on GitHub (pinned to d6d39ce1c6)