# Why PauseConversation, pause all the bot?

**URL:** <https://forum.rasa.com/t/why-pauseconversation-pause-all-the-bot/25021>\
**Category:** Rasa Open Source\
**Created:** [February 19, 2020, 6:39pm UTC](https://forum.rasa.com/t/why-pauseconversation-pause-all-the-bot/25021 "2020-02-19T18:39:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicanor](https://avatars.discourse-cdn.com/v4/letter/n/ea666f/32.png) [@Nicanor](https://forum.rasa.com/u/Nicanor)\
**Post date:** [February 19, 2020, 6:39pm UTC](https://forum.rasa.com/t/why-pauseconversation-pause-all-the-bot/25021/1 "2020-02-19T18:39:59Z")

</div>

Hello!

I’m trying to implement hand off to human agent, but when i pause conversation. The event pause ALL the bot and not only the single conversation. Any ideas guys? What I need is that RASA acts as a “channel” between the messages of the human agent and the user, but that said conversation did not pause the rest of other users’ requests. make me understand?

---

<div class="post-metadata">

**Author:** ![Nicanor](https://avatars.discourse-cdn.com/v4/letter/n/ea666f/32.png) [@Nicanor](https://forum.rasa.com/u/Nicanor)\
**Post date:** [February 20, 2020, 10:09am UTC](https://forum.rasa.com/t/why-pauseconversation-pause-all-the-bot/25021/2 "2020-02-20T10:09:15Z")

</div>

Now, I have compiled the problems well so that we can work on this

We have 3problems:

First. For some reason the tracker.update function does not work and only using ConversationPause stops ALL the bot. We must solve that so that it only stops the conversation. It’s key.

Second. the sender\_id when connected by channels of the rest api is reduced to “username” so it could not be tracked. Example using Telegram there is no problem, but if there is with WhatsApp Busines for example. This should be a minor problem.

Third. The bot despite being pausing, CONTINUES TO LISTEN and THEN RESPONSES when the action is over. Therefore, in the case of moving a human agent and ending the conversation, then he would respond incorrectly with all the entries.

---

<div class="post-metadata">

**Author:** ![akelad](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akelad/32/69_2.png) [@akelad](https://forum.rasa.com/u/akelad)\
**Post date:** [February 24, 2020, 9:54am UTC](https://forum.rasa.com/t/why-pauseconversation-pause-all-the-bot/25021/3 "2020-02-24T09:54:10Z")

</div>

Hey @Nicanor, could you show me how you’re sending the `ConversationPaused()` at the moment?

---

<div class="post-metadata">

**Author:** ![Nicanor](https://avatars.discourse-cdn.com/v4/letter/n/ea666f/32.png) [@Nicanor](https://forum.rasa.com/u/Nicanor)\
**Post date:** [February 24, 2020, 4:25pm UTC](https://forum.rasa.com/t/why-pauseconversation-pause-all-the-bot/25021/4 "2020-02-24T16:25:42Z")

</div>

Hello, I have made some changes to my code and now the first problem is solved. ConversationPause stop just de conversation. I think the third problem could be solved too (i have to create a ConversationResume in the code, i dont know if i must do in the same actions or not). However the second problem I could not solve it, the tracker id shows “username” when connected by rest api.

Thanks

class ActionTalkToHuman(Action):

```
def name(self):
    return "action_talk_to_human"

def run(self, dispatcher, tracker, domain):
    response = "Reaching out to a human agent [{}]...".format(tracker.sender_id)
    dispatcher.utter_message(response)

    ConversationPaused()
    #message = ConversationPaused()['event']
    message = "pause"

    while message == "pause":
        url = "https://80f8560f.ngrok.io/" #.format(tracker.sender_id)
        req = requests.get(url)
        #resp = json.loads(req.text)
        if "error" in req:
            raise Exception("Error fetching message: " +
                            repr(resp["error"]))
        if message == "pause":
            dispatcher.utter_message("Human agent: {}".format(req.text))
            break

    return [ConversationResumed()]
```

---

<div class="post-metadata">

**Author:** ![mloubser](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/mloubser/32/13021_2.png) [@mloubser](https://forum.rasa.com/u/mloubser)\
**Post date:** [February 24, 2020, 7:32pm UTC](https://forum.rasa.com/t/why-pauseconversation-pause-all-the-bot/25021/5 "2020-02-24T19:32:41Z")

</div>

hi @Nicanor, it looks like in your `while` loop, it will break out of the loop after the first user request every time. What happens if you remove the `break` ? You could then add a condition to change the value of `message` when you actually want to break out of the loop (and hence `return [ConversationResumed()]`)

---

<div class="post-metadata">

**Author:** ![Nicanor](https://avatars.discourse-cdn.com/v4/letter/n/ea666f/32.png) [@Nicanor](https://forum.rasa.com/u/Nicanor)\
**Post date:** [February 25, 2020, 1:16am UTC](https://forum.rasa.com/t/why-pauseconversation-pause-all-the-bot/25021/6 "2020-02-25T01:16:28Z")

</div>

@mloubser @akelad

OK, Well ConversationPause and Resumed are ok. I have to test the code but I think it works. In rasa x when it is pausing, the messages keep coming and listening, when the conversation is resumed rasa will respond late to the messages or not? because the idea is that rasa ignore it

---

<div class="post-metadata">

**Author:** ![mloubser](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/mloubser/32/13021_2.png) [@mloubser](https://forum.rasa.com/u/mloubser)\
**Post date:** [February 25, 2020, 6:17pm UTC](https://forum.rasa.com/t/why-pauseconversation-pause-all-the-bot/25021/7 "2020-02-25T18:17:03Z")

</div>

Rasa will ignore messages that occur while the conversation is paused; it should only respond to those that happen after the conversation is resumed.

---

<div class="post-metadata">

**Author:** ![piyush](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@piyush](https://forum.rasa.com/u/piyush)\
**Post date:** [March 25, 2022, 4:57am UTC](https://forum.rasa.com/t/why-pauseconversation-pause-all-the-bot/25021/8 "2022-03-25T04:57:41Z")

</div>

Hi @Nicanor, Were you able to implement human handoff successfully. I am trying the same using WhatsApp channel. Any help is highly appreciated. Thanking in advance.

---

<div class="post-metadata">

**Author:** ![piyush](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@piyush](https://forum.rasa.com/u/piyush)\
**Post date:** [March 25, 2022, 4:10pm UTC](https://forum.rasa.com/t/why-pauseconversation-pause-all-the-bot/25021/9 "2022-03-25T16:10:21Z")

</div>

Hi, @akelad the while loop is running just once. I have removed the break statement a suggested in previous comment but still the while loop gets break. How can i solve this.
