User clicks a thing & then gets notification when work is done

Hi Everyone
Here’s my scenario:
User enteres a subject and this results in three types of object:
topic, theme, paper
topic has 1-5 themes, each theme has 1-4 papers
I’ve created custom data types for topic, theme, paper.

The custom data types are populated by different API calls.
So far, so boring. Here’s the kicker, the API calls are quite slow. There is nothing I can do about that, it’s just the time it takes.

I found this youtube vid: How to Save Data From an API to Your Bubble Database | Bubble.io Tutorials - YouTube
Which talks about getting an json array from an API (which is exactly what the APIs Im using return) Which works great for the first part (generating themes from a subject)
However things go wrong when I try to create a list of papers from a list of themes.
“go wrong” means that the workflow finishes waaaaay too quick (the progress bar dashes across the top in short order) and Im left with nothing in the papers table.

Given the time it takes the APIs to return information, and oft quoted stat that users will wait for x Seconds before giving up, Im thinking of a new workflow:

  1. User enters topic & clicks “Search”
  2. The user gets a “We are compiling your information, check back later / we’ll email you once its done” type page
  3. Some backend workflow is triggered which goes off, and gets the information it needs from 10-15 API calls (5 themes & 3 or 4 associated papers)

A few questions:

  1. Given the information above does it sound like a good strategy?
  2. Can you think of another way that might work better?
  3. My Own thought: Triggering workflows based on a change in a record seems sensible

I know these are vague, But Im a coder, trying to understand bubble. Any help or pointers greatly appreciated.

Yeah. Trying to work out ‘progress’ across back end workflows is really tricky and can actually cause the to fail.

One thought is to use a ‘control record’ and recursive workflows.

The record has the total number of recursions needed and what recursion you are in. So you have progress and the workflows are not tripping over each other like they could if they are updating the same record asynchronously.

1 Like

Welcome!

Well then: You know that the quickest way to get up to speed is to RTFM.

Here’s the M:

And here are the lessons and such:

Get to it and come back when you’re done.

Also, here’s something that will help you if what you say is true:

1 Like