Wait after server action


I want to create a server action like this:

  1. API action
  2. (wait untill API action has completed)
  3. Insert API data into database

Step 1 and 3 is no big deal, but I’m not sure how I can make the insert step “wait” untill the API action is completed. Now the insert runs faster then the API action has gathered data, so it won’t insert any data at all.


Hello Nevil,

Are these 2 separate actions, or are these steps in a same server action?


In the same server action.

I was thinking, when using a repeat, a “wait untill” doesn’t seem to be needed. Only in my particular situation I don’t need a repeat since it’s just one row of data coming from the API.


You can use the repeat step with even one record, if that’s what you want to do.


The API action should be completed before it continues to the next step, on the server nothing happens async and steps only continue when the previous was finished.

1 Like

Good to know Patrick, then I probably made a mistake somewhere :slight_smile: