How to Implement Multi-Instance Execution in Camunda?

Hi everyone,

I’m working on a Camunda 7 BPMN process to create a multi-level approval workflow using multi-instance tasks. The goal is to handle approvals across four levels, looping through a list of approvers provided at process start via REST. Each approver performs a task either sequentially or in parallel, based on the specified instance type.

type or paste code here

Current Setup

  1. Approver Collection: I defined the approvers in JSON format for the multi-instance configuration.
  2. BPMN Task Configuration: Set up to iterate over each approver.
  3. Issue: On starting the process, I get an error stating the variable isn’t recognized as a valid ‘Collection’ type, despite trying List and Json formats.

Completion Condition in BPMN
I’ve also configured a completion condition:
approve-work-bpm.bpmn (15.2 KB)

${approvalStatus == "reject" || (approvalStatus == "approve" && loopCounter >= approverList.size())}

This ends the task loop if:

  • Any approver rejects (immediate loop end), or
  • All required approvals are complete (approvalStatus == "approve" and loopCounter matches the number of approvers).

Request
Could anyone help with how to implement the above workflow also with structuring the collection variable properly for Camunda’s requirements? Any tips or examples for a multi-instance task setup with a list would be greatly appreciated! I’ve reviewed Camunda’s documentation, but it hasn’t fully addressed my issue.

Thank you!
MultiApprovers.bpmn (6.9 KB)

approve-work-bpm.bpmn (15.2 KB)

Also, here is the JSON body l am sending when starting the process:

{
  "variables": {
 
    "instanceType": {
      "value": "parallel",
      "type": "String"
    },

  "approverList": {
    "value": [
      {
        "id": 1,
        "email": "asd",
        "approversName": "asd",
        "approvalStatus": "approve"
      },

      {
        "id": 2,
        "email": "another@example.com",
        "approversName": "Another Approver",
        "approvalStatus": "pending"
      }
    ],
    // "type": "json",
    "valueInfo": {
      "objectTypeName": "java.util.ArrayList",
      "serializationDataFormat": "application/json"
    }
  }
}

  }

and this is the error l am getting at the moment:

Cannot instantiate process definition MultipleInstanceTest:11:0dd78d8b-95c9-11ef-ad3f-3a90b70aedbd: ENGINE-02025 Variable 'approverList' is not of the expected type 'Collection'. [ start-instance-error ]

Generally, l would appreciate it if anyone can assist on configuring the multi-instances properties (for both parallel and sequential) in the Camunda Modeller, also on working with multiple instances using REST to pass the collections. Thank you.