diff --git a/src/Worker/CamundaWorker.php b/src/Worker/CamundaWorker.php index a04ed69..7c71c2b 100644 --- a/src/Worker/CamundaWorker.php +++ b/src/Worker/CamundaWorker.php @@ -133,6 +133,11 @@ public function pushResponse(array $request, array $response): void } $body['variables'][$k] = $variable; } + if (count($body['variables'])==0) { + // avoid deserialisation problems. + // camunda expects an object, not an array. php serialises empty objects as empty array + unset($body['variables']); + } } $res = $this->request('POST', '/external-task/' . $request['id'] . '/complete', $body); } else {