Best practice for updating/auto-binding time balance (MM:SS) balance for real-time transcriptions

Good day Bubblers!

For those using streaming services, like real-time transcription, what is the best practice for deducting in real-time the minutes/seconds used against their balance?

It’s easy enough to write to the database when they click “stop recording”, but I think some form of auto-update to their balance in real-time is more suitable, especially in the event they shut down and never hit “stop recording”.

e.g. The user has a balance of 3,600 seconds (1hr), begins streaming, and after 120 seconds, shuts down without clicking “stop”. absent that action to kick off the DB update, you’d eat the cost of 120 seconds.

Thanks in advance for any tips on best practices!

Good day to you!

You can “schedule a backend workflow”, with their balance expiration as the trigger date. You can also store that scheduled workflow’s id, and cancel it if the user clicks “stop”. Hope that helps.

Thanks for the reply! Trying to picture it in my head, how does using 5 minutes of say a 60 minute budget affect a date?

Step 1 : Define the Custom state-

I have declared two custom state- one for tracking start/stop the timer and second one is for “how long you wan the timer to run for” - in seconds.

Set it for 3600 sec i.e. 1 hr.

Step 2:: Add the button to “start the timer”, attach the following workflow to it-

Step 3: Add the action “Do it every 5 seconds” workflow, instead of default 5 make it 1 sec.

Step 4: Show the real-time timer to user-

I hope you are able to understand it.

Ankur@Nocodetalks
Looking for a Bubble Coach? Buy Bubble.io mentorship

1 Like

Thanks Ankur!

I’ll give it a try later today.

Appreciate everyone’s responses.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.