{
  "schemaVersion": "flowdrome.workflow.v1",
  "id": "",
  "name": "AI · 03 — Classify & route",
  "version": "0",
  "status": "draft",
  "nodes": [
    {
      "id": "seed",
      "type": "input.inject",
      "label": "Ticket",
      "category": "trigger",
      "config": {
        "contentType": "application/json",
        "payload": {
          "text": "Our production server is down and customers cannot check out!"
        }
      },
      "position": {
        "x": 0,
        "y": 23
      }
    },
    {
      "id": "label",
      "type": "ai.classify",
      "label": "Classify",
      "category": "ai",
      "config": {
        "instructions": "Classify the support message by severity. Label it 'urgent' when it describes an outage, downtime, data loss, a security incident, or blocked customers. Label it 'normal' for questions, requests and minor issues. Classes are urgent, normal.",
        "labels": [
          "urgent",
          "normal"
        ],
        "outputSchema": {
          "type": "object",
          "properties": {
            "label": {
              "type": "string",
              "enum": [
                "urgent",
                "normal"
              ]
            },
            "reason": {
              "type": "string"
            }
          },
          "required": [
            "label"
          ]
        },
        "provider": "ollama",
        "baseUrl": "",
        "apiKey": "",
        "model": "qwen2.5:1.5b",
        "timeoutMs": 120000
      },
      "position": {
        "x": 530,
        "y": 23
      },
      "attachments": {
        "model": "llm"
      }
    },
    {
      "id": "llm",
      "type": "ai.model",
      "label": "Ollama (local)",
      "category": "ai",
      "config": {
        "provider": "ollama",
        "baseUrl": "",
        "apiKey": "",
        "model": "qwen2.5:1.5b",
        "models": [],
        "temperature": 0.2,
        "maxTokens": 512
      },
      "position": {
        "x": 530,
        "y": 245
      }
    },
    {
      "id": "route",
      "type": "logic.if",
      "label": "Urgent?",
      "category": "flow",
      "config": {
        "path": "label",
        "operator": "equals",
        "value": "urgent"
      },
      "position": {
        "x": 1060,
        "y": 23
      }
    },
    {
      "id": "hot",
      "type": "utility.console",
      "label": "Escalate",
      "category": "utility",
      "config": {
        "message": "🚨 label={{ $json.label }} → page the on-call"
      },
      "position": {
        "x": 1590,
        "y": 0
      }
    },
    {
      "id": "norm",
      "type": "utility.console",
      "label": "Queue it",
      "category": "utility",
      "config": {
        "message": "📋 label={{ $json.label }} → file in the queue"
      },
      "position": {
        "x": 1590,
        "y": 178
      }
    }
  ],
  "edges": [
    {
      "id": "e0",
      "sourceNodeId": "seed",
      "sourcePort": "output",
      "targetNodeId": "label",
      "targetPort": "input"
    },
    {
      "id": "e1",
      "sourceNodeId": "label",
      "sourcePort": "output",
      "targetNodeId": "route",
      "targetPort": "input"
    },
    {
      "id": "e2",
      "sourceNodeId": "route",
      "sourcePort": "true",
      "targetNodeId": "hot",
      "targetPort": "input"
    },
    {
      "id": "e3",
      "sourceNodeId": "route",
      "sourcePort": "false",
      "targetNodeId": "norm",
      "targetPort": "input"
    }
  ],
  "triggers": [
    {
      "id": "t0",
      "nodeId": "seed"
    }
  ],
  "meta": {
    "snippets": [],
    "source": "template-gallery",
    "description": "A support message is labeled by the ◈-wired Classify node (urgent / normal) and an If routes it: urgent tickets one way, everything else the other. Edit the Inject text and re-Test to watch it change lanes."
  }
}