Best way to use in core c#

Hi everyone.
I am trying to create a PoC with 2 services running in core (API) and connect them with a front-end page,
each service will run 2 workers (4 in total), as a best practice, I’m thinking in using a background task for each service to process the job (background)…

do you think that is a good idea?. is there a better approach in registering and processing works/jobs?

Yeah, HostedService I reckon.

Like this.


1 Like

Why do you want to host workers in web application? Of cause it depends on on your current architecture and the scale of your solution, but from general perspective it might be separate deployment unit for processing workflow jobs. Could you tell us more about what are you going to implement? How do you want to ‘connect them with a front-end page’?

1 Like

I would decouple my background services from my services and application. Depending on your application needs, these background tasks/service can be separate deploy-ables. So what ‘job’ do you or these background services intend to do?

1 Like

To add to @ahalami:

A web service with core would be an excellent control plane for zeebe. You could use it to start zeebe workflows, send messages to running workflows, or interact with exporter API. These operations are good for core because they are I/O operations, and not CPU-intensive operations (like running background zeebe workers).


I have an app like that in Node.js using NestJS and Dan Shapir’s @payk/nestjs-zeebe transport. It’s a REST API control pane with some server-side rendered pages.

The workers would run in 2 core API… a front-end application is a vue.js SPA… the PoC is like follows… a user(vue) creates a new order (API 1) the order starts an instance workflow and publish a message for the next step… (API 2) which has a worker listening to be activated (deliver task) once the delivery task finish it would send a message to the vue app by WebSockets that the process has finished…

What I want to accomplish is keeping the workers running… so that they are ready to start its job when it is required. (***that’s my question… is there a better approach? than using aspnet core background task (hosted service)***… is there a better architecture? )
BTW I’m using Service Fabric to manage the services.

Why choose core API ?.. because I need http controllers to manage the identity and communicate the vue app…

Thanks for the interest
Best regards

You can embed the workers and orchestrate them like that, for sure.

That approach makes sense when you want to add bpm orchestration to your existing app / tech stack. You don’t need to go full exotic tech, you can just add Zeebe to what you have / are familiar with.