Skip to content

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

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

feat(workflow): add WorkflowRunnerService for event-driven workflow firing#29
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 WordPress. Loads active Workflows for a trigger event (in position order via SQL), evaluates conditions via WorkflowEngine, dispatches matches to WorkflowExecutorService, and writes a workflow_log 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 (error stamped on the log row; warn-logged when WP_DEBUG is on)
  • Null/blank conditions match all tickets (NestJS parity)

Scope

Runner only. Follow-up PR: WP hooks that bridge escalated_ticket_created / _replied / etc. into run_for_event.

Dependencies

Test plan

  • 7 WP integration tests covering no-match/match/trigger-filter/inactive-skip/stop-on-match/position-order (run via WP test harness)
  • CI green: test (8.1), test (8.2), lint (won't trigger against stacked base until rebased)

…iring

Ports the NestJS workflow-runner.service.ts to WordPress. Loads active
Workflows for a trigger event (in position order via SQL), evaluates
conditions via WorkflowEngine, dispatches matches to
WorkflowExecutorService, and writes a workflow_log 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 error_message; warn-logged when
  WP_DEBUG is on)
- Null/blank conditions match all tickets (matches NestJS semantics)

Follow-up PR will add the WP hook handlers that bridge
escalated_ticket_created / _replied / etc. into run_for_event.
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