danielgerlag / danielgerlag/workflow-core

[Question] Is there a way to use the `.UserTask` with a custom data structure instead of a plain `string`?

Open
#1,350 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
5.9k
Forks
1.3k
Avg merge
1d 1h
Merged PRs (30d)
5

Description

Is there a way to use the `.UserTask` with a custom data structure instead of a plain `string`?

Maybe with a custom `StepBody` and custom data model or something.

So with reference to:

![Image](https://github.com/user-attachments/assets/50449f67-68d1-42fb-b399-1f89e1126e25)

I need to be able to pass in the **username** and **rejection reason** so I can capture that information.

So here, where I call...

```cs
await _workflowService.PublishUserAction(actionKey, username, optionValue);
```

...in my web api controller I can pass more than just the option value and consume that from a step.

Also how do I access the `username` passed in here in which ever of the `StepBody`s get called so i can assign this to the workflow data item?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the mentioned PublishUserAction call and the UserTask and StepBody entry points to see how action data is represented and exposed to workflow steps. Confirm whether username and rejection reason can be carried together, and define a supported usage or clearly document the limitation and expected data flow.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.