totaljs / flow

Flow
MIT License
538 stars 121 forks source link

Use Flow as part of a bigger app #75

Closed hobojoe closed 1 year ago

hobojoe commented 1 year ago

Hi,

I was hoping to use Flow as a part of a bigger app, just to control a specific workflow of actions where I would like to giver the users of the app the freedom to customize their workflow using flow ui (hopefully embedded into my angular app). After the user creates the flow, I would run in on my server from time to time.

Is something like that possible with Flow?

ps: ideally it would be nice to customize the UI (embedded) and limit some of the "nodes" the user can use.

Thanks!

petersirka commented 1 year ago

Hi @hobojoe, You can do anything you want. The Total.js Flow application is completely open-source and customizable.

Notes

Embedding into the Angular app Only as an iframe, or you must completely rewrite the entire flow UI logic in Angular. It will take a lot of time on your side.

After the user creates the flow, I would run in on my server from time to time. I don't see any problem with it. A generated FlowStream can be provided as a server-less application.

ideally it would be nice to customize the UI (embedded) and limit some of the "nodes" the user can use Not a problem.

Thank you!

hobojoe commented 1 year ago

ideally it would be nice to customize the UI (embedded) and limit some of the "nodes" the user can use Not a problem.

Is there any example on how to do it?

Thanks!

petersirka commented 1 year ago

@hobojoe No, we don't have an example. We can assist you with our support services, however. You can contact us at info@totaljs.com if you are interested.

ColtonMcInroy commented 1 year ago

I would like to eventually do this as well. It would be very nice if the whole interface for Flow was made in such a way that it could be embedded into another application. I have had some thoughts about this and one thing I could see that would make this at least a bit easier, would be to made Flow use a specific URL rather than be based off of root (/).

Loading up the editor via /flows/ or something like that would allow people to serve a service or page off of root. The problem with this appears to be that current Flow doesn't allow overlapping paths like most other services. Support would need to be added so that flows have an order of precedence based off of the path the way that most web servers operate. This way someone could have / serve a page and /api handle API calls from the page allowing them to visually build both sides of an application.

Other than that, if you designed the frontend part of Flow to be a component which has a configurable server URL that it does API calls to and then had a separate component for the backend server you could decouple them and allow for more use cases. Having a Flow server and Flow editor as separate components I imagine wouldn't be too hard to accomplish. Adding some UI into the editor to allow for storing the Flow Server API Urls of different servers would be handy allowing users to use a single editor to connect to different instances. I would suggest that feature be something configurable though, because if you are to have the frontend separate, some use cases would want to use the editor but prevent access to changing it to use another backend server opting to have it a configured value of what server it connects to.

petersirka commented 1 year ago

Loading up the editor via /flows/ or something like that would allow people to serve a service or page off of root.

It's possible, you need to update /config by adding: https://docs.totaljs.com/total4/4047c001sd51c/#4c0f0001bc51c

... then had a separate component for the backend server you could decouple

We have it, it's called FlowStream. https://github.com/totaljs/flowstream it uses an external designer provided by our server, but it can be provided by your server: https://github.com/totaljs/flowstreamdesigner... but of course, that project is quite special, it is dedicated to advanced customization. From there, Total.js Flow is built.

BTW: Check out two other projects:

ColtonMcInroy commented 1 year ago

What's the main differences between FlowStream and Flow? I thought that Flow v10 was the evolution of Flow v4 -> FlowStream -> Flow v10 and that Flow v10 would replace FlowStream so I never really bothered with it.

petersirka commented 1 year ago

FlowStream (inspired partially by the older Flow) was first released before Flow v10. We needed to create a new "Flow" version targeted at customizations. The old Flow wasn't suitable for it. I started with a brand-new designer: https://componentator.com/components/j-flow/ and then I inserted the fixed core directly into the Total.js framework -- it's called FlowStream, and we use it in a lot of places, including alarms, rule engines, etc.. And we knew that we needed a more modern version of the Flow and this was the fastest way to do it. And I wanted to add multi-threading to every flow, and now it works ... It was really a coincidence. So that's the background story.

So now we can customize Flow for everything. There are unlimited possibilities.

petersirka commented 1 year ago

@ColtonMcInroy We have updated Total.js Flow by adding support for Total.js Web Components. You can test it. Also, I have released a newly stable version of the Total.js framework to NPM.

Thank you