ICON workflows can include scheduling of some kind?

ICON workflows can include scheduling of some kind? This is one thing we have not checked for yet, but it would be great to have.

Weekends, weeknights, between the hours of… stuff like that.

So two potential things can be done here.

You could use the timers trigger to set days/times that a workflow will start.

Or if you already have external triggers that are starting your workflows you could use datetime to look up the current date and time and put logic in your workflow to perform certain things depending on what day or time it is.

2 Likes

thanks Tyler. Yea would like to include in an alert workflow that is firing already, if it is between say 1-2 pm then also do this action. Any suggestions on that in datetime?

I do this

  1. get current datetime in R322(whatever) format
  2. subtract 6 hours for central time
  3. trying to regex the hour alone to say if x > y but cant do this yet. E.g. “date”: “2021-07-02T07:47:33.0Z”

\d{4}-\d{2}-\d{2}T{{hour:/\d{2}/}} in a pattern match step against a datatime should give you the hour.
Get current time
use the locatime function to change timezone(better than -6 since it should handle daylight savings time)
regex the hour from the resulting string

If you run into issues with the comparison, type convert the string to an integer.

Here’s the full regex to parse the datetime into components:
{{year:/\d{4}/}}-{{month:/\d{2}/}}-{{day:/\d{2}/}}T{{hour:/\d{2}/}}:{{minute:/\d{2}/}}:{{second:/\d{2}/}}
full disclosure, I didn’t copy and paste that from a workflow. I don’t see any typos in it, but it is Friday before a long weekend…

1 Like