Sleetza - Hey guys, Im making an api call from ...
Hey guys, Im making an api call from Flutterflow to Buildship. Problem is that there is some backend logic involved that takes about 1,5 minute to complete, and the time out on the Flutterflow-side of things is 30 seconds. So the backend works, but I cant get my app states and messages in Flutterflow to trigger upon succesful api call. Any ideas on how to solve this?
9 Replies
Hi @Sleetza, on which plan is your BuildShip project? Maybe you'll require to update timeout in FlutterFlow? cc @Stu any suggestions to overcome timeout in FlutterFlow?
Im on the free plan.
After doing more research I think an api call is not the way to go. I am now looking into custom code on Flutterflow's side to setup a Supabase stream event for insert data in Supabase.
@Gu-sugu Flutterflow will generally wait until any API call receives a response, regardless of length of time.
@Sleetza What happens when you run a test in the API Calls section in Flutterflow?
@Sleetza Alternatively, if the particular api you're calling gives a webhook, you might want to impliment that within your Buildship workflow (or within Flutterflow), depending on your implimentation. Can you share a bit more about the API you're calling?
I am making a post call to my buildship backend. The url to a pdf is included in the api call. My backend then extracts the text from the pdf and sends it to open ai. This process takes about 1.5 minute (its a lot of tokens).
Ps, when testing the api call works fine. The backend process also completes fine. But I am looking for a way to notify the user that the parse on the backend is complete so they can continue to the next part of the logic.
I'm actually running into the API timeout issue myself with a POST call that takes a long time to return. A couple of ideas off the top of my head:
- Once the pdf extraction is done in Buildship, create a new Firebase document. Then in Flutterflow Query the collection you have created the new document in and use the "On Data Change" option to trigger your subsequent workflows.
OR
- You can trigger Flutterflow notifications within Buildship. If you just wanted to notify the user, using that node might be an option?
So for context I should probably say I use Supabase and besides generating documents I also have a table with information on every document.
I now made a listview with a query to that table (and some custom code to make it realtime). Then I used conditional visibility to show a text field 'Waiting' when the specific cell in my table is null and show a Download button with the Launch URL action (url pulls from that db cell) when the cell contains data. So that works kinda nicely.
Where can I find the "On Data Change" option? Is it a setting from a specific widget?
I made a quick video for you showing where to find "On Data Change". https://www.loom.com/share/348b1bf787cd4bef83d6e1abfc72e2de
That said, i don't have any projects that use Supabase so not sure if it's a Firebase-only feature or not.
Appreciate the effort Stu!