How wait for result from api workflow before navigating to another page or changing state on current page?

Hi everyone, been stuck for a couple of days with creating an action based on the result from an API workflow (the action populates a user field which decides the correct next page to take them). The problem seems to be that the app does not wait on the results from the API workflow before starting the next action so it kind of jumps over the step and goes to the next one.

I have tried to maintain the workflow all in the backend to be able to use the “result of” function but I can’t seem to find the options to control navigation through "change state’ or “go-to” in the backend workflow.

As I mentioned earlier, if I keep the workflow in the frontend the app jumps over waiting for the results from the API workflow and takes the user to the wrong page as the user field from the API workflow hasn’t been populated yet.

Does anyone have any tips or advice? Any help would be appreciated as I’ve been banging my head against the wall on this for a while.

You can have multiple API workflows that call the next one.

Frontend Workflow 1:
Delete Current User’s Favorite Pizza. - - Schedule API workflow 1 Now.

API Workflow 1:
Make new pizza - - Go to workflow 2

API Workflow 2:
Edit pizza type- - Go to workflow 3

API Workflow 3:
Make changes to current User’s Favorite Pizza = = This New pizza

So essentially you’re using the backend workflows to “piggy back” off eachother to make sure they run sequentially. You can pass along the new item to each workflows as well. You can make sure the user has to wait for the workflows by doing something like I’ve shown above where you “delete” the info (so it’s blank to the user) then it only shows when it’s populated with the completed workflows.

Let me know if this makes sense or if I’m talking to myself :stuck_out_tongue:

@jobs thank you for the tips, I think I see where you are going with this. I’m able to get the new data populated in the database. However, I’m still struggling with getting the state of the page change or have the user go to a new page based on the data from the scheduled backend workflows. I just don’t see those actions to include (set state & go to) in the backend workflows…

Got it to work by adding a “add a pause before next action” but surely there has to be a better way to navigate users to different sections based on the results of a scheduled a workflow?

We can’t reach the result of step Schedule API or set state on it. But you can add one more field in your DB for navigation.Then just add this field to the Schedule API and based on the result, navigate to another page.
Step 1 - The Schedule API changes a user field
Step 2 - Go to the page (conditions: Only when Current user’s user field contain … etc)
Step 3- same as step 2 but with different condition.
It means step 2 or step 3 will be skipped depending on which action was populated.

What about states, you can set state depending on result of those changed user field in Schedule API with workflow " do condition when true".

This topic was automatically closed after 70 days. New replies are no longer allowed.