Keeping Flows Clean
A well-organized bot is easier to maintain, debug, and expand. Here's how to keep your flows tidy.
Visual Organization
Flow Direction
Always build flows left to right:
This matches how we naturally read and makes flows intuitive.
Spacing
Leave room between nodes:
| ✅ Good | ❌ Bad |
|---|---|
| Nodes spaced evenly | Nodes crammed together |
| Clear wire paths | Wires crossing everywhere |
| Room to add more | No space to expand |
Avoid Wire Crossings
Crossing wires make flows hard to follow. If you have crossings:
- Rearrange nodes
- Split into smaller flows
- Use subflows
Grouping Related Nodes
Keep related functionality together:
┌─────────────────────────────┐
│ Registration Flow │
│ ┌───┐ ┌───┐ ┌───┐ │
│ │ A │ → │ B │ → │ C │ │
│ └───┘ └───┘ └───┘ │
└─────────────────────────────┘
┌─────────────────────────────┐
│ Settings Flow │
│ ┌───┐ ┌───┐ │
│ │ D │ → │ E │ │
│ └───┘ └───┘ │
└─────────────────────────────┘
When to Use Subflows
Extract to a subflow when you:
- Repeat logic in multiple places
- Have complex sections that distract from the main flow
- Want testable units you can verify independently
Example
Instead of this in 5 places:
Validate email → Check format → Check domain → Return result
Create one validate_email subflow and call it.
Naming Nodes
Give nodes descriptive names:
| ✅ Good | ❌ Bad |
|---|---|
| "Ask user name" | "Ask Question" |
| "Check if admin" | "Condition" |
| "Send welcome message" | "Send Message 1" |
How to Rename
- Click on the node
- Find the title or label field
- Enter a descriptive name
Comment Your Complex Logic
For tricky parts, add notes:
- Use a Comment node if available
- Or add a Send Message node (disabled) with explanation
- Document in a README outside BotGami
Break Down Large Flows
If a flow has more than 15-20 nodes, consider:
- Splitting into subflows — Extract logical sections
- Using multiple triggers — Separate concerns
- Simplifying logic — Maybe there's a cleaner approach?
Review Checklist
Before considering a flow "done":
- Flows go left to right
- Nodes are evenly spaced
- No wire crossings
- Nodes have descriptive names
- Complex sections are commented or extracted
- All paths have endpoints (no dead ends)
Next Steps
- Naming Conventions → — Consistent naming
- Common Patterns → — Reusable solutions