Create Todo Workflow
This guide shows how to build a Create Todo API using DotPortion’s visual workflow builder. You will create a workflow that:- Accepts todo data from an HTTP request
- Processes and enriches the data
- Stores it in the database
- Returns a success response
What We’re Building
Endpoint:Create a new todo item and store it in the database.
Before You Start
Make sure you have:- Created the Todo Project
- Defined the Todo Schema
- Selected a database (Platform DB or MongoDB)
Step 1: Create a New Workflow
- Open your project
- Click New Workflow
- Name it:
create-todo
🖼️ Workflow Creation (UI Reference)
Step 2: Configure API Start Node
Select the API Start Node and configure:- Method:
POST - Path:
/todos
🖼️ API Start Node Configuration
Step 3: Add Parameter Node
Add a Parameter Node to extract request body values. Configure the following fields:| Field | Type | Required |
|---|---|---|
| title | String | Yes |
| description | String | No |
🖼️ Parameter Node Configuration
Step 4: Add Logic Node
Add a Logic Node to enrich the todo data before saving. Configure logic to:- Set
completedtofalse - Set
createdAtto current time - Set
updatedAtto current time
🖼️ Logic Node Configuration
Step 5: Add Database Node
Add a Database Node to store the todo. Configure:- Database: Platform DB or MongoDB
- Collection:
todos - Operation:
insertOne - Data: Output from Logic Node
🖼️ Database Node Configuration
Step 6: Add Response Node
Add a Response Node to return a success response. Configure:- Status Code:
201 - 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. Once deployed, the API becomes available immediately.Testing the Workflow
Use the Realtime Executor to:- Send a test request
- Watch node-by-node execution
- Verify data insertion
- Debug errors if any
🖼️ Realtime Executor View
What Happens on Each Request
- Request hits
/todos - Parameters are validated
- Data is enriched
- Todo is saved
- Response is returned
Best Practices
- Validate inputs early
- Never trust client-side values
- Keep logic minimal and explicit
- Use schema defaults where possible