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.
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.
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.
Got a bit different situation now. I have a server action with an API action post, and after that one the server action gives a response with some data from our software provider. And this is fine.
But our software where we submitted the API call to, then goes to calculate some things in their backend, which takes about 30 seconds or so. But they don’t give that new calculated data back in their response of the previous mentioned API call. We basically have to do a new call for that.
I have tried to make a action scheduler which runs 30 seconds after success event with the above mentioned server action, which does work, but if I submit the first API call multiple times within that 30 seconds waiting time, it seems to only fire the action scheduler once. Is that correct or did I do something wrong? Or is there a better way to go about this? @Teodor
Hi Nevil,
So what do you need to exactly - to wait at least 30 seconds, and then call some other API/server action once or multiple times?
Also how do you know if 30seconds are always enough?
I haven’t mentioned the data iterator here, you mean the action scheduler I think?
The problem with running the action scheduler 30 seconds after the server action, is that when I submit the server action again in between those 30 seconds, it “overwrites” the waiting time of 30 seconds. Or at least that is what it seemed like.
I have a similar issue and after a bunch of searching have not found an answer.
Is there any way to issue a wait / delay of x seconds as a server action without a database connection and custom DB query?
Here is my scenario, using Server Actions, I call an api #1 (backend function, processing occurs etc...this takes a few seconds to execute say 10, this response is variable 5-20 seconds max). I then call api #2, this returns a status and some values that I need for my application scenario. If I call API #2 in sequence immediately, it get a IsReadyStatus returning "false" and I get a null value.
Ideally I would like a delay or sleep call in server actions.
Is it possible to do this with a while or repeat loop?
E.G.
Repeat until API#2 Status Call returns Ready
Issue API#2 call, get value for status
If IsReadyStatus is "True", capture data values, exit
If IsReadyStatus is "false", wait 2 seconds and retry
I still see the need for a delay or wait function as repeating executing against API #2 IMO is similar to a ddos attack on the API.
Any thoughts and recommendations on how to solve? Thanks!