Endpoint doesn't wait for second WF to finish before sending return data


I am having problems figuring out how to solve this problem:

  1. Call starts my Backend WF “A”
  2. WF “A” needs to return a token, but first needs to refresh it calling a second Backend WF “B” before “Return Data”
  3. PROBLEM: WF “A” doesn’t wait for “B” to finish and returns old token

I tried to make WF “B” to return a “done”:(boolean) but didn’t work.

Anyone has an idea to how can I accomplish the behaviour needed?

Thank you,

Scheduled workflows are asynchronous in bubble. They get scheduled right away and return the schedule id. From that point their execution is not related to your initial workflow any more.

If you want to wait for some logic to finish you need to use custom events.
When you trigger a custom event bubble will wait for it to finish before going forward with your actions.

Move the logic of wf B in a custom event and trigger it from wf A.


Thank you!!!

You don’t imagine what a problem this has been for me.

You just opened the world of possibilities for me, hehe :grin:

1 Like