Skip to content

Commit d794829

Browse files
committed
docs: Restructure documentation, add UI previews.
1 parent bbed920 commit d794829

10 files changed

Lines changed: 162 additions & 138 deletions

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,9 @@ dist
138138
vite.config.js.timestamp-*
139139
vite.config.ts.timestamp-*
140140
original_question.md
141+
142+
prep-docs
143+
# OS generated files
144+
.DS_Store
145+
.DS_Store?
146+
._*

README.md

Lines changed: 16 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,22 @@ docker-compose up -d
6161
docker-compose down -v
6262
```
6363

64+
## 🖼 UI Previews
65+
66+
Below are some previews of the Mini Workflow Engine in action:
67+
68+
![Workflows Dashboard](./docs/images/workflows_dashboard.png)
69+
![Create Workflow](./docs/images/create_workflow.png)
70+
![Edit Workflow](./docs/images/edit_workflow.png)
71+
![Workflow Steps](./docs/images/workflow_steps.png)
72+
6473
## 📖 API Documentation
6574

6675
Once the backend is running, you can access the Interactive Swagger UI at:
6776
[http://localhost:4000/api-docs](http://localhost:4000/api-docs)
6877

78+
![Swagger API Documentation](./docs/images/swagger_docs.png)
79+
6980
## 🧪 Testing
7081

7182
### Backend Tests
@@ -84,142 +95,10 @@ npm test
8495

8596
---
8697

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
22299

223-
### 9. Documentation
100+
For more detailed information about the project's design, constraints, and requirements, please refer to the following documents:
224101

225-
All assumptions and trade-offs are explicitly documented here to ensure transparency and alignment with the assignment expectations.
102+
- [Requirements](./docs/REQUIREMENTS.md)
103+
- [Assumptions & Trade-offs](./docs/ASSUMPTIONS.md)
104+
- [Technical Specifications](./docs/tech-specs.md)

docs/ASSUMPTIONS.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# Assumptions and Trade-offs
2+
3+
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.

REQUIREMENTS.md renamed to docs/REQUIREMENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Workflow Engine – Requirements
22

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.
44

55
---
66

docs/images/create_workflow.png

417 KB
Loading

docs/images/edit_workflow.png

388 KB
Loading

docs/images/swagger_docs.png

300 KB
Loading

docs/images/workflow_steps.png

227 KB
Loading
208 KB
Loading
File renamed without changes.

0 commit comments

Comments
 (0)