{
  "name": "Create Certificates",
  "tags": [],
  "nodes": [
    {
      "id": "node1",
      "name": "Google Sheets Trigger",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "notes": "Getting data from sheets",
      "position": [
        0,
        0
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "YOUR_GOOGLE_SHEET_URL#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "YOUR_GOOGLE_SHEET_URL"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "node2",
      "name": "Copy file",
      "type": "n8n-nodes-base.googleDrive",
      "notes": "Copy certificate template",
      "position": [
        208,
        0
      ],
      "parameters": {
        "name": "={{ $json.Name }} Certificate",
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_SLIDES_TEMPLATE_ID"
        },
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "url",
          "value": "YOUR_TARGET_FOLDER_URL"
        },
        "operation": "copy",
        "sameFolder": false
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "notesInFlow": true,
      "typeVersion": 3
    },
    {
      "id": "node3",
      "name": "Replace text in a presentation",
      "type": "n8n-nodes-base.googleSlides",
      "notes": "Change text",
      "position": [
        416,
        0
      ],
      "parameters": {
        "textUi": {
          "textValues": [
            {
              "text": "[NAME]",
              "replaceText": "={{ $('Google Sheets Trigger').item.json.Name }}",
              "pageObjectIds": [
                "p1"
              ]
            }
          ]
        },
        "options": {},
        "operation": "replaceText",
        "presentationId": "={{ $json.id }}"
      },
      "credentials": {
        "googleSlidesOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "node4",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        624,
        0
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.presentationId }}"
        },
        "options": {
          "fileName": "={{ $('Google Sheets Trigger').item.json.Name }} Certificate",
          "googleFileConversion": {
            "conversion": {
              "slidesToFormat": "application/pdf"
            }
          }
        },
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "node5",
      "name": "Upload file",
      "type": "n8n-nodes-base.googleDrive",
      "notes": "Saving PDFs",
      "position": [
        864,
        192
      ],
      "parameters": {
        "name": "={{ $('Google Sheets Trigger').item.json.Name }} Certificate.pdf",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "url",
          "value": "YOUR_FINAL_PDF_FOLDER_URL"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "notesInFlow": true,
      "typeVersion": 3
    },
    {
      "id": "node6",
      "name": "Delete a file",
      "type": "n8n-nodes-base.googleDrive",
      "notes": "Deleting temporary PPT",
      "position": [
        1152,
        176
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Replace text in a presentation').item.json.presentationId }}"
        },
        "options": {},
        "operation": "deleteFile"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "notesInFlow": true,
      "typeVersion": 3
    },
    {
      "id": "node7",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        864,
        16
      ],
      "parameters": {
        "sendTo": "={{ $('Google Sheets Trigger').item.json.Email }}",
        "message": "=Dear {{ $('Google Sheets Trigger').item.json.Name }},\nCongratulations on completing the program \ud83c\udf89.\nPlease find your certificate attached.\n\nBest regards,\nYour Team",
        "options": {
          "attachmentsUi": {
            "attachmentsBinary": [
              {
                "property": "data"
              }
            ]
          }
        },
        "subject": "Your Certificate",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "note1",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        784
      ],
      "parameters": {
        "width": 752,
        "height": 1008,
        "content": "## Workflow Guide: Auto-Certificate Generator \ud83c\udf93\n\n**Step 1 \u2013 Google Sheets Trigger**  \nWatches for new rows in the sheet (Name, Email).  \nEach new row starts the workflow.\n\n**Step 2 \u2013 Copy File (Google Drive)**  \nCopies the Google Slides certificate template.  \nNames the file `<Student Name> Certificate`.\n\n**Step 3 \u2013 Replace Text (Google Slides)**  \nFinds placeholder `[NAME]` in the copied template.  \nReplaces it with the student's actual name.\n\n**Step 4 \u2013 Download File (Google Drive)**  \nExports the customized Slides file as PDF.  \nFile name: `<Student Name> Certificate.pdf`.\n\n**Step 5 \u2013 Upload File (Google Drive)**  \nSaves the generated PDF into the selected folder.  \nKeeps all certificates organized.\n\n**Step 6 \u2013 Delete File (Google Drive)**  \nDeletes the temporary Slides copy.  \nOnly PDFs remain in Drive.\n\n**Step 7 \u2013 Send a message (Gmail)**  \nSends the generated certificate by email to the student.\n\n---\n\n\ud83d\udccc Notes:  \n- Update **Sheet ID**, **Slides template ID**, **Destination Folder ID**, and **Gmail credentials** with your own.  \n- Ensure your template has `[NAME]` exactly where the student name should appear.  \n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "Copy file": {
      "main": [
        [
          {
            "node": "Replace text in a presentation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file": {
      "main": [
        [
          {
            "node": "Delete a file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          },
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets Trigger": {
      "main": [
        [
          {
            "node": "Copy file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Replace text in a presentation": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}