Variables in payload

Good day,

Is it possible to convert execution.getVariables() into JSON and specify it as a variable in the payload of a message in this form?

“allVariables”: {
“value”: “${execution.getVariables()???}”,
“type”: { “Object”,
“valueInfo” : {
“objectTypeName”: “org.camunda.bpm.engine.variable.impl.VariableMapImpl”,
“serializationDataFormat”: “application/x-java-serialized-object”
}
}

Many thanks
Frank

Hi @camfomd, you may want to have a look at Camunda’s Spin Library for things like JSON handling, see [Camunda Spin Dataformat Reference | docs.camunda.org]