we at Bubblewits, when working on a project for a client to synchronize their Harvest time tracking data with Bubble database through Harvest API, have come up with a solution to run an API workflow on a scheduled basis (for example every 1,5,15 minutes etc.) in the background, even when the app is not running.
We found out that AWS’s Lambda service allows to host any code in python or node.js and then trigger it on schedule using Cloudwatch.
so we have simply created a Lambda python function that sends a POST request to Bubble endpoint (or a list of endpoints) triggering associated workflow and configured the frequency with which this function gets triggered.
Let me know if there is any interest to this and I will share the step by step instructions and the lambda python code where you’d need to only replace the endpoint urls, and authorization.
Lambda service has a free tier which to my calculations should be enough for a lot of operations. So this is a better solution than using Zapier for triggering webhooks.
Beware that calling API workflow even if its condition is not met counts toward the monthly workflow limits.
And by the way AWS allows creating and hosting API gateways, with endpoints that can trigger any Lambda Function. So for example Bubble can call a certain API at AWS and that in turn will trigger a Lambda function to do something.
I thought it’s better because it’s free :), zapier’s free plan is limited in terms of number of zaps you can trigger per month… Although I agree that it’s easier to configure and use Zapier
Yes, AWS provides some pretty amazing products. I’ve been using EC2’s, VPC’s and some of the other products for a few years, but just recently learned about Lambda. Amazon has managed to make everything very modular and so easy to use. Just don’t forget to turn off an EC2 for a couple of weeks/months. You’ll be in for a very big suprise bill!
Hi @levon, is it also possible to be able to schedule the lambda function at specific days and time (eg. every mon, weds, & friday at 1am to 5am)? Does it require to change your python code?
In case, & since I do not know python, do you know whether aws lambda function is trigger-able thru zapier with use of schedule and webhooks?
Hey Carl,
sorry i’m not sure about that, i didn’t play with Lambda since I wrote the post which is about 2 years now So i’d suggest you to google that
Thanks
Thank you so much for sharing this! Has absolutely been a game changer for my app. So many new possibilities.
I have now set it up to trigger an endpoint once a day within bubble, that send out some e-mail. However, the last time the endpoint was triggered 3 times from AWS lambda, sending the same email 3 times.
After doing some research I have understood 3x is the most amount of times AWS lambda will attempt to run a code (asychronously), so I figured something wasn’t working properly. The only thing that came up with was server time-out, so I have increased the timeout from 3 to 5 seconds, which seems to work properly now…
However, to be completely honest I am way outside my depth here, and have really no idea what I’m doing.
Has anyone experienced something similar? And have you found a good solutions to ensuring that you don’t get any errors from the AWS side?
Hi, has anyone else experienced a lot of timeouts from lamdba using this code? After more research, I believe it has to do with the code, and the time it takes to execute. I keep pushing up with time-out limit.
It still didn’t work at 10second. Have now pushed it to 5 minutes to see if it would just take the same amount of time.
@levon Hi! Very nice! I know that bubble now has scheduled workflows, but i would like to learn this method just for educational purposes. I am stuck at step 4. How do I configure this endpoint on Bubble?
Thanks in advance.