{
  "name": "Build a self-hosted URL shortener with a dashboard",
  "nodes": [
    {
      "id": null,
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        350,
        70
      ]
    },
    {
      "id": null,
      "name": "Extract URL",
      "type": "n8n-nodes-base.set",
      "position": [
        650,
        -80
      ]
    },
    {
      "id": null,
      "name": "Check URL",
      "type": "n8n-nodes-base.if",
      "position": [
        500,
        70
      ]
    },
    {
      "id": null,
      "name": "Crypto",
      "type": "n8n-nodes-base.crypto",
      "position": [
        800,
        -80
      ]
    },
    {
      "id": null,
      "name": "Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1550,
        -30
      ]
    },
    {
      "id": null,
      "name": "Set ID,shortUrl,longUrl",
      "type": "n8n-nodes-base.set",
      "position": [
        950,
        -80
      ]
    },
    {
      "id": null,
      "name": "Find by ID",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1100,
        -80
      ]
    },
    {
      "id": null,
      "name": "Already exists ?",
      "type": "n8n-nodes-base.if",
      "position": [
        1250,
        -80
      ]
    },
    {
      "id": null,
      "name": "Set Output",
      "type": "n8n-nodes-base.set",
      "position": [
        1400,
        -180
      ]
    },
    {
      "id": null,
      "name": "Set Error output",
      "type": "n8n-nodes-base.set",
      "position": [
        650,
        170
      ]
    },
    {
      "id": null,
      "name": "Set Output1",
      "type": "n8n-nodes-base.set",
      "position": [
        1700,
        -30
      ]
    },
    {
      "id": null,
      "name": "Set input",
      "type": "n8n-nodes-base.set",
      "position": [
        1400,
        -30
      ]
    },
    {
      "id": null,
      "name": "Webhook1",
      "type": "n8n-nodes-base.webhook",
      "position": [
        350,
        430
      ]
    },
    {
      "id": null,
      "name": "Set Error output1",
      "type": "n8n-nodes-base.set",
      "position": [
        640,
        530
      ]
    },
    {
      "id": null,
      "name": "Check Id",
      "type": "n8n-nodes-base.if",
      "position": [
        500,
        430
      ]
    },
    {
      "id": null,
      "name": "Find by ID1",
      "type": "n8n-nodes-base.airtable",
      "position": [
        800,
        330
      ]
    },
    {
      "id": null,
      "name": "Already exists ?1",
      "type": "n8n-nodes-base.if",
      "position": [
        950,
        330
      ]
    },
    {
      "id": null,
      "name": "Set Output2",
      "type": "n8n-nodes-base.set",
      "position": [
        1400,
        230
      ]
    },
    {
      "id": null,
      "name": "Extract Id",
      "type": "n8n-nodes-base.set",
      "position": [
        650,
        330
      ]
    },
    {
      "id": null,
      "name": "404 Error",
      "type": "n8n-nodes-base.set",
      "position": [
        1100,
        430
      ]
    },
    {
      "id": null,
      "name": "Update clicks",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1250,
        230
      ]
    },
    {
      "id": null,
      "name": "Prepare clicks count",
      "type": "n8n-nodes-base.set",
      "position": [
        1100,
        230
      ]
    },
    {
      "id": null,
      "name": "Webhook2",
      "type": "n8n-nodes-base.webhook",
      "position": [
        350,
        680
      ]
    },
    {
      "id": null,
      "name": "Find by ID2",
      "type": "n8n-nodes-base.airtable",
      "position": [
        550,
        680
      ]
    },
    {
      "id": null,
      "name": "Extract stats",
      "type": "n8n-nodes-base.function",
      "position": [
        750,
        680
      ]
    },
    {
      "id": null,
      "name": "Set dashboard",
      "type": "n8n-nodes-base.set",
      "position": [
        950,
        680
      ]
    }
  ],
  "connections": {
    "Crypto": {
      "main": [
        [
          {
            "node": "Set ID,shortUrl,longUrl",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Check URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Airtable": {
      "main": [
        [
          {
            "node": "Set Output1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Id": {
      "main": [
        [
          {
            "node": "Extract Id",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Error output1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook1": {
      "main": [
        [
          {
            "node": "Check Id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook2": {
      "main": [
        [
          {
            "node": "Find by ID2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check URL": {
      "main": [
        [
          {
            "node": "Extract URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Error output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set input": {
      "main": [
        [
          {
            "node": "Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Id": {
      "main": [
        [
          {
            "node": "Find by ID1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find by ID": {
      "main": [
        [
          {
            "node": "Already exists ?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract URL": {
      "main": [
        [
          {
            "node": "Crypto",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find by ID1": {
      "main": [
        [
          {
            "node": "Already exists ?1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find by ID2": {
      "main": [
        [
          {
            "node": "Extract stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract stats": {
      "main": [
        [
          {
            "node": "Set dashboard",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update clicks": {
      "main": [
        [
          {
            "node": "Set Output2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Already exists ?": {
      "main": [
        [
          {
            "node": "Set Output",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Already exists ?1": {
      "main": [
        [
          {
            "node": "Prepare clicks count",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "404 Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare clicks count": {
      "main": [
        [
          {
            "node": "Update clicks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set ID,shortUrl,longUrl": {
      "main": [
        [
          {
            "node": "Find by ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}