IO Mapping to simplify complex responses not working

I am using the newest version of the Zeebe HTTP worker to invoke existing endpoints. We do not control these endpoints so have to deal with the complex structure of data returned.

The Zeebe HTTP worker puts the response of service in a variable called “body”. I am attempting to define a mapping which will take the response from variable “body” and output this into a new variable as follows:

Output mappings:

  1. source: body, target:someComplexResponseModel
  2. source: , target: simplierResponseModel

With these definitions, I get the following incident:

No data found for query

Even though the JSON returned from the service does conform to the structure above.

A couple of questions:

  1. Could someone please help me understand what is going on here? I am using a two step process to clarify intent.
  2. After these mappings have been performed, I am still expected to see the content of “body” in the workflow instance variable stack? Specifically, if this instance of “body” was used as output mapping, should I still be expect to see the exact value in the variable stack?

Hi @klaus.nji,

I’m sorry but I have problems to follow your problem. Please discuss the behavior with your concrete example.

Which JSON does the HTTP service returns?
Which variables are returned by the worker?
What output and input mappings are defined on the task?
Which variables do you expect in the workflow instance?

Best regards,

1 Like

@philipp.ossler, thanks for responding.

I cannot share the internals of the JSON returned but the snapshot posted above gives the overall structure. The worker returns the correct JSON but the failure is happening during mapping.
I have been able to get around the error with this change to the output mapping:

            <zeebe:output source="" target="orgCreationProgressResponseData" />

If instead I did this:

            <zeebe:output source="body" target="orgCreationProgressResponse" />
            <zeebe:output source="" target="orgCreationProgressResponseData" />

I experience the error “No data found for query”

This deals with the first question. The second question is still pending though:

If I have a mapping like this:

            <zeebe:output source="body" target="orgCreationProgressResponseData" />

What does Zeebe do with the original data variable called body? Does it discard this?

This mapping does not work because the source does not reference a variable from the job complete command. It is not possible to use a variable that is created by a previous target mapping.

Yes. If the task has an output mapping then only the defined variables are propagated. The other variables are discarded.

Please have a look at the docs:

Does this help you?

Ah… think I got that now:

This mapping does not work because the source does not reference a variable from the job complete command

The mapping

  <zeebe:output source="" target="orgCreationProgressResponseData" />

The http task returned a statusCode and a body as variables and not .

I was thinking that the first mapping

<zeebe:output source="body" target="orgCreationProgressResponse" />

Would create this new variable called orgCreationProgressResponse and make this available to the second mapping.

Now I wonder how this was working before the changes.

Thanks for clarifying.

1 Like