Flow Editor
Build complex API logic visually by connecting nodes in a flow-based editor.
Overview
The Flow Editor allows you to create endpoint logic by:
- Dragging and dropping nodes onto the canvas
- Connecting nodes to define data flow
- Configuring each node's behavior
- Testing flows in real-time
Start with the "Trigger" node which receives the incoming request, then connect your logic nodes.
Node Types
Trigger Nodes
| Node | Description |
|---|---|
| HTTP Request | Receives incoming API requests |
| Webhook | Triggered by external webhooks |
| Schedule | Runs on a cron schedule |
Database Nodes
| Node | Description |
|---|---|
| Query | Execute SELECT queries |
| Insert | Insert new records |
| Update | Update existing records |
| Delete | Delete records |
| Raw SQL | Execute custom SQL |
Logic Nodes
| Node | Description |
|---|---|
| Condition | Branch based on conditions |
| Switch | Multiple branch paths |
| Loop | Iterate over arrays |
| Transform | Modify data structure |
| Merge | Combine multiple inputs |
Action Nodes
| Node | Description |
|---|---|
| HTTP Request | Call external APIs |
| Send Email | Send emails via SMTP |
| Edge Function | Run custom code |
| Storage | Upload/download files |
Response Nodes
| Node | Description |
|---|---|
| Return | Send response to client |
| Error | Return error response |
Building a Flow
Example: Create a user registration flow
Flow: User Registration
1. HTTP Request (POST /register)
β
2. Transform (validate input)
β
3. Condition (check if email exists)
ββ Yes β Error (409 Conflict)
ββ No β
4. Insert (users table)
β
5. Send Email (welcome email)
β
6. Return (201 Created, user data)Variables
Access data throughout your flow using variables:
// Request data
{{request.body}} // Request body
{{request.body.email}} // Specific field
{{request.headers}} // Request headers
{{request.query}} // Query parameters
{{request.params.id}} // URL parameters
// Node outputs
{{nodes.query1.data}} // Data from 'query1' node
{{nodes.insert1.id}} // ID from insert
// Environment
{{env.API_SECRET}} // Environment variableVariable names are based on the node's ID which you can customize.
Conditions
Use the Condition node to branch your flow:
// Condition examples
{{request.body.role}} == "admin"
{{nodes.query1.data.length}} > 0
{{request.headers.authorization}} != null
{{nodes.user.data.is_verified}} == trueTransformations
Modify data between nodes:
// Transform node configuration
{
"user": {
"id": "{{nodes.insert1.id}}",
"email": "{{request.body.email}}",
"name": "{{request.body.name}}",
"createdAt": "{{now()}}"
},
"token": "{{generateToken(nodes.insert1.id)}}"
}Error Handling
Handle errors gracefully in your flows:
- Add Error nodes to catch specific errors
- Use Condition nodes to validate data
- Return appropriate HTTP status codes
// Error response configuration
{
"status": 400,
"body": {
"error": "Validation failed",
"message": "{{error.message}}",
"code": "VALIDATION_ERROR"
}
}Debugging Flows
Debug your flows with these tools:
- Test Mode: Run flows with sample data
- Execution Log: View step-by-step execution
- Variable Inspector: See variable values at each step
- Error Details: Full stack traces for errors
Test your flows thoroughly before deploying to production.
Best Practices
- Name nodes descriptively (e.g., "fetchUserByEmail")
- Add validation early in the flow
- Handle all error cases
- Use Transform nodes to sanitize output
- Keep flows simple and focused