Serialisation of Variables updated by external worker

i have a simple process, where I create variable of custom type via java delegate, then I want to read and update the variable via external task worker and as a last step I want to read the update made at step 2.

My service task at step 1 creates properly variable. I can see the variable in cockpit (bot serialized and deserialized). At step 2, inside the worker (spring with camunda-external-task-client) I can fetch the variable and update its values, however when I try to complete the external task with variable:

        externalTaskService.complete(externalTask, Map.of(
                "TASK_BODY", taskBody

at this point the updated variable is saved into process, however it is no longer serialised and therefore can not be read at step 3 with error

SPIN-PLUGIN-01002 Fallback serializer cannot handle deserialized objects

What did I miss? why the value is no longer serialized once external task worker completes the task?

im using Camunda 7.1, camunda-engine-plugin-spin 7.16 and camunda-external-task-client 7.16

Hi @Cynizm

If you have look at the example in this article here: Camunda external tasks — a powerful tool for creating applications with a fault-tolerant and scalable architecture | by Alexandr Kazachenko | IT’s Tinkoff | Medium it is done like this:

 Map<String, Object> variables = new HashMap<>();

variables.put("result", result);
externalTaskService.complete(externalTask, variables);

If Map.of() is a convenience method that returns a HashMap, then the only thing I can think of here is the type of taskBody - what is it?