elsa-workflows / elsa-workflows/elsa-core

Performance Degradation in Elsa 3.2 with Workflow Versions and Instance Volume

Open
#6,967 2 comments 1 reaction 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
7.9k
Forks
1.5k
Avg merge
15h 22m
Merged PRs (30d)
114

Description

# Performance Improvement Request

### Performance Issue Overview
We are experiencing significant performance degradation in workflow execution under two specific scenarios while using **Elsa Core and Elsa Designer (v3.2)**. This affects both development and production environments.

## Technical Setup

- **Elsa Version**: 3.2
- **Components Used**: Elsa Core, Elsa Designer
- **Database**: SQL Server
- **Workflow Structure**:
- ~60 workflows in total
- 4–5 main workflows
- Remaining are sub-workflows and nested sub-sub workflows
- Frequent use of:
- `HttpEndpoint`
- `Scripting`
- `Decision`
- sub-workflows as activity

---

## Performance Issues

### 1. High Number of Workflow Versions

- **Problem**: Workflow execution time increases to **~9 seconds** as the number of versions increases due to frequent edits and redeployments.
- **Temporary Workaround**:
- Export and re-import workflows to reset version numbers to 1.
- Execution time improves to **~2–3 seconds**.
- **Observation**: Elsa seems to evaluate all versions or perform extra logic that scales poorly with version count.

### 2. High Number of Workflow Instances

- **Problem**: When the `WorkflowInstances` table has more than **~800 entries**, the execution time of main workflows increases to **~9 seconds**.
- **Temporary Workaround**:
- Deleting or truncating the `WorkflowInstances` table.
- Execution time improves again to **~2–3 seconds**.
- **Impact**: This workaround is not sustainable in a production environment where historical workflow instances are important.

## Request

Please investigate these performance bottlenecks. Let us know if profiling data or further logs would help identify the root cause. We're happy to assist with more detailed testing if required.

Thank you for your hard work on Elsa – it's a great framework, and we’d love to help improve it further.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.