Thank you for starting this @Ebz and for linking the additional threads @sudsy. I am having the exact same struggles with trying to set up fail safes with Stripe. Funny enough I was searching the forum for help yesterday, found this thread, and realized you started it only 2 hours prior.
I have approached my wits end with this. I have tried multiple setups using “terminate workflow” actions to “Only When” conditionals on the WF actions, and the best I can get is an unreliable process that works 50% of the time, which is maddening, and an unacceptable nonstarter to launch in public
My current setup starts like this. I built a cart, so the first WF action is to trigger a backend (API) workflow on a list of “orderlines”.
Below is the backend workflow on the list of orders. I am using the Zeroqode plugin in the first 2 actions to create the charge. This third action is based on whether the charge is captured using “only when” where it will write to the “orderline” row “yes” if it is processed by Stripe. This seems to be working reasonably well now. The issues occur after we come out of the API workflow and back into the regular workflow.
The second step after the API part, is to trigger an alert if the “processed by Stripe” field is empty, for any of the recently processed orders. Issue is, the fail message is triggered DESPITE the fact the order has been processed – both actually captured by Stripe, AND written as “yes” processed by Stripe in my DB.
Step 3 is supposed to terminate the remainder of the workflow if processed by Stripe is empty (the same conditional as step 2). This fires and kills the rest of the workflow too, so it clearly didn’t get the message either.
I have tested this dozens of times and it literally works the way it should every other time. Half the time it triggers the charge failed message when the charge did not fail, the other half it works. It’s crazy. Does anyone know why the step 2 in the regular workflow process seems not to be able to read the result of the backend workflow sequence?
Is the backend WF not occurring quick enough for the regular WF to recognize the result? I thought it was all sequential, but perhaps it is not after reading through some other issues people have had. Before this I tried having terminate workflow actions inside the actual backend WF, but that proved not to work so well and there were issues there too when attempting to read previous steps. And also questions on if you can use a “terminate workflow” inside a backend workflow will that only kill the backend workflow, or will it kill all the other workflows in the regular workflow too?
Maybe we can row out of this conundrum together.
Any insight would be appreciated, and hopefully my post helps add to the discussion.