# Forwarding messages to Slack and vice versa for human hand-off

**URL:** <https://forum.rasa.com/t/forwarding-messages-to-slack-and-vice-versa-for-human-hand-off/28447>\
**Category:** Rasa Open Source\
**Created:** [May 5, 2020, 1:10pm UTC](https://forum.rasa.com/t/forwarding-messages-to-slack-and-vice-versa-for-human-hand-off/28447 "2020-05-05T13:10:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![chkoss](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chkoss/32/7186_2.png) [@chkoss](https://forum.rasa.com/u/chkoss)\
**Post date:** [May 7, 2020, 4:12pm UTC](https://forum.rasa.com/t/forwarding-messages-to-slack-and-vice-versa-for-human-hand-off/28447/2 "2020-05-07T16:12:27Z")

</div>

Hi, one possible way to accomplish that would be the following:

> [@Handing off to Human agent](http://forum.rasa.com/t/handing-off-to-human-agent/21528/13):
>
> A reliable way of accomplishing without switching the frontend for routing messages (which is a good way of going about it) would be defining your own policy in addition to a custom action to facilitate the communication. Give the policy the highest priority in your configuration and let it predict the action when a certain slot is triggered like handoff\_active. After you are done talking with the human agent you can unset the slot to finish the story and optionally predict some follow-up actio…

So this means you

- have one action `action_human_handoff` like you suggest above. In addition to what it does already, have it set a slot like `handoff_active`.
- add a policy like described in the post I linked

And then for sending messages back and forth between the user and the human support, you could implement another custom action like `action_talk_to_human` which your policy always predicts while the `handoff_active` slot is set. The action `action_talk_to_human` could e.g. use the [Slack API for sending messages](https://api.slack.com/messaging/sending#threading) to send the last message from the user as a reply to the thread that was started by `action_human_handoff`, use the [Slack API for retrieving messages](https://api.slack.com/messaging/retrieving#pulling_threads) to get the answer that is sent by the human support, and then forward this answer to the user.

Once the hand-off is no longer required, the human support should send a specific message, e.g. `/handback`. The action `action_talk_to_human` needs to recognise this and unset the slot `handoff_active`.

Hope that helps, let me know if you have more questions.

---

_[View the full topic](https://forum.rasa.com/t/forwarding-messages-to-slack-and-vice-versa-for-human-hand-off/28447)._
