Exploring the Cause of AssemblyAI Webhook Duplication in Bubble Database [2024]
Troubleshooting a bug with webhooks and the AssemblyAI API.
Unlock AssemblyAI's hidden power: Discover how to avoid costly webhook duplications in your Bubble app!
Optimize your Bubble workflows: Learn the secret to preventing multiple runs and saving on AI prompt costs.
Master backend workflows: Streamline your AssemblyAI integration and boost your API efficiency in Bubble.
AssemblyAI Webhook Duplication in Bubble Database
Here's something interesting that I've learned when using AssemblyAI to generate transcripts of our videos for an internal app I've been building for Planet No Code. Effectively, we submit an mp3 file of our videos and we use their service to convert the mp3 into a transcript. We get timestamps, chapters, and then we use those timestamps to generate our chapter headings that we can paste into our YouTube descriptions. But the issue I was having was that when AssemblyAI seemed to have generated the transcript successfully, I was checking that in the logs. I was noticing that every action after that was running multiple times in my Bubble app, and that included running some rather expensive Claude AI prompts.
Multiple Workflow Executions
I was sometimes getting, it would run five times per MP3 file that I submitted that kind of start of the process. And then I worked out why. So if we dig into the AssemblyAI documentation, and right the way down here on webhooks, we see that they will try and respond to a resend the webhook up to ten times, waiting 10 seconds. Now, here's something you might not know about Bubble, which is that if I go into my backend workflows, this is the workflow that runs when AssemblyAI has finished in the transcript. I get back a transcript id, and then I would recall one of Assembly AI's APIs and I would get back my transcript content.
AssemblyAI Mini Series
We do cover all of that in a mini series on AssemblyAI. I'll put a link down in the description to access that. But to get into the detail here, what was happening was I had all of these generate content workflow actions, some of these taking 30 seconds to run, because I would send the whole transcript over and I'd ask for a lot of data back. I had all of that in this workflow here. Here's the issue.
Bubble's Webhook Response Behavior
Bubble will only respond to an inbound webhook with a success status when the workflow has completed, which means that if you put too much content in the endpoint that you're using to be notified when AssemblyAI has finished generating the content and the transcript is ready, it will fail and it will wait 10 seconds and it hasn't got a response. So it will retry, and it will retry and it will retry. So this has cost me not a large amount of money, but it's cost me more than I was expecting in anthropic top ups of my account, because it was running five, six times for each MP3 file that I was putting through this process.
The Solution: Minimizing Endpoint Content
So the fix is to really reduce down what you've got in this endpoint. So I'm doing the bare minimal, and then I'm actually putting the rest of it in another backend workflow that I send data through to, and it moves onto here. Here's actually where I fetch my paragraph data. And then all of this, which can take actually about two to three minutes, is in a completely separate workflow. So this bit here can execute really fast. And I no longer get duplicates in my database after using AssemblyAI to generate a transcript.
Get the Complete Bundle for Just $99
Access 3 courses, 390+ tutorials, and a vibrant community to support every step of your app-building journey.
Start building with total confidence
No more delays. With 30+ hours of expert content, you’ll have the insights needed to build effectively.
Find every solution in one place
No more searching across platforms for tutorials. Our bundle has everything you need, with 390+ videos covering every feature and technique.
Dive deep into every detail
Get beyond the basics with comprehensive, in-depth courses & no code tutorials that empower you to create a feature-rich, professional app.
Save over 70%!
Valued at $80
Valued at $85
Valued at $30
Valued at $110
Valued at $45
Can't find what you're looking for?
Search our 300+ Bubble tutorial videos. Start learning no code today!
Have questions?
We have answers!
Find answers to common questions about our membership plans, programs, and more.
We're here to help you launch your no code SaaS. Reach out to the team and we'll double check our vast library for useful content. We'll advise you on how we'd tackle the same problem and there's a good chance we'll record the video to help the wider community.
As a Planet No Code member, you'll receive a discount on our Bubble coaching sessions. Monthly members receive a 10% discount, while Annual members receive a 17.5% discount. To redeem your discount, simply log into your account and book a coaching session through our platform.
Our 8-week intensive mentorship program is designed to provide personalized guidance and support to help you accelerate your startup journey. You'll be matched with a startup expert who will work with you one-on-one to set goals, overcome challenges, and make rapid progress.
To apply for the Mastery Program, simply click the "Request Invitation" button on our pricing page and fill out the application form. Our team will review your application and schedule a call with you to discuss your goals and determine if the program is a good fit for your needs.
We accept all major credit cards, including Visa, Mastercard, American Express, and Discover.
While we don't offer a free trial, we do provide a 14-day money-back guarantee. If you're not completely satisfied with your membership within the first 14 days, simply contact our support team, and we'll issue a full refund.