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 there a way to create re-usable sub sequence ? #175

Closed
tdechanterac opened this issue Jan 15, 2025 · 2 comments
Closed

Is there a way to create re-usable sub sequence ? #175

tdechanterac opened this issue Jan 15, 2025 · 2 comments

Comments

@tdechanterac
Copy link

Hello !

I would like to create a reusable sequence in the editor, but only for the current workflow.
For example, I have a sequence with a switch containing 5 branches. Four out of the five branches share exactly the same steps with almost identical content.

To simplify maintenance, I would like to avoid copying and pasting the existing steps. Instead, I’m looking for a mechanism, such as a "sub-sequence" or something similar, to group shared steps in a single place.

Let me give you an example based on your "folders" sample:
I have this flow with 2 folders, and both folders should share the same steps.
image

In the "false" branch, there are some additional steps to be done after the "folder" one.
When editing the flow from the "true" branch folder, I would like it to automatically reflect in the "false" branch folder.

Is there a way to achieve this?
I initially thought of using folders, but it seems they don’t share steps between instances.

Thanks again for the great work and your help!

@b4rtaz
Copy link
Collaborator

b4rtaz commented Jan 16, 2025

Hello @tdechanterac,

One solution that comes to mind for this problem is subprocesses. You could create a dedicated step to run the subprocess, and then define this subprocess somewhere in your UI. The interface might look like this:

Image

When you click on the 'Run Subprocess X' step, you can modify some parameters for the subprocess in the editor. Essentially, the logic remains the same, but you have the ability to control certain edge behaviors.

In "Subprocess X" tab, you will see a separate designer with a different definition.

The downside is that you need to implement the entire logic in both the UI and the execution layer. However, the final design is up to you. For example, the proposed tabs might be a good approach, but perhaps this functionality would work better as a new popup (e.g., a popup within a popup).


If you're looking for a solution that's available out of the box, unfortunately, it's not supported. In my opinion, it's not expected behavior for changes made to one folder's content to be reflected in another folder. A folder is analogous to an OS file system, and such behavior isn't typical in that context.


Another idea is to use a dedicated switch step with sections for "before if" and "after if". These sections would have their own sequences of steps, allowing you to add a step to a specific branch or to the 'before if' or 'after if' sequence.

Image

Perhaps a similar mutation could be helpful. This would require a slightly deeper modification, but I just wanted to present it as an option.

@tdechanterac
Copy link
Author

tdechanterac commented Jan 17, 2025

If you're looking for a solution that's available out of the box, unfortunately, it's not supported.

Ok, thanks @b4rtaz ! That’s what I thought, but I wanted to be sure. I guess I’ll need to think a bit more about how badly I want this feature implemented, since it’s not available out of the box.

One solution that comes to mind for this problem is subprocesses. You could create a dedicated step to run the subprocess, and then define this subprocess somewhere in your UI. The interface might look like this:

I considered creating a designer for each subprocess, but I really like the UI of folder navigation. So I was wondering if something could be done in that direction.

Anyway, thanks again for confirming!

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