# Chain 2 or more HTTPTask call

**URL:** <https://forum.flowable.org/t/chain-2-or-more-httptask-call/1749>\
**Category:** Flowable Engine\
**Created:** [March 14, 2018, 9:53am UTC](https://forum.flowable.org/t/chain-2-or-more-httptask-call/1749 "2018-03-14T09:53:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarcasigan](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@sarcasigan](https://forum.flowable.org/u/sarcasigan)\
**Post date:** [March 14, 2018, 9:53am UTC](https://forum.flowable.org/t/chain-2-or-more-httptask-call/1749/1 "2018-03-14T09:53:37Z")

</div>

How to chain 2 HTTPTask call together in 1 process instance call, how to pass from 1 HTTPTask (GET restful method call) response as request body of the 2nd HTTPTask (POST restful method call)?  
This is for the bpmn20.xml.

---

<div class="post-metadata">

**Author:** ![arpit.agrawal](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@arpit.agrawal](https://forum.flowable.org/u/arpit.agrawal)\
**Post date:** [March 16, 2018, 12:26pm UTC](https://forum.flowable.org/t/chain-2-or-more-httptask-call/1749/2 "2018-03-16T12:26:27Z")

</div>

Hi,

You can put 2 HTTP Task in sequence. 1st once can be a GET call. The response of that task will be saved as string in a response variable of your choice. Now in 2nd HTTP Task with POST call, in request body you can use the variable as EL expression as mentioned [here](https://www.flowable.org/docs/userguide/index.html#bpmnHttpTaskConfiguration).

Hope this helps.

Note : Response of the 1st HTTP call is saved as string. So if you need to modify the response, you need to write a parser and again save it to the process variable otherwise i think you can directly use the response in 2nd call.

Thank You,

---

<div class="post-metadata">

**Author:** ![sarcasigan](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@sarcasigan](https://forum.flowable.org/u/sarcasigan)\
**Post date:** [March 16, 2018, 12:29pm UTC](https://forum.flowable.org/t/chain-2-or-more-httptask-call/1749/3 "2018-03-16T12:29:41Z")

</div>

Thanks for the reply.

How can i do the following:

> [@arpit.agrawal](#):
>
> The response of that task will be saved as string in a response variable of your choice.

How to save response to response variable? Do you have a sample code snippet to show how this is done?

---

<div class="post-metadata">

**Author:** ![arpit.agrawal](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@arpit.agrawal](https://forum.flowable.org/u/arpit.agrawal)\
**Post date:** [March 17, 2018, 6:17pm UTC](https://forum.flowable.org/t/chain-2-or-more-httptask-call/1749/4 "2018-03-17T18:17:27Z")

</div>

Hi,

In the modeler itself, when you are defining the HTTP Task, their is an attribute by the name “Response Variable Name”. You can set the name of the variable.

![00%20PM](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/flowable/original/1X/8651181ca21fbeb8231d4996e1a33992bd2f3912.png)

Thank You,  
Arpit

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [March 17, 2018, 7:00pm UTC](https://forum.flowable.org/t/chain-2-or-more-httptask-call/1749/5 "2018-03-17T19:00:40Z")

</div>

FYI, in the current master branch (not yet released), there is improved support for storing the json response directly as an ObjectNode and storing it transiently. See [https://github.com/flowable/flowable-engine/blob/f98a8c381eac0fec8517492c51769f4143db6c91/modules/flowable-http/src/test/resources/org/flowable/http/bpmn/HttpServiceTaskTest.testTransientJsonResponseVariable.bpmn20.xml](https://github.com/flowable/flowable-engine/blob/f98a8c381eac0fec8517492c51769f4143db6c91/modules/flowable-http/src/test/resources/org/flowable/http/bpmn/HttpServiceTaskTest.testTransientJsonResponseVariable.bpmn20.xml)
