Regularly scheduled API calls

The idea is to be able to set up a regularly scheduled event. The way I would think to do that would be to schedule an API call that will then schedule itself for a later date (and so on). Then you just enter a condition on the workflow that will be used to interrupt it in the future (like cancelled = yes). However, it looks like it’s not currently possible to schedule an API workflow that will then schedule itself (or even a different API workflow) for a different date. I assume you guys did that to prevent crazy infinite loops.

However, that functionality would be awesome for a couple use cases:

  1. Subscription businesses - generating regular shipments, doing a monthly reset of quota-based usage, etc.
  2. Regularly scheduled update emails (not event-based)

Any thoughts on best ways to do that?

1 Like

Interesting! I like it although i never toyed around with idea (yet) is it possible to make 2 workflows with one calling another instead of its self?

Yeah, this is a bit scary for us, so we don’t support it yet. We’ll add a proper recurring scheduler at some point, but right now we’d rather have users find other ways to do this.

Zapier has a “delay until” function, so I wonder if you could use that ?

An API workflow can trigger a Zap. Which can then be a delayed Zapier Action ?

3 Likes

This is something I hope becomes a feature. I use Parse (or say I used to use Parse until their shutdown), which allowed me to schedule recurring background processes. Inadvertently running too many workflows could be a problem if you aren’t careful and don’t check your work, but I don’t think it will be too much of an issue if you understand that excessive use could cause a self-inflicted DOS attack. Maybe leave a warning to users when making recurring API calls or imposing limits to its use initially.

A bit off topic, but related to the workflow API:
Another feature that I really liked in Parse was the ability to access objects when they are saved or deleted from the perspective of the system. In other words, when a user creates a new object, modifications can be made to it using the “master key” as opposed to the user level. A concrete example for social media would be when a Like is created, rather than update the count on the Post or Comment, have the API workflow pick it up automatically and adjust the Post or Comment there. This saves from having to duplicate workflow events and API calls.

@NigelG - love that idea! Basically bounce between bubble and zapier infinitely until it’s intereupted by some sort of field change

1 Like

Yup, works too :slightly_smiling:

Looping in Bubble !

2 Likes

That’s great. Make sure not to do crazy things though :stuck_out_tongue:

2 Likes

Super cool…opens up all sorts of possibilities. Thanks for figuring it out @NigelG!

1 Like

Would it be dangerous every hour, as the minimum duration btw two WF ?
Both @vlad 's use cases are > week. Those I’ve got in mind are a daily workflow to send reminder emails if needed, clean products’s stock in the database every day, calculate every month key metrics for sellers as a sum up (since GROUP BY function is not available).

Mine has now been running every minute for 716 minutes.

I think the issue is maybe more about something spawning more than 1 thread and growing. I wonder if there is something we can do to have these sort of threads limit themselves. So if another one comes along that has the same “id” (?) it will stop itself.

1 Like

Yeah, every hour is def fine, the risk is more a workflow that schedules itself very quick and that becomes exponential (no need to experiment there…)

1 Like

@NigelG,

Have you set this up again recently? For some reason, my Zaps refuse to run from my API workflows. (Thus, killing the loop.)

We just enabled scheduling an API Workflow from another API Workflow, with the constraint that we can’t have loops. So now you can have an API workflow the schedules another call later. It probably won’t help your case here, but just wanted to make the announcement :slight_smile:

1 Like

Still works.

But am not calling it from an API workflow.

Hmm… I assumed that the webhook at the end of your zap was re-running the Zap through an API workflow.

Curious as to how you’re creating the loop then.

Brain fade. Yes I am !

Awesome @emmanuel. Thanks for letting us know. Turns out I’m looking to do exactly that right now.

Thanks for checking it out for me, man. Mind putting something in the forum app for me? I’m drawing a complete blank here as to what I’m doing wrong. My zaps are completely unresponsive when the API workflow tries to run them.

Hi Emmanuel,

Can you pls share some screen shots for how to set up an API workflow that is scheduled from another API workflow.

This being a new feature, the documentation is very thin.

Much appreciated.