# Replay actions from tracker

**URL:** <https://forum.rasa.com/t/replay-actions-from-tracker/13848>\
**Category:** Rasa Open Source\
**Created:** [August 2, 2019, 9:22am UTC](https://forum.rasa.com/t/replay-actions-from-tracker/13848 "2019-08-02T09:22:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lena](https://avatars.discourse-cdn.com/v4/letter/l/c68b51/32.png) [@lena](https://forum.rasa.com/u/lena)\
**Post date:** [August 2, 2019, 9:22am UTC](https://forum.rasa.com/t/replay-actions-from-tracker/13848/1 "2019-08-02T09:22:27Z")

</div>

Hi everybody,

I have a question, maybe somebody already has done something similar and knows if it is possible.

For example, i have a conversation, which is a dialogue between user and bot, maybe including some actions, and i extract part of this dialogue from the tracker as list of events.

Now I want to restart the current conversation and simulate it from this list of events, kind of replay all these events, is it possible?

Until now i managed to change the tracker, save events but i don’t see how to push these events to the frontend.

Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![Tobias\_Wochinger](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tobias_wochinger/32/4580_2.png) [@Tobias\_Wochinger](https://forum.rasa.com/u/Tobias_Wochinger)\
**Post date:** [August 5, 2019, 8:23am UTC](https://forum.rasa.com/t/replay-actions-from-tracker/13848/2 "2019-08-05T08:23:18Z")

</div>

Are you using custom actions or the HTTP API?

In case of the HTTPI API: Add a `restart` event as first item to your event list, and then append all the old events of you trackers and send this of events to [HTTP API](https://rasa.com/docs/rasa/api/http-api/#tag/Tracker/paths/~1conversations~1%7Bconversation_id%7D~1tracker~1events/post)

In case of custom actions: `return [Restarted()] + tracker.events`

---

<div class="post-metadata">

**Author:** ![lena](https://avatars.discourse-cdn.com/v4/letter/l/c68b51/32.png) [@lena](https://forum.rasa.com/u/lena)\
**Post date:** [August 5, 2019, 8:48am UTC](https://forum.rasa.com/t/replay-actions-from-tracker/13848/3 "2019-08-05T08:48:19Z")

</div>

Thank you, Tobias! I will try it!

---

<div class="post-metadata">

**Author:** ![lena](https://avatars.discourse-cdn.com/v4/letter/l/c68b51/32.png) [@lena](https://forum.rasa.com/u/lena)\
**Post date:** [August 8, 2019, 7:29am UTC](https://forum.rasa.com/t/replay-actions-from-tracker/13848/4 "2019-08-08T07:29:45Z")

</div>

The offered solution is working fine. But still I have some issues. If I return some action which should trigger another action (according to the mapping policy), it doesn’t work - the returned action doesn’t trigger anything. Is there an issue with the mapping policy in such a case?

Thank you for the help!

---

<div class="post-metadata">

**Author:** ![Tobias\_Wochinger](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tobias_wochinger/32/4580_2.png) [@Tobias\_Wochinger](https://forum.rasa.com/u/Tobias_Wochinger)\
**Post date:** [August 8, 2019, 11:03am UTC](https://forum.rasa.com/t/replay-actions-from-tracker/13848/5 "2019-08-08T11:03:26Z")

</div>

The mappingpolicy makes that certain intents trigger certain actions. It doesn’t let you trigger actions with actions. You could use a `FollowUp` event for that ([Events](https://rasa.com/docs/rasa/api/events/#force-a-followup-action)). Note that you should import the events from the `rasa.sdk.events` and not from `rasa.core`

---

<div class="post-metadata">

**Author:** ![lena](https://avatars.discourse-cdn.com/v4/letter/l/c68b51/32.png) [@lena](https://forum.rasa.com/u/lena)\
**Post date:** [August 9, 2019, 7:51am UTC](https://forum.rasa.com/t/replay-actions-from-tracker/13848/6 "2019-08-09T07:51:38Z")

</div>

Sorry, i was not clear enough in my previous post. Let me make an example:

in my domain.yml I have

> ```
> intents:
> - ask_if_bot:
> triggers: action_bot_answer
> - hello
> - bye
> 
> ```

so if in some run function from actions.py i return

> return [Restarted(), UserUttered(“are you a bot?”)]

the action “action\_bot\_answer” doesn’t get triggered, as if it does when i write the same in the chat. So in this case the mapping policy doesn’t jump in.

---

<div class="post-metadata">

**Author:** ![Tobias\_Wochinger](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tobias_wochinger/32/4580_2.png) [@Tobias\_Wochinger](https://forum.rasa.com/u/Tobias_Wochinger)\
**Post date:** [August 12, 2019, 7:25am UTC](https://forum.rasa.com/t/replay-actions-from-tracker/13848/7 "2019-08-12T07:25:19Z")

</div>

Mhm, I think the idea is to use `FollowupActions` here. Also if you return an event `UserUttered(“are you a bot?”)` this does not trigger another NLU prediction since the event is basically the result of an NLU prediction. But what should work would be

`UserUttered(“are you a bot?”, {"intent": {"name": "ask_if_bot"}})`
