{
  "name": "Gamify Keephub form response times and email a ranked leaderboard via Gmail",
  "nodes": [
    {
      "id": "63171447-5c6f-4608-b65d-1a987271af89",
      "name": "📧 Send Competition Report",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2416,
        1296
      ]
    },
    {
      "id": "293d5e4a-abb4-4657-8291-62def169bdd0",
      "name": "Get Orgchart Info",
      "type": "n8n-nodes-keephub.keephub",
      "position": [
        1744,
        1296
      ]
    },
    {
      "id": "7da3b2b3-4ed6-45fc-b449-f89db55f6255",
      "name": "Find form submissions by form",
      "type": "n8n-nodes-keephub.keephub",
      "position": [
        848,
        1296
      ]
    },
    {
      "id": "dffed0d2-c867-47e4-b485-7ad7c90cdf99",
      "name": "📊 Aggregate Stats & Build Report",
      "type": "n8n-nodes-base.code",
      "position": [
        2192,
        1296
      ]
    },
    {
      "id": "79c8f4c6-2185-4c0f-824a-1a4f4d07f4cd",
      "name": "🔗 Enrich with User Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1968,
        1296
      ]
    },
    {
      "id": "6e2f85d6-bd25-42ed-ade6-0ed783989bc4",
      "name": "Get submitter details for a form submission",
      "type": "n8n-nodes-keephub.keephub",
      "position": [
        1520,
        1296
      ]
    },
    {
      "id": "9010c1ef-e482-4fb3-9bbe-5b8cc530644c",
      "name": "Calculate response duration for a form submission",
      "type": "n8n-nodes-keephub.keephub",
      "position": [
        1296,
        1296
      ]
    },
    {
      "id": "eacc15c8-c5f6-4d0f-a294-e8a8e2c4b764",
      "name": "✂️ Split into Items",
      "type": "n8n-nodes-base.code",
      "position": [
        1072,
        1296
      ]
    },
    {
      "id": "9f74c3f3-6639-4bee-9837-3a302429f095",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        688
      ],
      "parameters": {
        "width": 1988,
        "height": 788,
        "content": "## 🏆 Gamify form response times and email a ranked leaderboard with Keephub\n\nTurn any Keephub form into a timed competition. Paste in a Form ID, and this workflow fetches all submissions, ranks partic"
      }
    },
    {
      "id": "016cb277-b787-40ad-babc-0ea907b830bb",
      "name": "Fetch submissions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        1168
      ],
      "parameters": {
        "width": 640,
        "height": 310,
        "content": "## 📥 Fetch submissions\nCollects all form submissions from Keephub for the given Form ID and splits them into individual items for per-user processing."
      }
    },
    {
      "id": "667886ce-d343-4875-82b5-ac63ba054b71",
      "name": "Process and enrich",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1232,
        1168
      ],
      "parameters": {
        "width": 886,
        "height": 310,
        "content": "## ⚙️ Process & enrich\nCalculates response duration per submission — using the custom start time when provided, or Keephub’s default (time since form creation). Fetches submitter details and resolves "
      }
    },
    {
      "id": "ac3f949a-fc38-47aa-b72b-3c80923648d7",
      "name": "Build and send report",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2144,
        1168
      ],
      "parameters": {
        "width": 420,
        "height": 310,
        "content": "## 📊 Build & send\nAggregates stats, builds a ranked HTML leaderboard with org-unit breakdown, and emails the competition report to the requester."
      }
    },
    {
      "id": "06dca842-339b-48e8-b8b3-d4e32133ffe6",
      "name": "🚀 Start here!",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        624,
        1296
      ]
    }
  ],
  "connections": {
    "🚀 Start here!": {
      "main": [
        [
          {
            "node": "Find form submissions by form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Orgchart Info": {
      "main": [
        [
          {
            "node": "🔗 Enrich with User Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "✂️ Split into Items": {
      "main": [
        [
          {
            "node": "Calculate response duration for a form submission",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🔗 Enrich with User Data": {
      "main": [
        [
          {
            "node": "📊 Aggregate Stats & Build Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find form submissions by form": {
      "main": [
        [
          {
            "node": "✂️ Split into Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📊 Aggregate Stats & Build Report": {
      "main": [
        [
          {
            "node": "📧 Send Competition Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get submitter details for a form submission": {
      "main": [
        [
          {
            "node": "Get Orgchart Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate response duration for a form submission": {
      "main": [
        [
          {
            "node": "Get submitter details for a form submission",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}