# How to let bot start the conversation

**URL:** <https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866>\
**Category:** Rasa Open Source\
**Created:** [November 4, 2019, 2:21pm UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866 "2019-11-04T14:21:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asmacats](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/asmacats/32/21372_2.png) [@Asmacats](https://forum.rasa.com/u/Asmacats)\
**Post date:** [November 4, 2019, 2:21pm UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/1 "2019-11-04T14:21:32Z")

</div>

Hi all,

Using the latest rasa version, i would like to know if there ara some ways to let the bot start the conversation.

Can we start with an utterance instead of action\_listen?

Thanks

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [November 4, 2019, 3:32pm UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/2 "2019-11-04T15:32:16Z")

</div>

Hi @Asmacats, You can use the below api to trigger an event when ever user opens the chat window

> [http://localhost:5005/conversations/{conversation\_id}/execute](http://localhost:5005/conversations/%7Bconversation_id%7D/execute)

[Rasa Documentation](https://rasa.com/docs/rasa/api/http-api/#operation/executeConversationAction)

Note that you will require conversation\_id

---

<div class="post-metadata">

**Author:** ![Asmacats](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/asmacats/32/21372_2.png) [@Asmacats](https://forum.rasa.com/u/Asmacats)\
**Post date:** [November 4, 2019, 4:11pm UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/3 "2019-11-04T16:11:22Z")

</div>

@JiteshGaikwad Thanks for your response. But i dont understand how to use it? in which file i have to put it? and how to get automatically the conversation id.

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [November 5, 2019, 4:57am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/5 "2019-11-05T04:57:16Z")

</div>

hi @Asmacats, In my case what I had done was:

- I had written a custom action that will send the greeting message
- then I had configured the event i.e whenever the user will open the chatbot widget(webpage), I am sending an event to the bot that will trigger the custom actions and it will greet the user

attaching the sample code for your references:

> `actions.py` file ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/f/f0d0670b88ff0783b7fea6eb8c134311fb2abc03.png)

make sure you return the action with `UserUtteranceReverted()`event, so that it won’t affect the conversation flow

> `script.js` file(this is the custom webpage widget build using jquery)
> 
> ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/0/053f447f2d1c381113637ac827a46e0f62d375c2.png)

here If you see while calling the REST api, I am passing the `user_id` as the `conversation_id`

> output:

![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/6/60978c09f1719c37a093cd8ab91eb01cf9530d9f.png)

Hope this helps you 😉

---

<div class="post-metadata">

**Author:** ![Asmacats](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/asmacats/32/21372_2.png) [@Asmacats](https://forum.rasa.com/u/Asmacats)\
**Post date:** [November 5, 2019, 8:42am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/6 "2019-11-05T08:42:28Z")

</div>

@JiteshGaikwad thanks for your reponses. are you used this solution in case of channel connexion??

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [November 5, 2019, 8:43am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/7 "2019-11-05T08:43:54Z")

</div>

@Asmacats, I have used this in the . Rasa’s `rest` channel

---

<div class="post-metadata">

**Author:** ![SagarThengadi](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@SagarThengadi](https://forum.rasa.com/u/SagarThengadi)\
**Post date:** [December 20, 2019, 1:13pm UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/8 "2019-12-20T13:13:54Z")

</div>

I have used this but conversation/tracker store in mongodb as a same conversation\_id. so, when I open new conversation tab but all conversation is append on same conversation\_id. So, how can we store diffrent conversation with diffrent conversation\_id?

---

<div class="post-metadata">

**Author:** ![1000sprites](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/1000sprites/32/23615_2.png) [@1000sprites](https://forum.rasa.com/u/1000sprites)\
**Post date:** [December 21, 2019, 4:12am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/9 "2019-12-21T04:12:44Z")

</div>

I try it, but the response data is null, what happens? thanks

---

<div class="post-metadata">

**Author:** ![Wy0024](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@Wy0024](https://forum.rasa.com/u/Wy0024)\
**Post date:** [February 11, 2020, 2:03am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/10 "2020-02-11T02:03:02Z")

</div>

Hi @JiteshGaikwad, thanks for sharing this info. However, i ran into some issue whereby i couldn’t make the `action_greet_user` to initiate upon starting the conversation UI. How can i debug this and see where i made a mistake ? There is no error on the browser console, and i have added `action_greet_user` as a custom action inside `actions.py` .

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [February 11, 2020, 5:14am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/11 "2020-02-11T05:14:11Z")

</div>

hey @Wy0024, can you show me the logs of the Rasa Core server.

---

<div class="post-metadata">

**Author:** ![Wy0024](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@Wy0024](https://forum.rasa.com/u/Wy0024)\
**Post date:** [February 13, 2020, 2:15am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/12 "2020-02-13T02:15:17Z")

</div>

Hi @JiteshGaikwad, i took a slight detour and dive into another [webchat integration](https://github.com/botfront/rasa-webchat) and the bot conversation initiation went well.

Anyways, back to this, attaching my screenshot as below and do let me know if you notice any problem. It seems like there is some work to be done on the events perhaps? FYI, i am following the tutorial from one of your HR bot repo [here](https://github.com/JiteshGaikwad/HR_Bot)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/b/b89541482b43d1064826c8469c02c8940a192f16.png)

Thanks!

---

<div class="post-metadata">

**Author:** ![Wy0024](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@Wy0024](https://forum.rasa.com/u/Wy0024)\
**Post date:** [February 13, 2020, 2:53am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/13 "2020-02-13T02:53:40Z")

</div>

Sorry @JiteshGaikwad for the false alert, i just went thru the scripts and notice there are some functions in the js file that has been commented out. After following the instructions, the UI is now able to initiate the starting message. All is good for now. For those out there looking for a solution for this, do take a look into this repo [here](https://github.com/JiteshGaikwad/HR_Bot).

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [February 13, 2020, 3:41am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/14 "2020-02-13T03:41:06Z")

</div>

hey @Wy0024, that’s fine, I am glad that it worked for you well 🙂

---

<div class="post-metadata">

**Author:** ![Wy0024](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@Wy0024](https://forum.rasa.com/u/Wy0024)\
**Post date:** [February 13, 2020, 4:00am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/15 "2020-02-13T04:00:18Z")

</div>

Hi @JiteshGaikwad, i have another question, is there a way we can have like a “preview” mode from a dynamically changing url image link? Feel free to redirect me to any relevant post, as i am coming up short in finding any reference on this.

Much Appreciated.

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [February 13, 2020, 4:21am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/16 "2020-02-13T04:21:46Z")

</div>

I didn’t understand what “preview” mode you are talking about, can you please explain me detail? 😅

---

<div class="post-metadata">

**Author:** ![Wy0024](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@Wy0024](https://forum.rasa.com/u/Wy0024)\
**Post date:** [February 13, 2020, 4:32am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/17 "2020-02-13T04:32:17Z")

</div>

Sure, sorry about the lack of background for this. I have an idea of trying to create a bot response that crawls information from a news api and reply with:

- An image (this is a url in the api)
- A title (this is a string)
- A reference link (this is a url)

And i m looking for a way to let the image url to display as an image on the UI, instead of a clickable link (this is what i get in Rasa X). Any ideas i can achieve this ?

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [February 13, 2020, 5:35am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/18 "2020-02-13T05:35:04Z")

</div>

which chatbot UI are you using?

---

<div class="post-metadata">

**Author:** ![Wy0024](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@Wy0024](https://forum.rasa.com/u/Wy0024)\
**Post date:** [February 13, 2020, 5:58am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/19 "2020-02-13T05:58:21Z")

</div>

For now, i have both [webchat](https://github.com/botfront/rasa-webchat) and this [custom](https://github.com/JiteshGaikwad/HR_Bot). At the same time, i have Rasa X ui as well for my interactive training.

---

<div class="post-metadata">

**Author:** ![Malik](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/malik/32/7587_2.png) [@Malik](https://forum.rasa.com/u/Malik)\
**Post date:** [February 17, 2020, 7:10am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/20 "2020-02-17T07:10:55Z")

</div>

Hello jitesh i’m following your code technique but one thing i didn’t understand that your script.js file concept about where in which folder i have to create this file in my rasa chatbot project.

---

<div class="post-metadata">

**Author:** ![Wy0024](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@Wy0024](https://forum.rasa.com/u/Wy0024)\
**Post date:** [February 17, 2020, 8:59am UTC](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866/21 "2020-02-17T08:59:39Z")

</div>

Hey there, for me, i downloaded the repo into my local machine and just hit the index.html file. But before that, i ran both the action server and the model on my IDE. The script.js is not in my chatbot project directory.

Hope this helps !

[Next page](https://forum.rasa.com/t/how-to-let-bot-start-the-conversation/20866.md?page=2)
