Find a file
Sipke Schoorstra 65604b6563 Remove signal capturing phase (#5501)
* Add logging to the WorkflowRunner service

The WorkflowRunner service now uses the Microsoft.Extensions.Logging namespace to log the workflow execution context. These changes include passing the ILogger<WorkflowRunner> logger dependency through the constructor and implementing the context logging functionality in the RunAsync method.

* Update error handling in FindActivityDescriptor method

FindActivityDescriptor method's error handling has been updated. Now, instead of throwing exception, it returns null when an activity descriptor can't be found. Also, a logger warning has been added to indicate when this situation occurs. This change helps avoiding unexpected disruptions and improving debugging experiences.

* Add ReSharper properties to .editorconfig

This commit introduces specific ReSharper properties to the .editorconfig file. This update will maintain a consistent configuration of ReSharper across different development environments, intending to improve coding standard consistency.

* Add thread and activity ID to Flowchart logging scope

The Flowchart activity in Elsa Workflows Core module has been modified to include thread and activity ID in its logging scope. This change will provide more granular information when debugging workflow execution. Additionally, the definition for outcomeNames has been streamlined.

* Add ActivityInstanceId to logger scope

Added "ActivityInstanceId" as part of the logging scope dictionary in the Flowchart module. The new key records the context's target context's id for improved debugging capabilities.

* Remove signal capturing functionality from workflow activities

Removed the functionality related to signal capturing from the Elsa workflow activities. This refactor involves changes in core classes such as Activity, Behavior, and Flowchart and removes associated methods and handlers. This simplifies the signal handling process by only allowing activities to receive signals, eliminating the previous two-step process of capturing and receiving.

* Update debugging messages in Flowchart.cs

Clarified the debugging message when there's an existing join context. Removed unnecessary logging for "No pending work found", "No faulted activities found", and "Completing flowchart". This will make the debugging log less cluttered and more focused on relevant information.

* Refactor logging messages in Flowchart activity

The commit removes the verbose logging message indicating the completion of a terminal activity in the flowchart Context. This logging message was unnecessary and was generating excessive log messages. The log message for new join activities was also updated to accurately reflect the creation of a new join context.

* Disable SonarCloud analysis from workflow

The SonarCloud analysis steps, including scan setup, run and end steps have been commented out in the GitHub workflow. This is a temporary change to speed up build times while troubleshooting an issue.

* Uncommented SonarCloud analysis related code in packages.yml

In this commit, the parts of the code related to the set up of JDK 17, SonarScanner for .NET, Coverlet for code coverage, and SonarCloud analysis were uncommented in the GitHub Actions workflow packages.yml file. This will enable those tools and services during the execution of the workflow, improving code quality and test coverage.

* Change position of root assignment comment in .editorconfig

* Format method signatures in WorkflowRunner

Changed the method signatures in the WorkflowRunner class to be in a single line for readability and to follow coding standards. The refactor involves three RunAsync method overloads, contributing to the overall cleanliness and readability of the source code.
2024-06-04 16:44:23 +02:00
.github Disable SonarCloud analysis in packages workflow 2024-06-03 15:06:57 +02:00
.nuke Feature/sonar cloud (#5224) 2024-04-26 15:46:34 +02:00
build Feature/sonar cloud (#5224) 2024-04-26 15:46:34 +02:00
design Remove unused BulkExtensions (#5160) 2024-04-02 15:15:29 +02:00
docker Add MongoDB to docker-compose.yml 2024-04-01 23:18:18 +02:00
docs Added more escaping 2024-04-10 21:08:59 +02:00
gen Update DSL and sample 2022-03-28 13:25:45 +02:00
migrations Regenerate V3.1 EF Core migrations with custom runtime schema support (#5155) 2024-03-29 21:15:23 +01:00
samples Update packages (#5286) 2024-04-26 20:07:34 +02:00
src Remove signal capturing phase (#5501) 2024-06-04 16:44:23 +02:00
test Global read-only and read-only workflows (#5406) 2024-05-27 10:06:39 +02:00
.editorconfig Remove signal capturing phase (#5501) 2024-06-04 16:44:23 +02:00
.gitignore Add NUKE build support (#4815) 2024-01-21 10:53:07 +01:00
build-and-run-all-in-one-web-docker.sh Update AllInOne dockerfile 2023-12-04 14:25:34 +01:00
build.cmd Add NUKE build support (#4815) 2024-01-21 10:53:07 +01:00
build.ps1 Add NUKE build support (#4815) 2024-01-21 10:53:07 +01:00
build.sh Add NUKE build support (#4815) 2024-01-21 10:53:07 +01:00
CONTRIBUTING.md Create CONTRIBUTING.md 2024-01-03 16:22:03 +01:00
Directory.Build.props replace configureawait.props and frameworks.props with Directory.Build.props 2024-01-26 19:04:39 +02:00
Directory.Packages.props Update Npgsql package versions 2024-05-22 16:33:57 +02:00
docker-compose.yml Add new docker-compose files, new activities and services 2024-03-24 20:28:19 +01:00
docker-run-all-in-one-web.ps1 Add samples and docker support 2022-04-29 14:40:25 +02:00
Elsa.sln Bugfixes for heartbeats using MongoDB (#5337) 2024-05-08 20:19:40 +02:00
Elsa.sln.DotSettings Add serialization tests and refactor serialization classes 2024-02-06 08:45:54 +01:00
generate-migrations-initial copy.sh Add compression feature for workflow state data 2024-02-03 22:24:46 +01:00
icon.png Debug 2022-12-20 12:47:41 +01:00
LICENSE Add sources from experimental repo 2022-01-04 09:42:12 +01:00
NuGet.Config Enhanced Workflow Instance Filters (#4957) 2024-02-18 23:40:03 +01:00
README.md [no ci] Update README.md 2024-04-02 21:46:18 +03:00

ELSA 3.0

Elsa Workflows

Elsa 3 Prerelease Nuget (with prereleases) feedz.io Docker Image Version (latest semver) Discord Stack Overflow questions

For Elsa 2 Click Here

Introduction

Elsa is a powerful workflow library that enables workflow execution within any .NET application. Elsa allows you to define workflows in various ways, including:

  • Writing C# code
  • Using a visual designer
  • Specifying workflows in JSON

Elsa ships with a powerful visual designer

Try with Docker

To give the Elsa Studio + Elsa Server a quick spin, you can run the following command to start the Elsa Docker container:

docker pull elsaworkflows/elsa-server-and-studio-v3:latest
docker run -t -i -e ASPNETCORE_ENVIRONMENT='Development' -e HTTP_PORTS=8080 -e HTTP__BASEURL=http://localhost:13000 -p 13000:8080 elsaworkflows/elsa-server-and-studio-v3:latest

This Docker image is based on a reference ASP.NET application that hosts both the workflow server and designer and is not intended for production use.

By default, you can access http://localhost:13000 and log in with:

  Username: admin
  Password: password

Table of Contents

Documentation

For comprehensive documentation and to get started with Elsa, please visit the Elsa Documentation Website.

Known Issues and Limitations

Elsa is continually evolving, and while it offers powerful capabilities, there are some known limitations and ongoing work:

  • Documentation is still a work in progress.
  • The designer is not yet fully embeddable in other applications; this feature is planned for a future release.
  • C# and Python expressions are not yet fully tested.
  • Bulk Dispatch Workflows is a new activity and not yet fully tested.
  • Input/Output is not yet implemented in the Workflow Instance Viewer.
  • Starting workflows from the designer is currently supported only for workflows that do not require input and do not start with a trigger; this is planned for a future release.
  • The designer currently only supports Flowchart activities. Support for Sequence and StateMachine activities is planned for a future release.
  • UI input validation is not yet implemented.

Features

Elsa offers a wide range of features for building and executing workflows, including:

  • Execution of workflows in any .NET application with support for .NET 6 and beyond.
  • Support for both short-running and long-running workflows.
  • A programming model loosely inspired by Windows Workflow Foundation.
  • A web-based drag & drop designer with support for custom activities.
  • Native support for activity composition, including activities like Sequence, Flowchart, and ForEach.
  • Parallel execution of activities.
  • Built-in activities for common scenarios, such as sending emails, making HTTP calls, scheduling tasks, sending and receiving messages, and more.
  • Workflow versioning and migration via API.
  • Easy integration with external applications via HTTP, message queues, and more.
  • Actor model for increased workflow throughput.
  • Dynamic expressions with support for C#, JavaScript, Python, and Liquid.
  • Persistence agnostic, with support for Entity Framework Core, MongoDB, and Dapper out of the box.
  • Elsa Studio: a modular Blazor dashboard app for managing and designing workflows.

Roadmap

The following features are planned for future releases of Elsa:

  • Multi-tenancy
  • State Machine activity
  • Designer support for Sequence activity & StateMachine activity
  • BPMN 2.0 support
  • DMN support
  • Workflow migration to new versions via UI
  • Capsules ("hot" deployable workflow packages containing activities and configuration)

Use Cases

Elsa can be used in a variety of scenarios, including:

  • Long-running workflows such as order fulfillment and product approval.
  • Short-running workflows such as sending emails and generating PDFs.
  • Scheduled workflows such as sending daily reports.
  • Event-driven workflows such as sending welcome emails when a user signs up.

Programmatic Workflows

Elsa allows you to define workflows in code using C#. The following example shows how to receive HTTP requests and send an email in response:

public class SendEmailWorkflow : WorkflowBase
{
    protected override void Build(IWorkflowBuilder builder)
    {
        builder.Root = new Sequence
        {
            Activities =
            {
                new HttpEndpoint
                {
                    Path = new("/send-email"),
                    SupportedMethods = new(new[] { HttpMethods.Post }),
                    CanStartWorkflow = true
                },
                new SendEmail
                {
                    From = new("alic@acme.com"),
                    To = new(new[]{ "bob@acme.com" }),
                    Subject = new("Your workflow has been triggered!"),
                    Body = new("Hello!")
                }
            }
        };
    }
}

Designed Workflows

Elsa allows you to define workflows using a visual designer. The following example shows how to receive HTTP requests and send an email in response:

Elsa ships with a powerful visual designer

Contributing

We welcome contributions from the community and are pleased that you are interested in helping to improve the Elsa Workflow project! Here are the steps to contribute to our project:

1. Fork and Clone the Repo

To get started, you'll need to fork the repository to your own GitHub account. You can do this by navigating to the Elsa Workflow GitHub repository and clicking the "Fork" button in the top-right corner of the page. Once you have forked the repo, you can clone it to your local machine using the following command:

git clone https://github.com/YOUR_USERNAME/elsa-core.git

Replace YOUR_USERNAME with your GitHub username. For more information on forking a repo, check out the GitHub documentation here.

Incorporating the details about the "bundles" folder and its projects into the second point about opening the Elsa.sln using your favorite IDE, we can expand the instructions to guide developers on where to start and what projects they might want to explore first. Here's an updated version of that section with the additional information:

2. Open Elsa.sln Using Your Favorite IDE

After cloning the repository, navigate to the cloned directory and open the Elsa.sln solution file with your preferred IDE that supports .NET development, such as Visual Studio, JetBrains Rider, or Visual Studio Code with the appropriate extensions.

Within the solution, you will find a "bundles" folder containing three projects designed to help you get started and explore the capabilities of Elsa Workflow:

  • Elsa.Server.Web: This project is a reference ASP.NET Core application that acts as a workflow server. It's a great starting point if you want to understand how Elsa functions as a server-side workflow engine.

  • Elsa.ServerAndStudio.Web: This project serves a dual purpose. Like Elsa.Server.Web, it acts as a workflow server. Additionally, it hosts the Elsa Studio Blazor WebAssembly app. This is the perfect project to run if you want to see the full capabilities of Elsa, including both the server aspects and the client-side studio experience in one application.

  • Elsa.Studio.Web: This project is a reference Blazor WebAssembly application that solely hosts the Elsa Studio Blazor WebAssembly app. It requires a running Elsa server application to connect to. Use this project if you're interested in focusing on the Elsa Studio UI and its interactions with an Elsa workflow server.

3. Submit a PR with Your Changes

Once you have made your changes, commit them and push them back to your fork. Then, navigate to the original Elsa Workflow repository and create a new Pull Request. Ensure your PR description clearly describes the changes and any relevant information that will help the reviewers understand your contributions. For a detailed guide on creating a pull request, visit Creating a pull request from a fork.

4. Open an Issue First

Before you start working on your changes or submit a pull request, please open an issue to discuss what you would like to do. This step is crucial as it ensures you don't spend time working on something that might not align with the project's goals or might already be under development by someone else. You can open an issue here.

This approach helps us streamline contributions and ensures that your efforts are aligned with the project's needs and priorities. We look forward to your contributions and are here to support you throughout the process. Thank you for contributing to the Elsa Workflow project!


Remember to replace any placeholder URLs or instructions with the specific details relevant to the Elsa Workflow project as necessary.