|
2 | 2 |
|
3 | 3 | ## Executive Summary |
4 | 4 |
|
5 | | -This document outlines the complete implementation plan for **DurableWorkflow**, a durable, resumable workflow engine for Elixir. The project is currently at the specification phase with a comprehensive architecture document (`agents/arch.md`) but no implementation code. |
| 5 | +This document outlines the complete implementation plan for **Durable**, a durable, resumable workflow engine for Elixir. |
6 | 6 |
|
7 | | -**Current State:** Specification only (0% implemented) |
| 7 | +**Current State:** ~35% implemented (Phase 0+1 complete, partial Phase 3+5) |
8 | 8 | **Target:** Production-ready workflow engine replacing Oban |
9 | 9 |
|
| 10 | +### Completed Features (as of Dec 2024) |
| 11 | +- Phase 0: Project foundation, database schema, migrations ✅ |
| 12 | +- Phase 1: Core MVP (DSL, context, executor, retry, queue, worker) ✅ |
| 13 | +- Phase 3.1-3.3: Wait primitives (sleep, events, human input) ✅ |
| 14 | +- Phase 5 (partial): Query API, time helpers, test DataCase ✅ |
| 15 | + |
| 16 | +**Stats:** 22 modules, 24 passing tests |
| 17 | + |
10 | 18 | --- |
11 | 19 |
|
12 | 20 | ## Phase 0: Project Foundation |
@@ -118,16 +126,16 @@ This document outlines the complete implementation plan for **DurableWorkflow**, |
118 | 126 | - `.github/workflows/ci.yml` - GitHub Actions for tests, formatting, dialyzer |
119 | 127 | - `.tool-versions` - asdf version management |
120 | 128 |
|
121 | | -**Success Criteria:** |
122 | | -- [ ] `mix compile` succeeds |
123 | | -- [ ] `mix test` runs (with placeholder tests) |
124 | | -- [ ] `mix format --check-formatted` passes |
125 | | -- [ ] `mix credo` passes |
126 | | -- [ ] `mix dialyzer` passes |
| 129 | +**Success Criteria:** ✅ COMPLETE |
| 130 | +- [x] `mix compile` succeeds |
| 131 | +- [x] `mix test` runs (24 passing tests) |
| 132 | +- [x] `mix format --check-formatted` passes |
| 133 | +- [x] `mix credo` passes |
| 134 | +- [x] `mix dialyzer` passes |
127 | 135 |
|
128 | 136 | --- |
129 | 137 |
|
130 | | -### Milestone 0.2: Database Schema & Migrations |
| 138 | +### Milestone 0.2: Database Schema & Migrations ✅ COMPLETE |
131 | 139 |
|
132 | 140 | **Objective:** Create Ecto schemas and migrations for all core tables. |
133 | 141 |
|
@@ -245,9 +253,9 @@ This document outlines the complete implementation plan for **DurableWorkflow**, |
245 | 253 |
|
246 | 254 | --- |
247 | 255 |
|
248 | | -## Phase 1: Core Workflow Engine (MVP) |
| 256 | +## Phase 1: Core Workflow Engine (MVP) ✅ COMPLETE |
249 | 257 |
|
250 | | -### Milestone 1.1: DSL Foundation - Basic Macros |
| 258 | +### Milestone 1.1: DSL Foundation - Basic Macros ✅ COMPLETE |
251 | 259 |
|
252 | 260 | **Objective:** Implement the core `use DurableWorkflow` macro and basic `workflow`/`step` DSL. |
253 | 261 |
|
@@ -332,7 +340,7 @@ MyApp.OrderWorkflow.__workflow_definition__("process_order") |
332 | 340 |
|
333 | 341 | --- |
334 | 342 |
|
335 | | -### Milestone 1.2: Context Management |
| 343 | +### Milestone 1.2: Context Management ✅ COMPLETE |
336 | 344 |
|
337 | 345 | **Objective:** Implement the context system for state management within workflows. |
338 | 346 |
|
|
415 | 423 |
|
416 | 424 | --- |
417 | 425 |
|
418 | | -### Milestone 1.3: Basic Executor |
| 426 | +### Milestone 1.3: Basic Executor ✅ COMPLETE |
419 | 427 |
|
420 | 428 | **Objective:** Implement the core workflow executor that runs steps sequentially. |
421 | 429 |
|
@@ -478,7 +486,7 @@ execution.context # => %{order_id: 123, total: 99.99, ...} |
478 | 486 |
|
479 | 487 | --- |
480 | 488 |
|
481 | | -### Milestone 1.4: Retry Logic & Backoff |
| 489 | +### Milestone 1.4: Retry Logic & Backoff ✅ COMPLETE |
482 | 490 |
|
483 | 491 | **Objective:** Implement step-level retry with configurable backoff strategies. |
484 | 492 |
|
@@ -559,7 +567,7 @@ execution.context # => %{order_id: 123, total: 99.99, ...} |
559 | 567 |
|
560 | 568 | --- |
561 | 569 |
|
562 | | -### Milestone 1.5: PostgreSQL Queue Adapter |
| 570 | +### Milestone 1.5: PostgreSQL Queue Adapter ✅ COMPLETE |
563 | 571 |
|
564 | 572 | **Objective:** Implement the default PostgreSQL-based job queue. |
565 | 573 |
|
@@ -629,7 +637,7 @@ execution.context # => %{order_id: 123, total: 99.99, ...} |
629 | 637 |
|
630 | 638 | --- |
631 | 639 |
|
632 | | -### Milestone 1.6: Basic Public API |
| 640 | +### Milestone 1.6: Basic Public API ✅ COMPLETE |
633 | 641 |
|
634 | 642 | **Objective:** Complete the public API for starting, querying, and managing workflows. |
635 | 643 |
|
@@ -972,9 +980,9 @@ execution.context # => %{order_id: 123, total: 99.99, ...} |
972 | 980 |
|
973 | 981 | --- |
974 | 982 |
|
975 | | -## Phase 3: Advanced Features |
| 983 | +## Phase 3: Advanced Features (Partial) |
976 | 984 |
|
977 | | -### Milestone 3.1: Wait Primitives - Sleep |
| 985 | +### Milestone 3.1: Wait Primitives - Sleep ✅ COMPLETE |
978 | 986 |
|
979 | 987 | **Objective:** Implement `sleep_for` and `sleep_until` functions. |
980 | 988 |
|
@@ -1016,15 +1024,15 @@ execution.context # => %{order_id: 123, total: 99.99, ...} |
1016 | 1024 | ``` |
1017 | 1025 |
|
1018 | 1026 | **Success Criteria:** |
1019 | | -- [ ] sleep_for suspends workflow |
1020 | | -- [ ] Workflow resumes after duration |
1021 | | -- [ ] sleep_until works with DateTime |
1022 | | -- [ ] State preserved across sleep |
1023 | | -- [ ] Tests verify timing |
| 1027 | +- [x] sleep_for suspends workflow |
| 1028 | +- [x] Workflow resumes after duration |
| 1029 | +- [x] sleep_until works with DateTime |
| 1030 | +- [x] State preserved across sleep |
| 1031 | +- [x] Tests verify timing |
1024 | 1032 |
|
1025 | 1033 | --- |
1026 | 1034 |
|
1027 | | -### Milestone 3.2: Wait Primitives - Events |
| 1035 | +### Milestone 3.2: Wait Primitives - Events ✅ COMPLETE |
1028 | 1036 |
|
1029 | 1037 | **Objective:** Implement `wait_for_event` and `send_event` for external event handling. |
1030 | 1038 |
|
@@ -1059,15 +1067,15 @@ execution.context # => %{order_id: 123, total: 99.99, ...} |
1059 | 1067 | - Or create separate `pending_events` table |
1060 | 1068 |
|
1061 | 1069 | **Success Criteria:** |
1062 | | -- [ ] wait_for_event suspends workflow |
1063 | | -- [ ] send_event resumes matching workflow |
1064 | | -- [ ] Filter function works correctly |
1065 | | -- [ ] Timeout triggers with timeout_value |
1066 | | -- [ ] Multiple workflows can wait for same event |
| 1070 | +- [x] wait_for_event suspends workflow |
| 1071 | +- [x] send_event resumes matching workflow |
| 1072 | +- [x] Filter function works correctly |
| 1073 | +- [x] Timeout triggers with timeout_value |
| 1074 | +- [x] Multiple workflows can wait for same event |
1067 | 1075 |
|
1068 | 1076 | --- |
1069 | 1077 |
|
1070 | | -### Milestone 3.3: Wait Primitives - Human Input |
| 1078 | +### Milestone 3.3: Wait Primitives - Human Input ✅ COMPLETE |
1071 | 1079 |
|
1072 | 1080 | **Objective:** Implement `wait_for_input` for human-in-the-loop workflows. |
1073 | 1081 |
|
@@ -1125,11 +1133,11 @@ execution.context # => %{order_id: 123, total: 99.99, ...} |
1125 | 1133 | - Type coercion |
1126 | 1134 |
|
1127 | 1135 | **Success Criteria:** |
1128 | | -- [ ] wait_for_input suspends workflow |
1129 | | -- [ ] provide_input resumes with data |
1130 | | -- [ ] Form validation works |
1131 | | -- [ ] Timeout handling works |
1132 | | -- [ ] Pending inputs queryable |
| 1136 | +- [x] wait_for_input suspends workflow |
| 1137 | +- [x] provide_input resumes with data |
| 1138 | +- [x] Form validation works |
| 1139 | +- [x] Timeout handling works |
| 1140 | +- [x] Pending inputs queryable |
1133 | 1141 |
|
1134 | 1142 | --- |
1135 | 1143 |
|
|
0 commit comments