Forum Academy Marketplace Showcase Pricing Features

How to use a recurring API Workflow for periodical background calculations

Hi,

I am trying to make a periodical calculation of several tables and data types to try to make my user experience lighter.
My plan let me do it weekly.

I figured it out that I need a Recurring API workflow and I set it up.
My question is about the triggering.
There is not a real event that should trigger it, but is a recurring workflow as part of the maintenance of the database.
I am afraid that If I implement a button or an event that trigger it, that will start creating more instances of this recurring workflows.

Does it make sense my concern? What is the suggested approach?

Thanks in advance.

Sergio

Using your allowed weekly recurring limit in your plan, I’m curious if it would be possible to do this:

Schedule your 1x/wk API worflow, and inside this single workflow that runs weekly add x number of actions that each schedule a new series of actions based on the current date/time+x minutes/hours/days/etc… brain dump which may not be helpful :smile: :

API Workflow #1 is setup to run Sunday morning at 1am, and when this workflow runs, within it set a new event to occur +24 hours which trigger API Workflow #2, +48 hours to trigger API Workflow #3, +72 hours Workflow #4, etc… basically creating the same workflow and duplicate it 7 times, each of them running 1x/day or whatever frequency you need. This means you will need to maintain multiple identical workflows.

I’m not really sure without being in an editor to test if this is possible. I will try and post back later with a demo.

sorry,

thanks for the hack (maybe will use in the future), but is not what I meant :slight_smile:
I 'll try to explain better.
Actually a weekly workflow is fine for me (for now). I just want to be able not to trigger it, but simply to have it executed once a week.
My confusion is that I would not need a real event to trigger it on, because there would be always the risk of generating more than one instance of this, or am I wrong?

Ah, okay. Why not create this manually? Create a workflow that runs ‘on page load’ AND when Get ‘run_api_workflow’ from page URL = true which triggers your recurring event. Then, load your app with /?run_api_workflow=true appended to the end of the URL.

ok, this is a good way (not used to parameter in url, but I know them a little…).

What about also have a button in a SysAdmin Dashboard, that Trigger ON / OFF? There would be a way to know if there is such recurrent workflow activated, without going in the bubble control panel?

There are a lot of options here. I use a combination of admin panel + URL params. If I expect to need access to a function as an admin multiple times I create a section for this workflow in the admin panel. If I’m testing a random function or feature and want it to be temporary in nature, I’ll create the URL param workflow and delete it when I’m done. In your case, perhaps you should add this to your SysAdmin Dashboard as a button which triggers your API workflow. Below the button place a repeating group. Inside this repeating group, load a list of logs that tell you when this recurring event has successfully ran. In order to create a new log item, add this as the final step in a workflow: Create new thing -> xyz log thing -> date/time/log description/etc. Then pull in these logs in your SysAdmin via the repeating group. You can go further and create log items for successes and failures.

Again, lots of options and ways to accomplish this. My method may not suit your needs.

1 Like

seems the best and closest to what I needed. Thanks