Skip to content

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

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

feat(workflow): add WorkflowRunnerService for event-driven workflow firing#22
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 Spring. This is the orchestrator piece that loads active Workflows for a trigger event (in position order), evaluates conditions via WorkflowEngine, dispatches matches to WorkflowExecutorService, and writes a WorkflowLog audit row per Workflow considered.

Behavior

  • Honors stop_on_match — but only when the workflow actually matches (failing workflows don't halt the chain)
  • Catches executor failures so one bad workflow never blocks the rest (failure stamped on the log row via errorMessage)
  • Malformed conditions JSON logs a warning and treats the workflow as non-matching
  • Null/blank conditions match all tickets (matches NestJS semantics)

Scope

Runner only. Follow-up PR:

  • Spring @EventListener that bridges TicketEventrunForEvent

Dependencies

Test plan

  • 8 unit tests covering happy-path, no-match, stop-on-match semantics, malformed conditions, executor-failure isolation
  • CI green: test, checkstyle

…iring

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

- Honors stop_on_match (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)
- 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 @eventlistener that bridges TicketEvent into
runForEvent.
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