# Http task and NodeJs

**URL:** <https://forum.flowable.org/t/http-task-and-nodejs/4647>\
**Category:** Flowable Engine\
**Created:** [October 7, 2019, 10:34am UTC](https://forum.flowable.org/t/http-task-and-nodejs/4647 "2019-10-07T10:34:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![elc](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@elc](https://forum.flowable.org/u/elc)\
**Post date:** [October 7, 2019, 10:34am UTC](https://forum.flowable.org/t/http-task-and-nodejs/4647/1 "2019-10-07T10:34:02Z")

</div>

I drew a process workflow in which there is an http task. This http task contains a requestUrl containing hardcode and also variables (for example https: // car / $ {car\_number}. When I want to start process by posting in the url [http://localhost:8080/flowable-task/app/rest/process-instances](http://localhost:8080/flowable-task/app/rest/process-instances), and include a body with the name and the processDefinitionId, I get 500: Internal Server Error. The problem is ( as described in the docker container): Caused by: org.apache.http.client.ClientProtocolException: URI does not specify a valid host name: https: // car /.  
How can I get start process and give it a value for car\_id so that he goes to the right url?

---

<div class="post-metadata">

**Author:** ![wwitt](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/wwitt/32/706_2.png) [@wwitt](https://forum.flowable.org/u/wwitt)\
**Post date:** [October 7, 2019, 10:48am UTC](https://forum.flowable.org/t/http-task-and-nodejs/4647/2 "2019-10-07T10:48:09Z")

</div>

Are there spaces in your URL as shown in in the message? `https: // car /` is not a valid hostname, but `https://car/` would attempt to connect to the host `car`.

As far as giving it an id, `${car_number}` will attempt to dereference a process or task variable called `car_number`, you would need to add the variable to the process.

---

<div class="post-metadata">

**Author:** ![elc](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@elc](https://forum.flowable.org/u/elc)\
**Post date:** [October 7, 2019, 10:48am UTC](https://forum.flowable.org/t/http-task-and-nodejs/4647/3 "2019-10-07T10:48:51Z")

</div>

There is not the probleme, only copy/paste typo

---

<div class="post-metadata">

**Author:** ![wwitt](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/wwitt/32/706_2.png) [@wwitt](https://forum.flowable.org/u/wwitt)\
**Post date:** [October 7, 2019, 10:51am UTC](https://forum.flowable.org/t/http-task-and-nodejs/4647/4 "2019-10-07T10:51:36Z")

</div>

I suspected. The message was incomplete when I posted. See my reply about the variable, there are several methods to add a variable to a process, sepending on how you are starting the process.

---

<div class="post-metadata">

**Author:** ![elc](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@elc](https://forum.flowable.org/u/elc)\
**Post date:** [October 7, 2019, 10:53am UTC](https://forum.flowable.org/t/http-task-and-nodejs/4647/5 "2019-10-07T10:53:46Z")

</div>

How can I add variable to the process? I you mean that I have to add in the body object : variables: [{car\_id: 1}] for exemple, there is not work

---

<div class="post-metadata">

**Author:** ![wwitt](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/wwitt/32/706_2.png) [@wwitt](https://forum.flowable.org/u/wwitt)\
**Post date:** [October 7, 2019, 3:09pm UTC](https://forum.flowable.org/t/http-task-and-nodejs/4647/6 "2019-10-07T15:09:42Z")

</div>

How are you starting the process? If you are using the Java API, you can pass in the process variables as a map when you create the process instance. You could also collect the ID using a start form or form on a user task. If you are using the REST API, you’d add something like this to the body when you post to /runtime/process-instances

```auto
  "variables": [
    {
      "name": "car_id",
      "type": "integer",
      "value": "1",
    }
  ]

```

But if the variable name is `car_id` then your HTTP Task would call out to `https://car/${car_id}` (vs. `${car_number}`)
