Skip to content

feat(workflow): add WorkflowExecutorService for action dispatch#18

Open
mpge wants to merge 2 commits intomainfrom
feat/workflow-executor
Open

feat(workflow): add WorkflowExecutorService for action dispatch#18
mpge wants to merge 2 commits intomainfrom
feat/workflow-executor

Conversation

@mpge
Copy link
Copy Markdown
Member

@mpge mpge commented Apr 24, 2026

Summary

Ports the NestJS workflow-executor.service.ts to .NET. The existing WorkflowEngine only evaluates conditions — this service parses the JSON action array on Workflow.Actions and dispatches each entry against TicketService / AssignmentService / the EF Core context.

Action catalog: change_priority, change_status, assign_agent, set_department, add_tag, remove_tag, add_note, insert_canned_reply.

  • {{field}} placeholders in canned replies interpolated via WorkflowEngine.InterpolateVariables
  • One failing action does not halt the others (warn-logged via ILogger) — mirrors NestJS
  • Unknown action types warn-log and skip; malformed JSON returns an empty action list

Scope

Executor only. Follow-up PRs:

  1. WorkflowRunner — loads matching workflows for a trigger event, evaluates conditions, writes WorkflowLog
  2. Event listener that bridges TicketCreatedEvent / TicketUpdatedEvent / etc. into processEvent

Splitting keeps the diff reviewable and lets each piece land independently.

Test plan

  • 19 xUnit tests cover every action type + malformed-input paths (in-memory EF Core DB)
  • CI green: test, lint

mpge added 2 commits April 24, 2026 03:31
Ports the NestJS workflow-executor.service.ts to .NET. The existing
WorkflowEngine only evaluates conditions; this service parses the JSON
action array stored on Workflow.Actions and dispatches each entry
against TicketService / AssignmentService / the EF Core context.

Action catalog: change_priority, change_status, assign_agent,
set_department, add_tag, remove_tag, add_note, insert_canned_reply.
{{field}} placeholders in canned replies interpolated via
WorkflowEngine.InterpolateVariables.

One failing action does not halt the others (warn-logged via
ILogger). Unknown action types warn-log and skip. Malformed JSON
returns an empty action list.

Follow-up PR will add the WorkflowRunner (loads matching workflows,
evaluates, writes WorkflowLog) and the event listener that bridges
TicketCreated / TicketUpdated etc. into processEvent.
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