Skip to main content

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 evenlyNodes crammed together
Clear wire pathsWires crossing everywhere
Room to add moreNo 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

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

  1. Click on the node
  2. Find the title or label field
  3. 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:

  1. Splitting into subflows — Extract logical sections
  2. Using multiple triggers — Separate concerns
  3. 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