Doing a workflow continuously

Lets say I have an application where users are sending emails (1-5 messages over the course of a month or so) to a list of contacts.

I have it set up currently, so that when the user turns the “campaign” on - it takes x amount of the emails from their list, and starts sending.

My problem, is that I’d like this function to happen every day… So say there were 100 email addresses this user was emailing… I’d like to repeatedly perform the same series of actions as when someone turns the campaign on, every day, or every weekday… if possible.

I’ve looked into repeating actions, but I need to get the biggest plan for that to happen ea day… and I think there should be a different way around this…

Anything creative you guys can think of? Some kind of triggered event system…

1 Like

Hey Andrew,

Seems like this would be best done by creating a recurring event to handle it. You can find this in your API Workflows - add an endpoint - new recurring event. You’ll need to have a paid plan to access these.

1 Like

Harry, unfortunately, I want to do this every day… so although I do have a paid plan, I’m limited to 1x per month… unless I upgrade to the 160/month plan, and that’s not really worth it for now. any ideas on how I can circumvent this?

@Kfawcett ‘s response will get around that limitation

@kfawcett @exception-rambler - THANKS! looking at this tool, it appears to be perfect.

@kfawcett @exception-rambler is there a walkthrough video on setting this up, by chance?

I wrote this very short how to a few months back: Recurring weekly data change

Where are you stuck?

1 Like

Might be outside of Cron -

Basically, to give you a glimpse of my issue:

site users, create a series of messages, and send them to a “sending list”. Say the sending list is 500 emails long…

I don’t want to send them all at once, rather 15/day.

Currently, I have the workflow to take 15 unsent emails from the “sending list” and introduce them to the campaign.

I’m struggling to get this to repeat daily, on autopilot. Basically, if the user just clicked “start campaign” daily… is what I’m trying to automate.

Looking at the screenshot you sent… that answers a few of my questions about easycron… is the API address always mysdomain.com/api/1.1/wf/API_Name… because when I go to that url, I get this error : {“statusCode”:405,“body”:{“status”:“ERROR”,“message”:“Wrong method. Should be a post”}}

any workaround, or what would you say is the easiest method to get my mission accomplished here?

@exception-rambler - thanks for the reply and originally creating the screenshots. that helps me understand as well.

I have created something similar in the past and things got pretty complex, fast. Or they did for me anyhow. But if your scheduling rules are more fixed than mine then it might be simpler!

You probably want your email schedule event to sit as an API workflow - so once user commits message then trigger an API workflow for Current date & time that will handle the cron creation on EasyCron. You’ll want to pass parameters including Current User.

Your API workflow should then use the EasyCron plugin to create a new cron event with EasyCron. You can use http://www.cronmaker.com/ to create your expressions, in my case we had to create those on-the-fly and we wrote a script on WebTask to work out what the expression needed to be - you can remove this complexity by sticking to set times / expressions here. For instance, if it just repeated every hour that would be easy. https://cronexpressiondescriptor.azurewebsites.net/ is helpful too.

Create an inbound API endpoint. As you setup the cron tasks with the workflow above you will use that URL as the callback for the cron task, include some unique identifier for either the user or the email Thing in the Body. Sounds like the ID for the email Thing will make more sense here.

In the workflow step that follow’s the event creation you should have the option to save the Task ID which will have been received in response from EasyCron - I guess it should be saved to the Email Thing.

Back on your inbound API endpoint, you should set this up to look for an ‘ID’ parameter - that is what EasyCron will attach as its payload when it fires the job. You can then create a step in your inbound workflow that adds +1 to a counter on the email object so that your Bubble DB has a track of how many time the job has fired. Then insert your email tasks, followed by a check for whether the workflow has been fired 500 times yet - if yes, then the cron task should be deleted from EasyCron… again, use the Bubble plugin to do this and all you need is the cron-task’s ID, which you received in the callback from EasyCron when your outbound API created the job.

This covers a few different Bubble concepts that I’m assuming you’re comfortable with them.

On your error, if everything else is configured correctly then you likely don’t have your cron task configured to make a POST call - you adjust this in Method if you are testing through the EasyCron website.

Ed

3 Likes

That helps a ton, thanks Ed. I’m sure I’ll be back with more as I run into them :slight_smile: