Server Connect - Don't wait for API (API Action) to respond just keep going

Server Connect - Don’t wait for API (API Action) to respond just keep going…

I have a insert record with SC.
Once things are done it requests the API… writing data to Twilo
But sometimes the API takes 1 - 3 seconds to respond before SC continues.

What can I do… to keep the SC going even if the API is still doing its thing…
Basically make SC assumes that the API did its thing…
Im sure its been asked a million times… but i cannot find the right wording … or search terms

The server action steps run sequentially, so the next step will always wait for the previous one to complete.

1 Like

thank you… mmm and if I use TRY/CATCH? will it still wait?
Can you recommend some other way then…

Page Flow? … 2 different SC?

Try/catch is used to catch errors and run specific steps when there are errors.
I don’t know what exactly are you try to do, so i can’t recommend a way - i don’t know what your logic is there.

1 Like

sorry i completely understood Try / Catch wrong. :slight_smile: :slight_smile: ill see if i cant find a server close to south africa for the api’s endpoint. …

If you were using NodeJS, there is a parallel action that allows you to run multiple steps at once in parallel. But as you are using PHP that is not possible there.

1 Like

problem im in South Africa… where NodeJS is luxury and constraints geologically … unless you have a great big budget for Amazon :wink: … you know the full story… :slight_smile: ill just have to do with what i have … thanks for the suggestions.

Hey @Mozzi,

Can I ask 2 questions in order to know how this works?

  1. This serverAction is called from the serverconnectForm that inserts your records?
  2. Your API action (appWhatsAppAlertClickATell) is returning responses that you can catch?

I’m asking these questions because what I have in mind is that probably you could split your serverAction in 2 steps:


Your form is submitted with serverAction_1step and IF YOU CAN catch the response in your form events then call serverAction_2step

Sorry if what I’m asking is stupid and not doable but I haven’t work with API actions and I don’t know how it works…

Thank you… Im already doing that… as there are more steps infront of it. Even if I make it the LAST action. It will still do the same as Teodor said it runs sequentially. Basically it will only return n “success” when all done… so it will regardless wait for the API to do its thing… and then only “exit”

That API… its to send a whatsapp via Twilo. So its a post reqeust.

1 Like

Sorry again… Can’t you “catch” twilo’s response? (sent whatsapp successfully/error)

For me that’s pretty fast :rofl:
I assume you mean minutes right?

If you don’t need the response:

What about creating a new api for the twilio post (an insert to another table), and a cron job every x time with a query/step/update new table?

1 Like

This sounds like a good use case for job scheduler.

lol… no seconds… hahaha… i want it to happen instantly and close the modal :slight_smile: :wink:
i guess i just want it fast…

mmmm what if i let my form use “page flow” and then have 2 server actions… or is page flow also run action steps sequentially?

lol php here… i know i know… but the managed server for all our sites cost as much a 1 nodejs js instance on aws :slight_smile: :slight_smile: but let not go there… :slight_smile:

Don’t you have other cloud providers other than AWS? Any provider that allows you to setup a VPS should be fine, especially if you use Docker in Wappler.

Are you trying to instantly use the data? If not then you can close the model and figure out a way to process the data in the background.

There is a feature request to make app flows run as web workers, but at the moment they will run sequentially.

Vote for this.

1 Like

Great I voted…

I used digital ocean before and hetzer but the latency is the biggest issue.
Yes the i guess the next step is to get a dedicated server and setup node on it…