You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert

79
+
69
80
## 🧪 Testing
70
81
71
82
### Backend Tests
@@ -84,142 +95,10 @@ npm test
84
95
85
96
---
86
97
87
-
## Assumptions and Trade-offs
88
-
89
-
This section documents all assumptions and trade-offs made during the implementation of the workflow engine, based on the provided requirements and subsequent clarifications.
90
-
91
-
---
92
-
93
-
### 1. Tenancy and Users
94
-
95
-
**Assumption**
96
-
97
-
- The application is implemented as a **single-tenant system**.
98
-
- No authentication, authorization, or user ownership model is included.
99
-
- All workflows are globally visible and editable.
100
-
101
-
**Trade-off**
102
-
103
-
- This simplifies the system and keeps the scope aligned with the assignment.
104
-
- Multi-tenancy and access control are intentionally out of scope.
105
-
106
-
---
107
-
108
-
### 2. Workflow Execution Semantics
109
-
110
-
**Assumption**
111
-
112
-
- Each HTTP `POST` request to a workflow’s trigger URL creates a **new workflow run**.
113
-
- No idempotency or deduplication logic is implemented.
114
-
- Workflows can be triggered an unlimited number of times while enabled.
115
-
116
-
**Trade-off**
117
-
118
-
- Avoids additional complexity around request deduplication and event IDs.
119
-
- Aligns with clarified requirement that “exactly-once” processing is no longer required.
120
-
121
-
---
122
-
123
-
### 3. HTTP Request Steps
124
-
125
-
**Assumption**
126
-
127
-
- HTTP retries are handled **synchronously** within the same workflow run using an **exponential backoff** strategy.
128
-
- Chaining or dependency handling between multiple HTTP request steps is not required.
129
-
- Only **failed HTTP requests** have their details persisted.
130
-
131
-
Persisted failure details include:
132
-
133
-
- HTTP status code
134
-
- Response headers
135
-
- Response body
136
-
137
-
**Trade-off**
138
-
139
-
- Successful HTTP responses are not persisted to reduce storage complexity.
140
-
- HTTP response bodies are not merged back into `ctx`.
141
-
142
-
---
143
-
144
-
### 4. Context (`ctx`) Behavior
145
-
146
-
**Assumption**
147
-
148
-
-`ctx` is initialized using the inbound HTTP request body.
149
-
- Missing paths accessed via dot-notation resolve to `null`.
150
-
- Only transform steps are allowed to mutate `ctx`.
151
-
- Filter steps do not modify `ctx`.
152
-
153
-
**Trade-off**
154
-
155
-
- Keeps the execution model predictable and easy to reason about.
156
-
- Avoids side effects outside of explicit transform steps.
157
-
158
-
---
159
-
160
-
### 5. Validation Rules
161
-
162
-
**Assumption**
163
-
164
-
- Workflows with an empty `steps` array are rejected as invalid.
165
-
- Unknown step types result in validation errors.
166
-
- Unsupported transform operations result in validation errors.
167
-
168
-
**Trade-off**
169
-
170
-
- Strict validation provides clearer feedback to users.
171
-
- Prevents undefined or partially implemented behavior at runtime.
172
-
173
-
---
174
-
175
-
### 6. Frontend Scope
176
-
177
-
**Assumption**
178
-
179
-
- Workflow steps are edited as **raw JSON** using a code editor.
180
-
- No visual workflow builder or drag-and-drop UI is implemented.
181
-
- No UI is provided to manually trigger workflows for testing.
182
-
183
-
**Trade-off**
184
-
185
-
- Keeps the frontend minimal and focused on correctness.
186
-
- Matches the explicit frontend requirements in the assignment.
187
-
188
-
---
189
-
190
-
### 7. Persistence Scope
191
-
192
-
**Assumption**
193
-
194
-
- Workflow runs persist:
195
-
- Status (`success`, `skipped`, `failed`)
196
-
- Start and end timestamps
197
-
- Error details (where applicable)
198
-
199
-
**Trade-off**
200
-
201
-
- Detailed execution traces and metrics are not persisted.
202
-
- Keeps database schema simple and aligned with requirements.
203
-
204
-
---
205
-
206
-
### 8. Explicit Non-Goals
207
-
208
-
The following features are intentionally **not implemented**:
209
-
210
-
- Authentication and user management
211
-
- Role-based access control
212
-
- Rate limiting
213
-
- Background job queues
214
-
- Cron or scheduled triggers
215
-
- Webhook signature verification
216
-
- Visual workflow designer
217
-
- Monitoring or analytics dashboards
218
-
219
-
These are considered outside the scope of the assignment.
220
-
221
-
---
98
+
## 📚 Documentation
222
99
223
-
### 9. Documentation
100
+
For more detailed information about the project's design, constraints, and requirements, please refer to the following documents:
224
101
225
-
All assumptions and trade-offs are explicitly documented here to ensure transparency and alignment with the assignment expectations.
This section documents all assumptions and trade-offs made during the implementation of the workflow engine, based on the provided requirements and subsequent clarifications.
4
+
5
+
---
6
+
7
+
### 1. Tenancy and Users
8
+
9
+
**Assumption**
10
+
11
+
- The application is implemented as a **single-tenant system**.
12
+
- No authentication, authorization, or user ownership model is included.
13
+
- All workflows are globally visible and editable.
14
+
15
+
**Trade-off**
16
+
17
+
- This simplifies the system and keeps the scope aligned with the project.
18
+
- Multi-tenancy and access control are intentionally out of scope.
19
+
20
+
---
21
+
22
+
### 2. Workflow Execution Semantics
23
+
24
+
**Assumption**
25
+
26
+
- Each HTTP `POST` request to a workflow’s trigger URL creates a **new workflow run**.
27
+
- No idempotency or deduplication logic is implemented.
28
+
- Workflows can be triggered an unlimited number of times while enabled.
29
+
30
+
**Trade-off**
31
+
32
+
- Avoids additional complexity around request deduplication and event IDs.
33
+
- Aligns with clarified requirement that “exactly-once” processing is no longer required.
34
+
35
+
---
36
+
37
+
### 3. HTTP Request Steps
38
+
39
+
**Assumption**
40
+
41
+
- HTTP retries are handled **synchronously** within the same workflow run using an **exponential backoff** strategy.
42
+
- Chaining or dependency handling between multiple HTTP request steps is not required.
43
+
- Only **failed HTTP requests** have their details persisted.
44
+
45
+
Persisted failure details include:
46
+
47
+
- HTTP status code
48
+
- Response headers
49
+
- Response body
50
+
51
+
**Trade-off**
52
+
53
+
- Successful HTTP responses are not persisted to reduce storage complexity.
54
+
- HTTP response bodies are not merged back into `ctx`.
55
+
56
+
---
57
+
58
+
### 4. Context (`ctx`) Behavior
59
+
60
+
**Assumption**
61
+
62
+
-`ctx` is initialized using the inbound HTTP request body.
63
+
- Missing paths accessed via dot-notation resolve to `null`.
64
+
- Only transform steps are allowed to mutate `ctx`.
65
+
- Filter steps do not modify `ctx`.
66
+
67
+
**Trade-off**
68
+
69
+
- Keeps the execution model predictable and easy to reason about.
70
+
- Avoids side effects outside of explicit transform steps.
71
+
72
+
---
73
+
74
+
### 5. Validation Rules
75
+
76
+
**Assumption**
77
+
78
+
- Workflows with an empty `steps` array are rejected as invalid.
79
+
- Unknown step types result in validation errors.
80
+
- Unsupported transform operations result in validation errors.
81
+
82
+
**Trade-off**
83
+
84
+
- Strict validation provides clearer feedback to users.
85
+
- Prevents undefined or partially implemented behavior at runtime.
86
+
87
+
---
88
+
89
+
### 6. Frontend Scope
90
+
91
+
**Assumption**
92
+
93
+
- Workflow steps are edited as **raw JSON** using a code editor.
94
+
- No visual workflow builder or drag-and-drop UI is implemented.
95
+
- No UI is provided to manually trigger workflows for testing.
96
+
97
+
**Trade-off**
98
+
99
+
- Keeps the frontend minimal and focused on correctness.
100
+
- Matches the explicit frontend requirements.
101
+
102
+
---
103
+
104
+
### 7. Persistence Scope
105
+
106
+
**Assumption**
107
+
108
+
- Workflow runs persist:
109
+
- Status (`success`, `skipped`, `failed`)
110
+
- Start and end timestamps
111
+
- Error details (where applicable)
112
+
113
+
**Trade-off**
114
+
115
+
- Detailed execution traces and metrics are not persisted.
116
+
- Keeps database schema simple and aligned with requirements.
117
+
118
+
---
119
+
120
+
### 8. Explicit Non-Goals
121
+
122
+
The following features are intentionally **not implemented**:
123
+
124
+
- Authentication and user management
125
+
- Role-based access control
126
+
- Rate limiting
127
+
- Background job queues
128
+
- Cron or scheduled triggers
129
+
- Webhook signature verification
130
+
- Visual workflow designer
131
+
- Monitoring or analytics dashboards
132
+
133
+
These are considered outside the scope of the project.
134
+
135
+
---
136
+
137
+
### 9. Documentation
138
+
139
+
All assumptions and trade-offs are explicitly documented here to ensure transparency and alignment with the expectations.
Copy file name to clipboardExpand all lines: docs/REQUIREMENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Workflow Engine – Requirements
2
2
3
-
This document captures the complete and final set of requirements for the Workflow Engine assignment, incorporating clarifications provided by the hiring manager.
3
+
This document captures the complete and final set of requirements for the Workflow Engine project.
0 commit comments