Enhancing Workflow Execution Models in ELSA 3 - Transactional vs. Distributed Modes #5225
Replies: 2 comments
-
To address the challenge of integrating an actor model while maintaining the ability to interact with specific contexts like HTTP, the proposed solution of having two distinct execution modes seems like a practical approach. Here are some thoughts and considerations based on the information provided:
Overall, the proposed solution seems to be on the right track. However, it will be important to consider the complexities of state management, transitions between modes, and the need for robust monitoring and security measures. Additional feedback from the community and further testing will be essential to refine these models and ensure they meet the diverse needs of users. This comment was generated by Glime. |
Beta Was this translation helpful? Give feedback.
-
In our case, we’re employing a workaround that might align with your proposal. For workflows triggered by HTTP requests, particularly those involving slower activities, we handle the scenario by returning an HTTP 202 response once inputs are validated. This response includes an ID, which the client can use to track the workflow’s progress. To ensure the HTTP response is properly sent before further processing, we force a "flush" with a short delay (typically one second). This approach enables the workflow to decouple from the HTTP context quickly, allowing us to manage longer-running activities asynchronously. The client can periodically check the workflow status using the provided ID through a separate retrieval activity, which monitors whether the required data or process is complete. We’re currently using this in a single-instance setup, but we're exploring the possibility of transitioning to a distributed runtime. One key feature for us is the ability to bind specific activities to specific machines or environments. For example, we have on-premise machines handling file processing tasks due to their proximity to data, while most of our instances run in the cloud. This functionality is crucial, as it allows us to take advantage of specialized hardware and meet compliance requirements while leveraging the scalability of cloud-based infrastructure. |
Beta Was this translation helpful? Give feedback.
-
We're exploring potential enhancements to Elsa Workflows and would love your input! As Elsa continues to evolve, one of our goals is to balance robust, scalable workflow execution with the flexibility needed to handle various use cases, including those requiring immediate HTTP context interactions.
Background
Elsa supports workflows that can start or resume based on various triggers (like HTTP requests, timers, etc.). These workflows operate within a transactional model where context-specific actions are necessary (e.g., directly sending HTTP responses). However, to improve scalability and fault tolerance, we are integrating the Actor Model pattern using Proto.Actor, transitioning towards a more distributed, actor-based execution model.
The Challenge
Integrating an actor model raises a question about context-specific executions, particularly those that need to interact directly with the HTTP context. The actor model inherently abstracts execution away from specific contexts, posing a challenge for workflows that need to respond directly within their initiating context.
Proposed Solution – Two Execution Modes
Transactional Mode:
Distributed Mode:
Mixed Mode Scenarios
Some workflows might start in a transactional mode and then need to transition to a distributed mode. We’re considering mechanisms to dynamically switch execution models within a single workflow's lifecycle.
We Need Your Feedback
Your insights are invaluable to us. Please share your thoughts and experiences, or any additional considerations that could help us refine these models.
Beta Was this translation helpful? Give feedback.
All reactions