Waiting API call response

Hi everyone,
I have a client-side workflow consisting of two steps
The first step is a server-side API call to a payment gateway
The second step is a redirect to the url that I read from the API result

I should wait for the result of the call before doing the browser goto otherwise the URL parameter is empty.
How can I check that the API has given me the positive response?

The run steps in the flows run asynchronous. You can’t check if the previous run step has finished or not.
In your case, remove the last step - (run >browser goto) and instead use the onsuccess event on the server action component to call it.

Hi Theodore,
never used the server side onsuccess event yet, how do I set it?
After checking the event where do I redirect? Client side or server side?
Can you kindly give me an example or insert links to documentation?
Thank you

I am not referring to the server side redirect.
In your App Structure select your Server Connect component, click Dynamic Events > Server Connect > Success and add the redirect there.

2 Likes

Works great!
Thank you