elsa-workflows / elsa-workflows/elsa-core

Add Support for Power Fx as an Expression Type

Open
#6,609 0 comments 1 reaction 1 assignee Assigned to @Copilot View on GitHub
triaged
Dominant language
C#
Stars
7.9k
Forks
1.5k
Avg merge
15h 22m
Merged PRs (30d)
114

Description

**Background**
Elsa Workflows currently supports a number of dynamic expression types including JavaScript, C#, Python, and Liquid. While these are powerful and versatile, they may present a barrier to non-developers or users more familiar with business tools like Excel or Power Platform. To bridge this gap and make Elsa more accessible to a broader audience—including citizen developers and business analysts—it would be highly beneficial to support **[Microsoft Power Fx](https://github.com/microsoft/Power-Fx)** as an additional expression type.

**Feature**
Introduce a new `PowerFx` expression type that leverages the open-source Power Fx engine from Microsoft. This would allow users to write expressions in a syntax that is familiar to Excel users and declarative business rule authors.

This new expression type should:
- Allow access to workflow variables, input/output data, and potentially services (where applicable).
- Support expression evaluation at runtime with strong typing and error feedback.
- Be pluggable and configurable like existing expression types.
- Integrate seamlessly with the Elsa designer, ideally with syntax highlighting and a simplified editor experience.

**Alternative considerations**
- Relying solely on existing expression types. However, these often require programming skills.
- Creating a custom low-code DSL, which would be a significantly larger effort than leveraging Power Fx.

**Additional context**
Power Fx is a strongly typed, functional, declarative language developed by Microsoft for low-code development. It is used across the Power Platform and has a growing ecosystem. Benefits of integrating Power Fx into Elsa Workflows include:

- **Lowering the barrier to entry** for non-developers to build and maintain workflows.
- **Alignment with Microsoft ecosystem tools** like Power Apps, Dataverse, and Power Automate.
- **Excel-like syntax** that is widely understood and accepted in business environments.
- **Strong typing** and reactive computation model, ideal for defining dynamic behavior in workflows.

Example:
```json
{
"type": "PowerFx",
"value": "If(Amount > 100 && Category = \"Premium\", true, false)"
}
```

This addition would greatly expand Elsa’s appeal and usability in enterprise and citizen-developer scenarios.

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.