# Workflow using rasa api

**URL:** <https://forum.rasa.com/t/workflow-using-rasa-api/35864>\
**Category:** Rasa Open Source\
**Created:** [October 14, 2020, 7:00am UTC](https://forum.rasa.com/t/workflow-using-rasa-api/35864 "2020-10-14T07:00:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![laujen](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/laujen/32/11145_2.png) [@laujen](https://forum.rasa.com/u/laujen)\
**Post date:** [October 14, 2020, 7:00am UTC](https://forum.rasa.com/t/workflow-using-rasa-api/35864/1 "2020-10-14T07:00:12Z")

</div>

I’m new to rasa trying to setup the communication between a nodejs backend and rasa.

There are some things I’m not sure about:

when a new message is sent I am using the

/conversations/${conversation.\_id}/messages

to post data such as:

```
 {
   text: values.message,
   sender: "user",
 }

```

then in this step I’m sure I’m afraid I’m doing something wrong. First I post another request to predict the next step:

```
 axios.post(`http://localhost:5005/conversations/${patient._id}/predict`)

```

I take the response with the highest score and send it to `trigger_intent`:

```
 .then(res=>{
 const resType = res.data.scores[0].action
 const data = {
     name: resType.slice(6)
}

```

I finally post the `data` to `trigger_intent`.

I assume, because I’m slicing the part `utter_` from `utter_greet`, that I am doing something stupidly wrong in the whole process.

What would be the correct way to implement a new message - new reply flow using the api?

thanks a lot!
