Wait after server action

#1

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.

#2

Hello Nevil,

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

#3

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.

#4

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

#5

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
#6

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