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

Add workflow restart functionality for handling interruptions #6435

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

sfmskywalker
Copy link
Member

@sfmskywalker sfmskywalker commented Feb 22, 2025

Introduced a mechanism to identify and restart interrupted workflows. This includes a new IWorkflowRestarter contract, its default implementation, and a recurring task for handling restarts. Additionally, updated configurations and added extensions to improve workflow instance filtering and liveness tracking.


This change is Reviewable

Introduced a mechanism to identify and restart interrupted workflows. This includes a new `IWorkflowRestarter` contract, its default implementation, and a recurring task for handling restarts. Additionally, updated configurations and added extensions to improve workflow instance filtering and liveness tracking.
Introduce `WorkflowHeartbeatMiddleware` to monitor workflow liveness and update timestamps during execution. Extend WorkflowInstanceStore implementations to support updating the `UpdatedAt` timestamp across various data stores. Enhance Dapper query builder and workflow execution pipeline with related functionality.
Add a debug-level log message to indicate when the heartbeat pulse is generated. This improves traceability and helps in diagnosing runtime behavior during development and debugging.
This change updates the logging configuration to include Debug-level logs for WorkflowHeartbeatMiddleware. It helps in better monitoring and debugging of workflow heartbeat operations.
Renamed 'WorkflowLivenessThreshold' to 'InactivityThreshold' for clarity and updated its usage across affected files. Adjusted timings for workflow restarts and delays to improve consistency, including increasing task delay and updating scheduler intervals. These changes enhance readability and align with revised task execution timelines.
@sfmskywalker sfmskywalker linked an issue Feb 22, 2025 that may be closed by this pull request
@sfmskywalker sfmskywalker added this to the Elsa 3.4 milestone Feb 22, 2025
Replaced the retrieval of ISystemClock from the context with direct dependency injection. This improves clarity and reduces unnecessary dependencies on the execution context for service resolution.
The terminology has been updated from 'pulse' to 'heartbeat' for consistency and clarity. This affects method names, logging messages, and related variable names. The change improves code readability and aligns with the intended functionality.
Introduce `IsExecuting` flag to explicitly track activity execution state, improving clarity and control over workflow activity handling. Adjust scheduling intervals and add concurrency handling for database updates to enhance reliability and performance in interrupted workflows.
This commit introduces migration files for multiple database providers (MySQL, SQL Server, PostgreSQL, SQLite, and Oracle) to support schema changes for version 3.4. The migrations primarily involve mapping entity schemas, indexes, and table structures for consistency across all supported database systems.
Previously, the `WorkflowExecutionContext.IsExecuting` flag was incorrectly set to `true` after an activity executed, causing potential logic inconsistencies. This change ensures the flag is correctly set to `false`, maintaining the expected workflow state.
Updated method signatures to replace 'default' with 'null' for better clarity and explicit handling of optional parameters. Additionally, refined comments and variable naming to improve readability and accuracy.
The variable `livenessThreshold` was renamed to `inactivityThreshold` to better reflect its purpose and improve code readability. This change ensures consistency with the surrounding context and enhances maintainability.
This update ensures that feature branches are included in the workflow triggers, improving automation coverage. It aligns the workflow configuration with the branching strategy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

Restart Interrupted Workflows - Hosted Service
1 participant