elsa-workflows / elsa-workflows/elsa-core
Feature Request: Define reusable methods/functions within a single workflow (shared across activities)
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
Hi 👋,
I'm working with Elsa Workflows and have a question regarding code reuse within a single workflow definition.
**Use case:**
In one workflow, I have multiple Script or Expression Activities that need to use the same helper logic — for example, a `greet(name)` function. Currently, I have to duplicate this function in every activity that needs it.
**My question / feature request:**
Is there a way (or could there be a future feature) to define a shared/global method within a single workflow that all activities in that workflow can reference?
**For example:**
A global method block in the workflow JSON definition
A shared "function library" scoped to the workflow execution
A better way to inject helper logic into all script/expression nodes in a workflow
**Why this matters:**
It would help make workflows more maintainable and DRY, especially when using Script or Expression Activities that rely on repeated logic.
Thanks for considering this! I appreciate all the great work on Elsa 🙌
Contributor guide
Assessment
This issue has not been assessed yet.