Skip to content

Feat/workflow state machine(#280)#364

Merged
EDOHWARES merged 5 commits intoEDOHWARES:mainfrom
JohnOluB:feat/workflow-state-machine
May 1, 2026
Merged

Feat/workflow state machine(#280)#364
EDOHWARES merged 5 commits intoEDOHWARES:mainfrom
JohnOluB:feat/workflow-state-machine

Conversation

@JohnOluB
Copy link
Copy Markdown
Contributor

@JohnOluB JohnOluB commented Apr 27, 2026

PR description

Summary

closes #280

Implements server-side state machine logic for the EventHorizon
visual workflow editor using XState v5.

What's changed

File Purpose
src/services/workflowMachine.js XState v5 machine — 7 states, retry back-off, validation
src/services/workflow.service.js Actor lifecycle manager; persists every snapshot to MongoDB
src/models/workflowExecution.model.js Mongoose schema for execution history
src/controllers/workflow.controller.js Express handlers (start, get, history, send event, cancel)
src/routes/workflow.routes.js REST routes with OpenAPI JSDoc, using existing auth/permission middleware
tests/unit/workflowMachine.test.js 19 unit tests (Node built-in runner, no extra deps)
tests/integration/workflow.service.test.js 8 integration tests with stubbed MongoDB
docs/workflow-state-machine.md Full documentation

State flow

idle → validating → pending → executing → completed
↘ failed ↘ retrying → executing
↘ failed (retries exhausted)

@JohnOluB JohnOluB changed the title Feat/workflow state machine Feat/workflow state machine(#280) Apr 27, 2026
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 27, 2026

@JohnOluB Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@EDOHWARES
Copy link
Copy Markdown
Owner

Nice implementation, lgtm!

@EDOHWARES EDOHWARES merged commit c1fd2aa into EDOHWARES:main May 1, 2026
1 check passed
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.

Backend: State Machine Logic for Visual Workflow Editor

2 participants