Users have asked for the ability to run workflows periodically for a while now. We just deployed this ability for users on a paid plan (as this requires using the API section of the Editor). Here is how it works.
You can now create Recurring Events in the API page (after you’ve activated the Workflow API for your app). Unlike API Events, these workflows cannot be triggered through a POST request, but can be used in a “Set/cancel a recurring event” (see below).
Such a workflow has to take a database thing as a parameter. To schedule a recurring event, you need to attach this to a thing.
Once you’ve defined this event, you can use a Set/cancel a recurring event action in your workflow. This action takes an event, a thing, a frequency and a start date. Note that the same action is used to cancel a recurring workflow, just pick ‘none’ for the frequency.
If you want to update the frequency of a recurring even, you can apply the same action to a thing, and the scheduling will get updated for the following occurrences.
You can see the upcoming recurring workflows in the scheduling view in the editor.
Recurring events require some infrastructure on the server, so we have to make the daily frequency available to users on a Team plan, and the weekly frequency on users on a Professional Plan. Other frequencies are for all users on a paid plan (this can be changed for users on a Dedicated Plan).
Note that only one recurring event can be applied per thing (for instance, one weekly newsletter per user). These limitations are necessary as this stage as recurring things can be pretty dangerous server side…
@jordanfaucet The set/cancel recurring event action should actually go in a regular workflow on one of your pages. Right now you’re setting it within itself, so remove that first action and move it to wherever it is in your app that should trigger it (technically you won’t be able to cut and paste, you’ll need to re-add the action in the workflow).
This feature could be great, but I’m having a hard time using it.
When I set the frequency to none, my logs show an error: “Workflow error - More than one scheduled recurring event per thing. Aborted.”
When I set the frequency to weekly I get the same error.
In the scheduling tab there is nothing displayed, so I have no idea what’s going on. It appears nothing is scheduled. But if that’s the case, how am I getting this error?
Also, in the workflow debugger there is some sort of error where the recurring workflow name is missing. The event is now called “bTGpP”. I’ve only ever seen this when a workflow refers to something that doesn’t exist, which isn’t the case here.
Thank you @romanmg - your answer helped me out too! I’ve been struggling with this recurring workflow setup as that information is not clear in any of the threads. I also had the ‘set/recurring event’ in the same API workflow. Now I can actually see the recurring event in the scheduling tab!
Sorry I don’t have a response to the person above, but I do have a question too, if anyone could answer please.
If I have 2 events I want to occur at different times (same day) can I have them both in the same workflow?
[ex. (send email at 11:00) —> (send email at 2:00pm)]
Or do I have to have 1 recurring event per workflow ?
I have been trying to set 1 recurring event per workflow but am having difficulty with the ‘type of thing’ setup since you can only have 1 recurring event per thing. So if one event is set on ‘User’ then I can’t put anything else with ‘User’.
@kramwe Yeah, the schedule showed up immediately after I fixed that (moving the action to a different page, so that it isn’t set within itself). I had to refresh the schedule page though and then it shows up. It appears to set the start (for whichever frequency you have set) to the next day instead of that same day.
Regarding the interval, yeah that would work except I just used those times above as an example. I have it set up where the times are customizable. I suppose I could change it such that they’re on intervals if there is no other work around.
I haven’t been able to test the scheduling thing yet because the schedule I had set up was for monthly (since that’s the shortest frequency available to me right now) and the scheduled date I had set up previously has passed. I wasn’t able to set up the times beforehand because now the database isn’t working. It won’t pick up on any of the data I save there - apparently its not really saving anything.
Yeah, I’ll have to check there again. I didn’t like what I saw there before, as it didn’t really match the functionality I want to have and it seems much easier to just have the scheduling here rather than pinging from one source to another. Thanks for the suggestion though.
is it possible to bypass this restriction?@emmanuel
“5) Note that only one recurring event can be applied per thing (for instance, one weekly newsletter per user). These limitations are necessary as this stage as recurring things can be pretty dangerous server side…”
Because I have different Membership Plans (Monthly & yearly) and I want to create for each plan a recurring invoice based on the user choice.
When I use several Recurring of the same thing I get this workflow error:
“More than one scheduled recurring event per thing. Aborted.”
How can I bypass that? is this allowed on a specific bubble plan?