# How to create custom policy?

**URL:** <https://forum.rasa.com/t/how-to-create-custom-policy/32663>\
**Category:** Rasa Open Source\
**Created:** [August 17, 2020, 11:52am UTC](https://forum.rasa.com/t/how-to-create-custom-policy/32663 "2020-08-17T11:52:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wyd](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@wyd](https://forum.rasa.com/u/wyd)\
**Post date:** [August 17, 2020, 11:52am UTC](https://forum.rasa.com/t/how-to-create-custom-policy/32663/1 "2020-08-17T11:52:29Z")

</div>

Hey, I need to create a custom policy. However there is no example on rasa docs of custom policy.

> **[Policies](https://rasa.com/docs/rasa/policies/)**

Could you please provide a working custom policy? The point I am trying to achieve is basically this: if custom slot is set, go for custom action. Otherwise follow other policies.

Thanks!

---

<div class="post-metadata">

**Author:** ![Gehova](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Gehova](https://forum.rasa.com/u/Gehova)\
**Post date:** [August 17, 2020, 1:42pm UTC](https://forum.rasa.com/t/how-to-create-custom-policy/32663/2 "2020-08-17T13:42:57Z")

</div>

If your slot is set in a custom action, you can use the event [FollowupAction](https://rasa.com/docs/rasa/api/events/#force-a-followup-action).

---

<div class="post-metadata">

**Author:** ![wyd](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@wyd](https://forum.rasa.com/u/wyd)\
**Post date:** [August 17, 2020, 7:19pm UTC](https://forum.rasa.com/t/how-to-create-custom-policy/32663/3 "2020-08-17T19:19:06Z")

</div>

Thanks but thats not even quite answer to my question. I want to have a policy to run specific action (which will be checking the slot and running multiple times after user’s input), not followup action (running just once and not reacting to user’s input).

I can solve this either with forms (which is not a clean way) or with policy (which is the way I wanna go).

---

<div class="post-metadata">

**Author:** ![Gehova](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Gehova](https://forum.rasa.com/u/Gehova)\
**Post date:** [August 18, 2020, 2:05pm UTC](https://forum.rasa.com/t/how-to-create-custom-policy/32663/4 "2020-08-18T14:05:53Z")

</div>

Can you write a pair of toy example stories? With/without the slot, so it’s more clear what you want to accomplish.
