Elsa V3 Hangfire Disptacher \ How does Elsa V3 manage workflow \ activity execution across workflow servers? #5857
BostrongLonsec
started this conversation in
Design & tech
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Guys,
Firstly great work with this framework.
It has been a great to work with and my clients are happy that they can now emulate their business processes using this framework.
My Elsa 2 + Hangfire Dispatcher Usage
I started off initially using Elsa 2 with .net 6.
Worked great and was well adopted across our development teams.
With Elsa 2 there was Hangfire integration which allowed for dispatching entire workflows to Hangfire to manage the processing of.
This had a few benefits, namely Hangfires ability to scale processes and compute, and then manage workloads across all the avilable threads.
We also created an in-house Jobs and Events framework which wrapped around both Workflows and standard Mediatr UseCases.
This Jobs and Events framework allowed you run the jobs (which were essentially just wrappers for Mediatr UseCases and Elsa workflows) in one of two ways ...
IN PROCESS
Synchronously execute the Mediatr UseCase as normal
OR
Synchronously execute Elsa 2 workflow in the same calling thread using the Elsa workflow runner service
Both of the above methods allow for running small units of work usually from UI or a web API call.
OUT OF PROCESS
Asynchronously dispatch the Mediatr UseCase to Hangfire
OR
Asynchronously dispatch the Elsa 2 workflow to Elsa workflow server which was configured to use Hangfire dispatching (as per elsa 2 config doco)
i.e. In startup code like so:
services.AddElsa(elsa => elsa.UseHangfireDispatchers())
Elsa 3 + Hangfire ??
For Elsa 3 implementation, I am pretty much just trying to upgrade the above mentioned code to .Net 8, and then refactor the code to accommodate changes and differences between Elsa 2 and Elsa 3.
So far so good, it is all working with the exception of the Hangfire Dispatcher.
I can't exactly work out how to get my Elsa 3 workflows dispatched into Hangfire for processing.
I've looked at all the samples and have followed what I could for what doco is available on the Hangfire integration for Elsa 3.
I have looked through the Elsa main branch code (namely the area around the link below), but can't seem to find anywhere where it offers a way to dispatch workflows or workflow activities to Hangfire.
https://github.com/elsa-workflows/elsa-core/blob/main/src/modules/Elsa.Hangfire/Extensions/ModuleExtensions.cs
If you could point towards anything I am missing that would be greatly appreciated?
Is There Even A Need for Hangfire at all in Elsa V3
And lastly a general question around whether using Hangfire dispatcher actually provides any real benefit in Elsa V3?
Like I said in above sections, Hangfire is great because it quietly manages allocation of workloads and required threads across it's fleet of available servers \ processes with you having to do any of that yourself. So it scales nicely and keeps the code portable.
Does the Elsa 3 workflow server have any similar architecture under the hood that auto-balances the units of work (i.e. workflows or individual workflow activities) across available workflow servers and the processes and threads on them?
Beta Was this translation helpful? Give feedback.
All reactions