first, welcome to the Zeebe community
Yes, it is possible to collect the variables of incoming messages. There are different ways on how to do this:
- using a job worker to collect the variables (as @salaboy suggested)
- using variable mappings in the workflow, for example, an output mapping on the message catch event
Output mappings can be used to create or update variables. The value of the variable is calculated by a FEEL expression.
The FEEL function
append(list, item) can be used to append an item to an existing list.
source: =append(payloads, messagePayload)
payloads should be created as an empty list before.
Example workflow: https://gist.github.com/saig0/9ac77f0f6abe7a75bfb3a0f9fe79a924
In any case, the variable should not get too big. If the variable size is greater than 1 MB or the list contains a lot of items then you should think of store it externally.