How to implement complex branching logic

(Dotan Naveh) #1

I am trying implement an application based on FlowXO which requires complex branching logic with many branches and subroutines. The only way I found to branch is by calling another flow via the Flow service. However, I quickly ran into two problems with this approach:

  1. I need to create a large number of “workflows” in order to implement what is really one workflow, and quickly run into the account limits
  2. I did not find a way to wait until the workflow that I call as a subroutine finishes before continuing the calling workflow

Any solution to the above? Any other way to do branching and subroutines? What I am looking for is a way to implement a complex flowchart in my workflow and branch and call mini-workflows based on conditions.

(Kellsey Shaw) #2

Hi Dotan,

The Flow service would be ideal for more complex processes where you need to break out into other processes. You can easily add more flows to your account whenever you need more. You can add 5 extra flows for $10 a month.

There are few techniques that you can use to help with complex use cases.

You can chain flows together to be able to ‘resume’ when another process has finished.You just need to break the process up into individual sections (Flows).

So let’s say that are three sections to a process. The first and last section will always happen but the second only happens under certain conditions. You’d have Flow’s A, B and C. Flow A would start Flow B (using the Flow service) if the conditions were met but if not it would start Flow C instead. Flow B will always start Flow C (using the Flow service) once it has finished.

Another option is to use outputs to populate tasks rather than using filtered tasks. So an example of this would be, asking the user a question and if then using the answer to look up values in a Google Sheet and using the returned rows to populate the next question/task. If there were 5 possible variations, I would have had to use 5 filtered tasks but this way, I just need one task.

If you need something more advanced to decide what the next task should be populated with, you can use the Code service to evaluate it and then output the text that is to be used in the next question/task.

(Dotan Naveh) #3

Hi Kellsey and thank you for thedetailed answer!

I will try the Google sheet option to create generic flows instead of using different flows for different questions - it’s a good idea and can save some flows.

However, I have an issue with the cost structure. I need to pay (quite a lot probably since I expect maybe 50 flows for an MPV and many more for a product) just to develop a POC, without having any users yet. And all these flows are really one bot with one actual flow, I am just using them to create logic. Is there a workaround for that?

Dotan

(Kellsey Shaw) #4

Hi Dotan,

That does sound like you have a really complex flow structure to implement.

There’s not really anything that I can suggest other than what I already have. Prices are low for an enterprise level product and with everything that we are investing into stability and flexibility you really are getting a lot for the price.

We don’t charge for the tasks in the flow like most others, though so you can have as many tasks as you like in each flow so perhaps you could try and group processes where possible and use filters where possible rather than having each process in an individual flow.