Workflow error - app too busy | what to do?

Hello, I am experiencing an issue with server capacity and maybe someone can give me an advice on how to solve this.

This is the use case: users can input a new bank loan (saved in a thing called FinDebt Head with just a few information like name of the bank and loan type) and then can upload a .csv file (3 columns with due date, capital and interests). I am testing the app with a 35 rows file (I know that there is a limit of 100 rows, which is fine with me).

First scenario: on uploading the file a workflow runs with the upload .csv action and right after there is another action “update a list of thing” in order to give to every record of the loan repayment plane just uploaded the proper reference to the bank loan (FinDebt Head).

This setup works fine but Bubble it takes really too long to write 35 records and update the cross-reference. Since the bad user experience I have tried to find a workaround.

NOTE A) = yesterday I have spent hours trying to find a way to parse the .csv and then import the records as json through the API connector, but this is way too complicate for me and I was not able to succeed (if anyone can help I really appreciate).

Second scenario: I thought that instead of blocking the user experience just waiting for Bubble to finish the workflow, I could use a API scheduled workflow. So I set up an endpoint with the same action used in the normal workflow. On the upload event, the endpoint is triggered, the .csv is uploaded, the loan plan created and the loan bank reference updated.

Here it comes the problem: using the API workflow the system goes out of capacity after uploading the .csv and there is no way to run the “make changes to a list” action. To prove that this was the only problem I activated a temporary boost on capacity and no error occurred (it is always slow but at least it goes through).

I would like to share with you this situation and ask comments and advice about this:

-) why the same actions do not use all the capacity in normal workflow while they do using API workflow ? is there a better way to manage this kind of actions ?

-) if there is not a way to upload quickly a few tens of records, is it correct to use an API workflow as a workaround or there is another method ?

-) most of all, if running just one single workflow takes all the server capacity what is going to happen in production if 10 or maybe 100 users run simultaneously one workflow each ? here it is not just a matter of upgrading to the Professional Plan but I seriously wonder how much is gonna cost all this additional server capacity.

Thank you in advance for any reply.

Stefano

Hi Stefano,

Thank you for the extensive troubleshooting. I’m also stumbling onto the same problem uploading a “simple” CSV and your work has helped me rule out some stuff and try other solutions.

I’ve got a little hack working for me that I would love if you would try. The short is I broke down the API call into 2 calls.

Here’s what I’ve got working:

on the client side:

  1. create a new CSV-import item (a data type in my application)
  2. attach the .csv file to it
  3. schedule API workflow (sends the CSV-import item it just created)

on the server side:

  1. that API takes that CSV-import item
  2. does the dreaded “upload data as CSV” step
  3. calls another API passing that CSV-import item + the list of Answers that it got from the csv upload. On that 2nd API I did all the needed data manipulation.

The big advantage is that I can now add a delay which I suspected was causing all the problems. I got 30 seconds as the good buffer for my application. It hangs if I try to do too many uploads within the same 2-min window. So I doubled it to 60 seconds. Not ideal, but at least I can get it to work.

I think there’s a bug in this action so I might post a bug to the Bubble team, but it would require tons of work to troubleshoot some more.

2 Likes

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