Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is specific scenario achievable with sequential-workflow-designer #178

Closed
akiryazov opened this issue Feb 6, 2025 · 5 comments
Closed

Comments

@akiryazov
Copy link

Hello!

First I'd like to start that I am not logging an actual issue but rather asking if a specific case is feasible with the library.

I am looking for a new workflow library for my project and encountered sequential-workflow-designer. I liked the design and the functionality which provides but while trying to create PoC using project data, I couldn't do it. I was looking in the documentation and source code as well but didn't find a way.

Image

This is the graph that I have. As you can see the start node has 4 child nodes. If we check reader and user data nodes, we can see that both of them are connected to a single child agg having few more children. We can consider this beign a sub-workflow.

While experimenting with sequential-workflow-designer, I tried 2 approaches. One of them was with using if statements, the other was parallels. However, we can see that both approaches need to connect to one and same child.

Image

Image

Did I miss something or just the library doesn't support such functionality yet? Many thanks in advance!

@b4rtaz
Copy link
Collaborator

b4rtaz commented Feb 6, 2025

Hello @akiryazov,

the flow from the first image could be represented in this way:

Workflow JS

I introduced two if conditions that create branches. The else part solves the problem of two flows that are expected to merge.

Basically, this problem would be solved in the same way in some programming languages.

if (condition1) {
   t1();
   readerIteration();
} else if (condition2) {
  userData2();
  t2();
} else {
   if (condition3) {
      userData();
   } else {
      reader();
   }
   agg();
   w1();
   gate();
   nw();
}

@akiryazov
Copy link
Author

akiryazov commented Feb 7, 2025

Many thanks for the answer, @b4rtaz!

Is it correct that this can be done only through code and not through the editor? Because I am trying to achieve it with Drag & Drop and I manage to have only 2 if conditions. Sorry if it's there and I just can't find a way :)

@b4rtaz
Copy link
Collaborator

b4rtaz commented Feb 7, 2025

The flow from my screenshot I did in this demo. I used Parallel and Write steps. After I placed the Parallel step I added expected branches by clicking Add branch in the step editor, then I deleted default branches. But this is only an example how you can create dynamically branches in the designer.

Here (the Branches step) is an example with a better experience for creating dynamic branches.

@akiryazov
Copy link
Author

@b4rtaz , many thanks again for the quick response!

One last question - is dynamic branching functionality available only in the pro version of the editor?

@b4rtaz
Copy link
Collaborator

b4rtaz commented Feb 10, 2025

You can implement dynamic branches manually as you can see in this example. If you want to use Sequential Workflow Editor then you need the branches additional editor or the depended value model (both available only in the pro version). You can check the pricing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants