{
  "schemaVersion": "flowdrome.workflow.v1",
  "id": "",
  "name": "Leads — qualify & route",
  "version": "0",
  "status": "draft",
  "nodes": [
    {
      "id": "seed",
      "type": "input.inject",
      "label": "New lead",
      "category": "trigger",
      "config": {
        "contentType": "application/json",
        "payload": {
          "company": "Globex",
          "region": "west",
          "score": 82,
          "budget": 25000
        }
      },
      "position": {
        "x": 0,
        "y": 80
      }
    },
    {
      "id": "worthIt",
      "type": "logic.filter-condition",
      "label": "Score ≥ 50?",
      "category": "processing",
      "config": {
        "path": "score",
        "operator": "greaterThan",
        "value": 50,
        "caseSensitive": false
      },
      "position": {
        "x": 530,
        "y": 80
      }
    },
    {
      "id": "bigEnough",
      "type": "logic.if",
      "label": "Budget > $10k?",
      "category": "flow",
      "config": {
        "path": "budget",
        "operator": "greaterThan",
        "value": 10000
      },
      "position": {
        "x": 1060,
        "y": 57
      }
    },
    {
      "id": "pod",
      "type": "logic.switch",
      "label": "Region pod",
      "category": "flow",
      "config": {
        "mode": "firstMatch",
        "defaultPort": "other",
        "rules": [
          {
            "port": "east",
            "path": "region",
            "operator": "equals",
            "value": "east"
          },
          {
            "port": "west",
            "path": "region",
            "operator": "equals",
            "value": "west"
          }
        ]
      },
      "position": {
        "x": 1590,
        "y": 34
      }
    },
    {
      "id": "east",
      "type": "utility.console",
      "label": "East pod",
      "category": "utility",
      "config": {
        "message": "→ EAST pod takes {{ $json.company }}"
      },
      "position": {
        "x": 2120,
        "y": 0
      }
    },
    {
      "id": "west",
      "type": "utility.console",
      "label": "West pod",
      "category": "utility",
      "config": {
        "message": "→ WEST pod takes {{ $json.company }}"
      },
      "position": {
        "x": 2120,
        "y": 178
      }
    },
    {
      "id": "other",
      "type": "utility.console",
      "label": "Unassigned",
      "category": "utility",
      "config": {
        "message": "→ unassigned region — route manually"
      },
      "position": {
        "x": 2120,
        "y": 356
      }
    },
    {
      "id": "nurture",
      "type": "utility.console",
      "label": "Nurture",
      "category": "utility",
      "config": {
        "message": "→ nurture track for {{ $json.company }} (budget {{ $json.budget }})"
      },
      "position": {
        "x": 1590,
        "y": 212
      }
    }
  ],
  "edges": [
    {
      "id": "e0",
      "sourceNodeId": "seed",
      "sourcePort": "output",
      "targetNodeId": "worthIt",
      "targetPort": "input"
    },
    {
      "id": "e1",
      "sourceNodeId": "worthIt",
      "sourcePort": "output",
      "targetNodeId": "bigEnough",
      "targetPort": "input"
    },
    {
      "id": "e2",
      "sourceNodeId": "bigEnough",
      "sourcePort": "true",
      "targetNodeId": "pod",
      "targetPort": "input"
    },
    {
      "id": "e3",
      "sourceNodeId": "bigEnough",
      "sourcePort": "false",
      "targetNodeId": "nurture",
      "targetPort": "input"
    },
    {
      "id": "e4",
      "sourceNodeId": "pod",
      "sourcePort": "east",
      "targetNodeId": "east",
      "targetPort": "input"
    },
    {
      "id": "e5",
      "sourceNodeId": "pod",
      "sourcePort": "west",
      "targetNodeId": "west",
      "targetPort": "input"
    },
    {
      "id": "e6",
      "sourceNodeId": "pod",
      "sourcePort": "other",
      "targetNodeId": "other",
      "targetPort": "input"
    }
  ],
  "triggers": [
    {
      "id": "t0",
      "nodeId": "seed"
    }
  ],
  "meta": {
    "snippets": [],
    "source": "template-gallery",
    "description": "A new lead is scored, filtered, and routed: too small → nurture; otherwise the region switch sends it to the right sales pod. Change the Inject values and re-Test to watch it change lanes."
  }
}