# How to add a delay in between 2 function call in custom action

**URL:** <https://forum.rasa.com/t/how-to-add-a-delay-in-between-2-function-call-in-custom-action/47589>\
**Category:** Rasa Open Source\
**Created:** [September 8, 2021, 5:50pm UTC](https://forum.rasa.com/t/how-to-add-a-delay-in-between-2-function-call-in-custom-action/47589 "2021-09-08T17:50:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gourav1212](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/gourav1212/32/19495_2.png) [@gourav1212](https://forum.rasa.com/u/gourav1212)\
**Post date:** [September 8, 2021, 5:50pm UTC](https://forum.rasa.com/t/how-to-add-a-delay-in-between-2-function-call-in-custom-action/47589/1 "2021-09-08T17:50:06Z")

</div>

Hi all,

I am trying to add a delay between the message and the opening the link, but I am not able to do so using the Time.sleep() function in python.

How can I add a delay b/w the message and the (webbrowser.open(url))opening the link in new tab.

**what is happening–\> The url opens in the new tab then the message gets delevered in the bot**** what I want to do–\> get the message and after 5 sec open the url.**

Thanks in Advance… _Please help me to sort this out_

class ActionLink(Action):

```
def name(self) -> Text:

    return "action_link"

def run(self, dispatcher: CollectingDispatcher,

        tracker: Tracker,

        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

         entities = tracker.latest_message['entities']

         print(entities)

         Intent = tracker.latest_message['intent']['name']

         print(Intent)
         for e in entities:

             if e['entity'] == 'Solution_type_datascience' :

                 url = "http://forum.rasa.com/"

                 dispatcher.utter_message(text="Taking you to the data science page. The page will open in the new tab. Happy to help. 😄 ")

                 dispatcher.utter_message(text="Taking you to the data science source page")
                 
                 webbrowser.open(url)

             if e['entity'] == 'Solution_type_conversational_ai' :

                 url = "http://forum.rasa.com/"

                 dispatcher.utter_message(text="Taking you to the conversation ai page. The page will open in the new tab. Happy to help. 😄 ")

                time.sleep(5)

                 webbrowser.open(url)
         return []
```

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [September 8, 2021, 6:45pm UTC](https://forum.rasa.com/t/how-to-add-a-delay-in-between-2-function-call-in-custom-action/47589/2 "2021-09-08T18:45:47Z")

</div>

Hello!

Take a look at [Reminders](https://rasa.com/docs/rasa/reaching-out-to-user/#reminders).

---

<div class="post-metadata">

**Author:** ![gourav1212](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/gourav1212/32/19495_2.png) [@gourav1212](https://forum.rasa.com/u/gourav1212)\
**Post date:** [September 9, 2021, 6:40am UTC](https://forum.rasa.com/t/how-to-add-a-delay-in-between-2-function-call-in-custom-action/47589/3 "2021-09-09T06:40:25Z")

</div>

Hi @ChrisRahme ,

Thanks for the help, It did the trick.

Regards, Gourav

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [September 9, 2021, 7:48am UTC](https://forum.rasa.com/t/how-to-add-a-delay-in-between-2-function-call-in-custom-action/47589/4 "2021-09-09T07:48:59Z")

</div>

Glad to know 🙂 Please close the thread by marking the solution
