{
  "name": "Automated digital certificate creator & validator with PDF generation",
  "nodes": [
    {
      "id": "613c5389-2f80-44c9-8ec1-043d02d720d7",
      "name": "Insert_Certificaton",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        320,
        -224
      ]
    },
    {
      "id": "7b690565-bc2e-4c50-9e34-5368972be90f",
      "name": "Generate_Certification_ID",
      "type": "n8n-nodes-base.code",
      "position": [
        -352,
        -240
      ]
    },
    {
      "id": "ee3e5ab4-7d0a-41d9-b72c-0d1e071c9142",
      "name": "Find_Certification_By_ID",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -144,
        -240
      ]
    },
    {
      "id": "554946dd-0444-4e50-b132-983b44e931e5",
      "name": "Certification_ID_Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        64,
        -240
      ]
    },
    {
      "id": "848bddc2-4362-40b6-a8e0-18511f9b5c23",
      "name": "Generate_PDF",
      "type": "@pdfgeneratorapi/n8n-nodes-pdf-generator-api.pdfGeneratorApi",
      "position": [
        528,
        -224
      ]
    },
    {
      "id": "03f873c2-f9b0-409c-bff0-4d32f5ed6efd",
      "name": "Email_Certification",
      "type": "n8n-nodes-base.gmail",
      "position": [
        752,
        -224
      ]
    },
    {
      "id": "aed81c3b-10ce-4d98-9b6c-c890c71ab815",
      "name": "Webhook_Check",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -592,
        224
      ]
    },
    {
      "id": "71b9f653-4574-4bf2-b9ce-660c083d0a85",
      "name": "Find_Certification_By_ID1",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -352,
        224
      ]
    },
    {
      "id": "e35823bf-189c-4192-85ca-24010ba3ed09",
      "name": "Certification_Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        -144,
        224
      ]
    },
    {
      "id": "98428e2a-330b-4995-b177-74ce6ec41a35",
      "name": "Respond_Found",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        96,
        160
      ]
    },
    {
      "id": "15e115bd-3d35-4805-9806-85d6e80a7c21",
      "name": "Respond_NotFound",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        96,
        288
      ]
    },
    {
      "id": "38d50087-20f5-43aa-acbd-0893dafe8381",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -672,
        -448
      ],
      "parameters": {
        "width": 256,
        "height": 368,
        "content": "## Creation  \n## Webhook input\n\nReceives name, surname, course and email via HTTP POST on `/certifications`.  \nStarts the certificate creation flow.\n"
      }
    },
    {
      "id": "9672b65b-832d-4496-9f50-d75b5432fcc2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -448
      ],
      "parameters": {
        "width": 864,
        "height": 368,
        "content": "## Creation – Generate & validate ID\n\nGenerates a random CertificationID, checks the Data Table for duplicates and only continues when the ID is unique.  \nIf the ID already exists, the flow loops unti"
      }
    },
    {
      "id": "00c13ad1-1026-4b0f-b880-89d901a1ee11",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        -448
      ],
      "parameters": {
        "width": 448,
        "height": 368,
        "content": "## Creation – Save, PDF & email\n\nSaves the learner record with the CertificationID to the Data Table, generates the certificate PDF from an HTML template and emails it to the learner.\n"
      }
    },
    {
      "id": "741f9beb-f922-441b-9249-c6a06da55571",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -672,
        32
      ],
      "parameters": {
        "width": 256,
        "height": 320,
        "content": "## Check – Webhook input\n\nReceives a CertificationID via HTTP POST on `/certificationscheck` and starts the verification flow.\n"
      }
    },
    {
      "id": "1c7f6487-80e4-45d2-a676-645f66c4bfaf",
      "name": "Webhook_Creation",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -592,
        -240
      ]
    },
    {
      "id": "28750e3a-7cec-4a45-8a5a-cb87dbd3181d",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        32
      ],
      "parameters": {
        "width": 432,
        "height": 320,
        "content": "## Check – Look up ID\n\nSearches the Certifications Data Table for the submitted CertificationID and branches depending on whether a matching record exists.\n"
      }
    },
    {
      "id": "18468a33-fdb7-4602-a995-29d9e1c5aca5",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        176
      ],
      "parameters": {
        "width": 432,
        "height": 176,
        "content": "## Check – Responses\n\nReturns JSON to the caller.  \nIf the ID is found: `ok: true` plus name and surname.  \nIf not found: `ok: false` so the client can show an “invalid certification” message.\n"
      }
    },
    {
      "id": "3bedbbcb-cd61-4c54-872d-cfd54df9e991",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1344,
        -448
      ],
      "parameters": {
        "width": 640,
        "height": 560,
        "content": "## Certifications – Creator & Checker\n\n## How it works\nThis workflow manages the full lifecycle of a training certificate.  \n`/certifications` receives learner details, generates a unique Certificatio"
      }
    }
  ],
  "connections": {
    "Generate_PDF": {
      "main": [
        [
          {
            "node": "Email_Certification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook_Check": {
      "main": [
        [
          {
            "node": "Find_Certification_By_ID1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook_Creation": {
      "main": [
        [
          {
            "node": "Generate_Certification_ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert_Certificaton": {
      "main": [
        [
          {
            "node": "Generate_PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Certification_Exists": {
      "main": [
        [
          {
            "node": "Respond_Found",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond_NotFound",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Certification_ID_Exists": {
      "main": [
        [
          {
            "node": "Generate_Certification_ID",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Insert_Certificaton",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find_Certification_By_ID": {
      "main": [
        [
          {
            "node": "Certification_ID_Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find_Certification_By_ID1": {
      "main": [
        [
          {
            "node": "Certification_Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate_Certification_ID": {
      "main": [
        [
          {
            "node": "Find_Certification_By_ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}