Workflow not triggering "Every Time" when it's true twice in a row

OK I have an unusual problem with a workflow where it runs when I want it to, for the most part, but not if the condition is “true” twice in a row without transitioning back to false. I’m wondering if anyone knows how to trigger a workflow “again”, when a condition is still true?

I have tried incorporating the “Reset Inputs” action and a page refresh but neither seem to re-trigger the workflow as I would like. I suspect it is because the inputs that are evaluated for the “when” condition are returned values themself from an API call and not saved within the bubble db, but I’m only guessing.

I have two similar or parallel workflows that act as follows:

On Button click, Make an API post (with some value of A as the API input), where the API returns a new value of A after some calculation.

Now, there is a second and copy of the workflow that runs the same API POST but only “When A’s value is greater than B”, (without a button click) that has a workflow condition of Only when the condition is true of A > B.

On the first transition when A becomes bigger than B the 2nd workflow works, but the APIs subsequent return doesn’t re-trigger the 2nd workflow again as I would like it to, as A value is still bigger than B. I know it seems like a looping condition but I can assure you it is not as the value of A will shortly become smaller than B in another cycle or two.

Thanks

Hi, not quite sure I understand - but here is a shot at it.

Q. Are you wanting to keep executing while a condition continues to be true (A) or only execute the condition every other time it is true (B)?

(A) If it is the first case; I would suggest using a loop inside the workflow (or on the backend API) that keeps iterating until the condition becomes false.

(B) If it is the second; you can use a custom numeric state and the <-modulo-> 2 function.

Regards,
John

Thanks John, I think the direction I need is more in line with a “custom numeric state and the <-modulo-> 2” but I could use some more detail or direction on that. My preliminary interpretation was to make a conditional filter for 2 similar workflows with the modulo of a counter and the other condition; but I’m not getting it to work.

Basically, I would like the workflow to “loop” until, a condition becomes true, where the condition is evaluated after each API’s POST response. I think this is the source of the problem as when the values come back from the API it doesn’t seem to trigger any new evaluation.

Say the API is a simple subtraction calculator, it subtracts 2 from a number given, and is triggered by a button click, that sends in the value of input box A.
So, I enter and send in a value of 10 and it responds with a value of 8, that gets loaded into input A.
Now a workflow notices that the result of 8 is greater than 5, (where 5 is a simple threshold) and it triggers another workflow with the same API call using the new input value of 8, which it should respond with 6, and again until the response is 4, but it doesn’t get called more than once. It’s like the loading of data into things by a workflow doesn’t get evaluated by the conditional evaluator.

Currently I’m using the modulo idea but it’s not “ideal” as it only pseudo-loops 3 times.

I have 3 workflows copied that each run if the condition of A < 5 AND a custom state counter <-modulo-> 3 is 0, 1 or 2, each respectively filtering and thus running workflow copies 1,2 or 3.

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