Update Todo Workflow
This guide shows how to build an Update Todo API using DotPortion’s visual workflow builder, where the todo is updated based on data sent in the request body. This workflow:- Uses request body only
- Does not use path params
- Does not use query params
What We’re Building
Endpoint:Update an existing todo by providing its ID and updated fields in the request body.
Request Body Shape
Before You Start
Make sure you have:- Created the Todo Project
- Defined the Todo Schema
- Inserted at least one todo
- Built the Create Todo workflow
- Selected a database (Platform DB or MongoDB)
Step 1: Create a New Workflow
- Open your project
- Click New Workflow
- Name it:
update-todo
🖼️ Workflow Creation (UI Reference)
Step 2: Configure API Start Node
Select the API Start Node and configure:- Method:
PUT - Path:
/todo
🖼️ API Start Node Configuration
Step 3: Add Parameter Node (Body)
Add a Parameter Node to extract values from the request body. Configure the fields:| Field | Source | Type | Required |
|---|---|---|---|
| id | Body | String | Yes |
| title | Body | String | No |
| description | Body | String | No |
| completed | Body | Boolean | No |
🖼️ Parameter Node Configuration
Step 4: Add Logic Node
Add a Logic Node to prepare the update payload. Logic responsibilities:- Build an update object using only provided fields
- Set
updatedAt = now() - Prevent overwriting fields with
null
🖼️ Logic Node Configuration
Step 5: Add Database Node
Add a Database Node to update the todo. Configure:- Database: Platform DB or MongoDB
- Collection:
todos - Operation:
updateOne - Filter:
- Update:
🖼️ Database Update Configuration
Step 6: Add Response Node
Add a Response Node to confirm success. Configure:- Status Code:
200 - Response Body:
🖼️ Response Node Configuration
Step 7: Connect the Nodes
Connect the nodes in this order:🖼️ Final Workflow Graph
Step 8: Deploy the Workflow
Click Deploy to make the API live.Testing the Workflow
Send a request like:- Observe body parsing
- Inspect update payload
- Verify database update
🖼️ Realtime Executor View