Is there a way to create a time based trigger?

(Andrew Garkavyi) #1

I’m trying to run an action via bot that should be triggered based on time.
For example execute flow and post result via bot to certain Slack channel.

Simplest way to do so is to have a time trigger but I can’t find anything close. Is there a way to simulate the same behavior or what are the options?

(John Jackson) #2

We have a wait action, which will either wait n minutes, hours or days, or wait until a specific date, before moving on and doing the next action. Plus there’s actually a kind of a hack using that to make a trigger every week, or every day at 9am for example. It’s not difficult to implement, but we don’t current have a schedule type trigger to do it simply. I can talk you through it if this would be useful.

If you could provide a little more detail about what you need to achieve, I’ll try and explain the steps.

Thanks for using the product!

(Andrew Garkavyi) #3

Wait is great if it can be inserted in the middle of the flow, in my case I’m not yet sure if that would work.

Generally speaking I have a simple Slack bot that does certain actions when somebody mentions it in chat room, which is half of the deal.

The other case is to trigger bot automatically to post information in to a certain chat every morning during the working week - that is what I’m trying to achieve now.
As one of the options I can find some “chron like” service and connect a webhook, simulating the same behavior. But I was wondering if there is a simpler way to do it now within flowxo

(John Jackson) #4

You can achieve the second use case you mentioned using some external web cron type service, however here’s the steps to do it inside Flow XO:

  • Make a webhook trigger.
  • Add a wait action, with the time set to ‘9am tomorrow’.
  • Next, use the Date & Time service to format the date and just get the day of the week. I think the format string is just ‘{weekday}’.
  • Add your bot message after that, but use a filter on this action. Only run this action if the day of the week from the previous action does not equal ‘Saturday’ and does not equal ‘Sunday’.
  • Finally, add a webhook action which just does a GET request to the webhook URL of the trigger (which of course starts this sequence again).

Hopefully that at least gets you on your way with this use case.

Weekly direct message to multipe users on Slack
(Andrew Garkavyi) #5

Thank you, that may work for me now.