danielgerlag / danielgerlag/workflow-core
How to resolve a custom step name when I use a generic workflow step type?
- Dominant language
- C#
- Stars
- 5.9k
- Forks
- 1.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 5
Description
I've implemented my workflow steps as the following.
I have a generic workflow step type, like this:
```
public class GenericWorkflowStep : StepBodyAsync
{
...
}
```
Each of my actual step handlers look something like this:
```
public class MyStepHandler
{
public async Task Execute(MyStepInput input, CancellationToken ct)
{
...
}
}
```
In the generic workflow step I dynamically resolve a handler instance, and call its Execute method by convention, etc.
The point with this design is to have loosly coupled handlers for our workflows, which by themselves do not depend on WFC in any manner.
However, at the moment WFC resolves the name of a step using the type name, so every step will become `"GenericWorkflowStep``1"`, which definitely cause some UI and listing related issues on our side, but may cause some unwanted effects on WFC side as well.
I'm aware that I can pass an explicit step name when building the workflows. However, we have many workflows, using many shared steps, so that would be a huge and error-prone work (eg. what if a developer misses it somewhere).
What is the best way to implement some kind of centralized logic to resolve the step name in a custom way, for example in this case using the third generic type argument of the step type?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the workflow-core code that resolves a step name from its type, then compare it with the generic step registration and workflow-building path described here. Determine where centralized naming can use the third generic type argument without requiring explicit names at every call site; done means shared steps receive stable, distinct names in UI and listings while existing workflows remain compatible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100