{
  "schemaVersion": "flowdrome.workflow.v1",
  "id": "",
  "name": "API front door — HTTP Trigger routes",
  "version": "0",
  "status": "draft",
  "nodes": [
    {
      "id": "front",
      "type": "input.http.webhook",
      "label": "Orders API",
      "category": "trigger",
      "config": {
        "method": "POST",
        "path": "/orders",
        "contentType": "application/json",
        "routes": [
          {
            "method": "GET",
            "path": "/orders",
            "port": "listOrders"
          },
          {
            "method": "GET",
            "path": "/orders/{orderId}",
            "port": "getOrder"
          },
          {
            "method": "POST",
            "path": "/orders",
            "port": "createOrder"
          }
        ]
      },
      "position": {
        "x": 0,
        "y": 36
      }
    },
    {
      "id": "listOrders",
      "type": "utility.console",
      "label": "List orders",
      "category": "utility",
      "config": {
        "message": "LIST — all orders"
      },
      "position": {
        "x": 651,
        "y": 0
      }
    },
    {
      "id": "getOrder",
      "type": "utility.console",
      "label": "Get one order",
      "category": "utility",
      "config": {
        "message": "GET — order {{ $json.pathParams.orderId }}"
      },
      "position": {
        "x": 651,
        "y": 178
      }
    },
    {
      "id": "createOrder",
      "type": "utility.console",
      "label": "Create order",
      "category": "utility",
      "config": {
        "message": "CREATE — new order"
      },
      "position": {
        "x": 651,
        "y": 356
      }
    },
    {
      "id": "unmatched",
      "type": "utility.console",
      "label": "No route",
      "category": "utility",
      "config": {
        "message": "404 — no route matched (methodMismatch: {{ $json.methodMismatch }})"
      },
      "position": {
        "x": 651,
        "y": 534
      }
    }
  ],
  "edges": [
    {
      "id": "e1",
      "sourceNodeId": "front",
      "sourcePort": "listOrders",
      "targetNodeId": "listOrders",
      "targetPort": "input"
    },
    {
      "id": "e2",
      "sourceNodeId": "front",
      "sourcePort": "getOrder",
      "targetNodeId": "getOrder",
      "targetPort": "input"
    },
    {
      "id": "e3",
      "sourceNodeId": "front",
      "sourcePort": "createOrder",
      "targetNodeId": "createOrder",
      "targetPort": "input"
    },
    {
      "id": "e4",
      "sourceNodeId": "front",
      "sourcePort": "unmatched",
      "targetNodeId": "unmatched",
      "targetPort": "input"
    }
  ],
  "triggers": [
    {
      "id": "t0",
      "nodeId": "front"
    }
  ],
  "meta": {
    "snippets": [],
    "source": "template-gallery",
    "description": "One trigger, many endpoints: add ROUTES to the HTTP Trigger and each becomes its own output port — GET /orders lists, GET /orders/{orderId} fetches one (the {orderId} template lands on the payload as pathParams), POST /orders creates — and anything unclaimed exits the unmatched port. Test with the trigger tester (pick a method + path) to drive a different branch. This is also the backbone of API mockups (see Mock · Gmail)."
  }
}