danielgerlag / danielgerlag/workflow-core

[Question] Best practices for handling events and error reporting in ASP.NET Core Web API

Open
#1,275 2 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

Hi,

I'm using WorkflowCore in an [ASP.NET](http://asp.net/) Core Web API backend and calling publishEvent from a controller. Since the event is processed by the workflow as a background task, I'm unsure what response to return from the controller.

All our steps are short and should finish quickly, so I'm considering whether solutions like polling, long polling, or WebSockets are necessary.

If I send a generic 200 OK response after publishing the event and an error occurs during the execution of a step, how can I inform the front end about this issue? I'm using Angular on the front end and would like to handle this scenario effectively.

```
[HttpPost("publish-event")]
public async Task PublishEvent([FromBody] EventModel model)
{
await _workflowHost.PublishEvent(model.EventName, model.EventKey, model.EventData);
return Ok();
}
```

Thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the controller entry point shown in the issue and review WorkflowCore's PublishEvent behavior and error-reporting guidance. Check the Angular integration context mentioned by the author. Done would be a documented recommendation for the controller response and for communicating background step failures to the frontend; no files or tests are identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, csharp
Domain
api, backend, frontend
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.