Repost: Pause workflow till triggered API Workflow on a list completes

Hi all,

I am reposting this question asked by @cheskiefisch again which was not resolved. Edited a bit to my particular issue.

I have a workflow which runs a schedule-API to perform a copy action (which creates new entries), and i want the following actions in the regular Workflow to wait till the API workflow completes, (because the whole data should load before proceeding with the following actions).

Is it possible?

If not, at least is it possible to restrict users from interacting with the page. I created this test page and if you press the ‘Copy’ button the copy button, the popup closes before the 30 of 30 is still copying.

The usual way to do this is for the API workflow to signal completion by change some data in the database that the current user has read access to. Then the page can start a workflow with the event DO WHEN CONDITION.

Thanks Mishav. I also got the below steps from cheskiefisch. Let me check these solutions and update the forum.

  1. Add a yes/no field to the user type: “API in progress”
  2. Create a Non-Closable popup on the page, the page that triggers the API
  3. Add an action at the beginning of the API Workflow to change the the above-mentioned field to “yes”, and another action at the end to change to “no”
  4. Create a condition on the Popup to be visible only when “API in progress” is yes
  5. Write some text on the Popup to the user like: “Saving data, please wait”

Hi @mishav and @cheskiefisch. Your tips still didn’t resolve the problem. I suspect when Schedule-API is used, bubble just goes to the next action without the API being complete.

The action item circled in red calls the API workflow.

And then in the API we have set Copy = Yes, Copy action and then Set Copy=No. But even when action 2 is running it already is setting the set Copy to No before it finishing the copy of its 30 records.

Here is the preview link What could I be missing?

I believe bubble cannot tell you when the api workflow on a list finishes. The developers have said themselves it very hard for them to do, this would make me assume it is also very hard for us to do being a level down.
Mischa has the option I would use, such as a counter which every api adds to
Ie api counter=api counter + 1
Thn something to monitor that api counterr

Thanks for your reply. We did have a condition to set Copy-Progress is “no” after the API . But this is getting set to “no” before the load completes. If you see the example the popup closes before our 30 rows are copied despite having this condition. This is a risk as a user may start to interact with the partially loaded data.

I may be missing something if this not the “api counter” you are talking about, Could you please explain a little bit ?

So have a field in the database somewhere call “counter”
Before running the workflow do a count on the list you will be performing the workflow on store and set the counter to this number
Then every workflow have an action counter=counter-1
Then set up a “do when” workflow to do when counter = 0

Or you could reverse it and count the counter up and do when counter = the count of workflows expected