Skip to content

feat(workflow): add WorkflowRunnerService for event-driven workflow firing#19

Open
mpge wants to merge 1 commit intofeat/workflow-executorfrom
feat/workflow-runner
Open

feat(workflow): add WorkflowRunnerService for event-driven workflow firing#19
mpge wants to merge 1 commit intofeat/workflow-executorfrom
feat/workflow-runner

Conversation

@mpge
Copy link
Copy Markdown
Member

@mpge mpge commented Apr 24, 2026

Summary

Ports the NestJS workflow-runner.service.ts to .NET. Loads active Workflows for a trigger event (in Position order via EF Core), evaluates conditions via WorkflowEngine, dispatches matches to WorkflowExecutorService, and writes a WorkflowLog audit row per Workflow considered.

Behavior

  • Honors StopOnMatch — only when the workflow actually matches
  • Catches executor failures so one bad workflow never blocks the rest (error stamped on the log row via ErrorMessage; logged via ILogger)
  • Malformed conditions JSON logs a warning and treats the workflow as non-matching
  • Null/blank/{} conditions match all tickets (NestJS parity)

Scope

Runner only. Follow-up PR: event listener that bridges TicketCreatedEvent / TicketUpdatedEvent / etc. into RunForEventAsync.

Dependencies

Test plan

  • 9 xUnit tests using real executor + in-memory EF Core DB; asserts DB state (replies, logs, priority changes) rather than mocking the executor
  • CI green: test, lint (won't trigger against stacked base until rebased)

…iring

Ports the NestJS workflow-runner.service.ts to .NET. Loads active
Workflows for a trigger event (in Position order via EF Core),
evaluates conditions via WorkflowEngine, dispatches matches to
WorkflowExecutorService, and writes a WorkflowLog audit row per
Workflow considered.

- Honors StopOnMatch (only when the workflow actually matches)
- Catches executor failures so one bad workflow never blocks the rest
  (failure stamped on the log row via ErrorMessage; logged via ILogger)
- Malformed conditions JSON logs a warning and treats the workflow as
  non-matching
- Null/blank/{} conditions match all tickets (matches NestJS semantics)

Follow-up PR will add the event listener that bridges TicketCreatedEvent
/ TicketUpdatedEvent / etc. into RunForEventAsync.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant