I’ve added a POST API that i’ve created in Xano through Collections. Then created a Workflow for a button that will call this API when a button element is clicked. As you can see from below, user will then be navigated to Stripe’s checkout page. The problem i’m having from below workflow is that after the first workflow (i.e. calling the API to Xano), it sends another API call. How do i fix this?
I’ve asked claude and it said to make sure to switch off Fetch Xano automatically which i’ve done but issue persists.
Hi @gbab48018 I would like to help, but I do not understand the problem at all. This second call you are seeing where is the call going to? The same API endpoint in Xano?
So are you saying the problem is that on the click of a button you are getting TWO api calls to Xano instead of one? So that navigation to stripe is happening twice? Instead of once?
If that is the problem, then what you can do is setup that button click defensively:
Make a variable of boolean type call it disableCheckout (set default to false)
So for the first action in your workflow make it a change variable value action which sets disableCheckout to `true`
Then below that but above that API call action, add a '“pass through condition” action (so the second action inside your workflow will be this pass through condition)
Set the pass through condition to disableCheckout variable = true
Then your API call to xano
Then your navigation
Then after the navigation action reset variable action and reset disableCheckout
Find the trigger button (in the UI), bind the disabled property to disableCheckout variable
That’s it.
So what now happens is that even if the UI button is clicked twice (which often happens) it will only fire once per run, so unless that run ends a new button click cannot trigger the workflow.
I hope this addresses your issue, if this is not the issue you are facing, then you will need to provide better explanation of what the issue is, as I really can’t understand it beyond what I could gather. If you the issue persists, please provide a clearer explanation, and I or someone else may be able to help further. Cheers
The workflow looks like the following. The action ‘Call XanoStripe API’ calls Xano’s endpoint named ‘sessions’. (This endpoint in turn calls a Stripe endpoint, and returns the Stripe checkout url along with other information to Weweb).
…and if you check the datatable in Xano for this transaction, you see two multiple sessions. One is the one that went through and updated by the webhook, but there’s another redundant one. Can you help me why this might be happening?
Can you check if the “Stripe session API” collection in your project has “Fetch this collection automatically” enabled and, if it is, try disabling it and see if the issue persists?