πŸ“… Flow Scheduler

by Patrick Corgan

Version 8 (October 13, 2023)

Download (2,442 downloads)

Run any of your flows whenever you want. Allows you to schedule time of day, and specify a payload value to be passed to the flow. You can schedule the flow weekly (any combination of weekdays, including all), monthly (any one day in each selected month), or by interval (every 𝘹 minutes). If you schedule a flow by interval, you won't choose a start time; the flow will start 𝘹 minutes after it's added to the schedule (or after the schedule restarts; see below), and every 𝘹 minutes thereafter.

If the flow you are scheduling requires internet access, the scheduler can check for a connection before starting the flow.

If the scheduler can't start the scheduled flow, it will log the error. If the flow or flow beginning can't be found, the flow will be unscheduled.

You can schedule a flow, unschedule a flow, view the schedule, and clear the schedule.

If the flow stops, the schedule will automatically restart when the flow is restarted.


π—‘π—Όπ˜π—²π˜€
If you select multiple months, this flow will not let you choose a day that would be after the last day of the shortest month selected (leap years are not considered, so February will always limit you to 28 days).

This behavior is due to the way dates are handled in Android. If you were to select June 31st, the "Time await" block would fire on July 1st; February 30th would cause it to fire on March 1st or 2nd, depending on leap year.

The best way to deal with this, if you want a flow to run on the last day of every month (for example), is to schedule that flow three times. Once for February 28th; once for April, June, September, and November 30th; and once for January, March, May, July, August, October, and December 31st.

Also, as a kludgy bug "fix", the scheduler will wait 61 seconds after starting a scheduled flow before returning to the "Time await" block that is the heart of this whole operation. This shouldn't cause any issues unless you're starting the same flow every 60 seconds, and what kind of a psychopath would do that? It will, however, add 61 seconds to the time between a flow's executions if it's scheduled by interval.

πŸ”Έπ™π™šπ™¦π™ͺπ™žπ™§π™šπ™¨ π™₯π™§π™šπ™’π™žπ™ͺπ™’πŸ”Έ

------------------------------
π˜‰π˜Ί π˜—π˜’π˜΅π˜³π˜ͺ𝘀𝘬 𝘊𝘰𝘳𝘨𝘒𝘯
πŸ› οΈπ•”π• π•žπ•žπ•–π•Ÿπ•₯𝕀 π•’π•Ÿπ•• π•”π•£π•šπ•₯π•šπ•”π•šπ•€π•žπ•€ π•¨π•–π•π•”π• π•žπ•–βš’οΈ
------------------------------

Version 2: Fixed unconnected block that was preventing scheduled flow from running.

Versions 3, 4, & 5: Minor code optimization. Error trapping and logging. Added option to check for internet connection prior to running scheduled flow.

Version 6: Fixed bug that caused the scheduler to forget whether an internet connection is required for a scheduled flow after the schedule was restarted.

Version 7: Added option to schedule flows by interval.

Version 8: Replaced deprecated "Network connected" blocks with "Data network" blocks. Hopefully fixed an intermittent bug where a flow would try to start multiple times.

[Also: It's a hand. How cool is that? πŸ‘†]

4.7 average rating from 13 reviews

5 stars
12
4 stars
0
3 stars
0
2 stars
0
1 star
1
Reports
0

Rate and review within the app in the Community section.