Why All Logic Lives in the Edges

2025-05-12 by Chris

If connecting two nodes with an edge already forms a causal relationship -
"If A happens, then B follows" - then why should logic be defined anywhere else?

That question became the foundation of Wanderer's architecture.

The Initial Insight: Causality Through Connection

In many visual flow builders, connecting two nodes with an arrow (or "edge") implies a relationship:

  • If this message was shown,
  • then ask this question.
  • If this API returned true,
  • then continue here.

The edge represents logic - even if it's just temporal ("then do this") or conditional ("if this, then that").

So the next step was obvious:

What if all logic - even complex logical gates - could live in the edges?

The Problem With Other Builders

Most visual tools mix logic in two places:

  • Edges for simple connections.
  • Nodes for conditions, branching, even scripting.

This causes problems:

  1. Hidden logic: You don’t know where a decision is made.
  2. Inconsistent logic: Sometimes edges decide, sometimes nodes.
  3. Code in nodes: Flow becomes dependent on internal node behavior or black-box scripts.
  4. Non-visual logic: The graph stops being the source of truth.

In such systems, the graph is no longer a visual representation of program logic - it's just a UI for wiring hidden internals.

The Wanderer Approach: Edges as First-Class Logic

In Wanderer, edges aren’t just wires - they are logic gates.

Each edge defines:

  • Whether it can be traversed
  • Under which condition
  • What it means for the next node to activate

Node types remain simple:

  • Display a message
  • Ask a question
  • Store a variable
  • Call an API

But they never decide what comes next. That’s the edge’s job.

Why This Matters

1. Visual Logic Is Understandable Logic

When logic lives in the edges:

  • You can see the condition.
  • You can combine multiple edges into AND / OR gates.
  • You can trace decisions without reading code.

This aligns perfectly with Wanderer’s goal:

WYSIWYG logic. What you draw is what it does.

2. Logic Is Modular and Testable

Since conditions are declared on edges:

  • You can test them in isolation.
  • You can reuse the same node with different logic pathways.
  • You can modify behavior without touching the node.

3. Graphs Become Executable

Because logic is fully embedded in the graph:

  • The traversal engine can walk the graph and make decisions.
  • There’s no need to "evaluate" node internals.
  • Logic becomes data, not code.

This makes flows easier to:

  • Version
  • Share
  • Fork
  • Export

Example: Building a Logical Gate Visually

Let’s say we have a node that sets the state user.stressed = true.

You can now create two must-edges leading to the next question node:

  • One edge checks: user.stressed == true
  • Another edge checks: user.age > 30

Only if both edges are traversed successfully will the next question appear.

You’ve just built an AND gate, entirely visually - and entirely through edges.

Final Thought: Logic Belongs to the Connections

Nodes are actions.
Edges are decisions.

By giving all logic to the edges, we create a system where:

  • Causality is always visible
  • The graph is the program
  • Every decision is explicit

This is what makes Wanderer different.

Start the Builder

Title image: https://pixabay.com/illustrations/brain-left-logic-science-5662028/