How to run backend workflows in sequence?

I currently have 4 backend workflows:

on the front end, I run them all at click of a button. I added each of the backend workflows within a custom event thinking that it will make it run on the sequence. But turns out it is not!

I needed for them to run in sequence because the first backend workflow (URL Loop) will run a loop and collect data on each of the URL’s provided. This data is needed for the next workflows (blog titles, meta description and introduction)

But they run all the same time so those workflows are not really getting the data needed on the first workflow (URL Loop)

PLease HELP!

1 Like

Best bet would be to have the button call the first workflow, and then at the end of each workflow, have it schedule the next workflow (set date as current date/time. Although not sure whether you will have to create a data type for each bit of data returned at each step and then pass this to the next workflow.

image

2 Likes

Unfortunately still won’t be synchronous, it could schedule the last step while the first ones are still running…

1 Like

do you happen to know of a solution?

:point_right: Tip: Order of Operation - #2 by aschofer :point_left:

At this point, this thread is mandatory reading. I wish Bubble would add this to the manual. Ah, maybe @petter is updating the manual and I can CC: him with this request. :wink:

3 Likes

The safest route is have the 1st workflow scheduled the 2nd, 2nd schedules the 3rd, 3rd schedules 4th, but each one has parameters/keys that need the Result of step x so each one waits for the output of your actions before scheduling it

1 Like

https://manual.bubble.io/help-guides/building-workflows/the-basics#execution-rules

2 Likes
  • create 4 custom events in the backend workflow
  • move the logic of the api workflows in the custom events
  • cancel all the actions in your api workflows and add just one action to trigger the corresponding custom event.
  • create a new api workflow, add actions to trigger the custom events in the order you want. Schedule this workflow from your frontend

This way you can reuse the logic both as single workflow and a sequence.

Keep in mind that if you create something in workflow 1 that needs to be used in workflow 2 the safest thing is to just pass it as input of the second custom events when you trigger it.

4 Likes

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