How to pass variables from one task to another?

How to pass different variables defined in one task to another?

Here I am getting a payload from a GitHub webhook and I want to send that to another REST endpoint.


Hello Chalindru,

As you can see, you have in your Github Webhook start event a section called Variable Mapping. This contains a field called Result expression that can be used to map your response from Github Webhook into 1 or multiple process variables.

To access those process variables in the Service Task - REST Connector payload, you need to use a FEEL Expression.

  • Click on the fx which appears near Request body word. This will turn the field into a expression instead

  • Now, use the process variables as you want in the payload. Example:
    { “whateveryouwant”: response } where response is what you are storing as request.body in the previous step

Another example is:

  • In the Github Webhook Start Event, map { actions: request.body.request.message}

  • In the REST activity { “git-actions” : actions }

I hope this helps.

Thank you.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.