{
  "id": "4rnDjMpKVIwOEVr7",
  "name": "Auto Sign PDF in Google Drive",
  "tags": [],
  "nodes": [
    {
      "id": "cd55bdb7-757e-4967-9290-8d36a222807c",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        736,
        160
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_TRIGGER_FOLDER_ID",
          "cachedResultUrl": "",
          "cachedResultName": "E-Sign Document"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b99bb23c-9084-46f4-9537-8d02281c3d98",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1024,
        160
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "2a115997-732d-4926-b0c5-849478312bd6",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "position": [
        1264,
        160
      ],
      "parameters": {
        "values": {
          "number": [
            {
              "name": "sign_x",
              "value": 430
            },
            {
              "name": "sign_y",
              "value": 20
            }
          ],
          "string": [
            {
              "name": "signature_url",
              "value": "YOUR_SIGNATURE_URL"
            },
            {
              "name": "output",
              "value": "drive"
            },
            {
              "name": "email"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "33d7e7fc-6d90-442c-914e-bbfd8cf7212d",
      "name": "Is PDF?",
      "type": "n8n-nodes-base.if",
      "position": [
        1472,
        160
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $binary.data.fileExtension }}",
              "value2": "pdf"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c2cb20cf-56aa-4ad2-91a9-ba50f8b0b5f4",
      "name": "Sign a PDF with a signature image",
      "type": "n8n-nodes-pdf-api-hub.pdfSplitMerge",
      "position": [
        1680,
        128
      ],
      "parameters": {
        "sign_x": "={{ $json.sign_x }}",
        "sign_y": "={{ $json.sign_y }}",
        "resource": "watermark",
        "sign_position": "custom",
        "sign_signature_url": "={{ $json.signature_url }}",
        "signAdvancedOptions": {},
        "sign_pdf_input_type": "file"
      },
      "typeVersion": 1
    },
    {
      "id": "c943cd80-2e5b-4cd8-b2bf-736568aa239a",
      "name": "Upload file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1968,
        144
      ],
      "parameters": {
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_UPLOAD_FOLDER_ID",
          "cachedResultUrl": "",
          "cachedResultName": "Signed PDFs"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "7d389e4e-941b-472f-b974-4cf73816e6b2",
      "name": "Log",
      "type": "n8n-nodes-base.set",
      "position": [
        2240,
        144
      ],
      "parameters": {
        "values": {
          "string": [
            {
              "name": "status",
              "value": "signed"
            },
            {
              "name": "file",
              "value": "={{ $json.name }}"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "d1395fa6-6e54-4cf0-ad73-8dafb6055f8f",
      "name": "Sticky Note - Folders",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "color": 4,
        "width": 596,
        "height": 420,
        "content": "Automatically signs PDFs dropped into a Google Drive folder.\nIt downloads the file, checks if it\u2019s a PDF, adds a signature image at set coordinates, and then either uploads the signed file back to Drive.\n\n## \ud83d\udcc2 Folder Setup\n\n- **Trigger folder** \u2192 Set YOUR_TRIGGER_FOLDER_ID\n- **Upload folder** \u2192 Set YOUR_UPLOAD_FOLDER_ID\n\n## \ud83d\udd0c Credentials Needed\n\n1. Google Drive OAuth2\n2. PDF API Hub (https://pdfapihub.com)\n\n## \ud83d\udd8a Signature\n\n- Set YOUR_SIGNATURE_URL to your hosted signature image\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "dae044bf-ffae-4568-b89e-d0ba0bbe9030",
  "connections": {
    "Config": {
      "main": [
        [
          {
            "node": "Is PDF?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is PDF?": {
      "main": [
        [
          {
            "node": "Sign a PDF with a signature image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file": {
      "main": [
        [
          {
            "node": "Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sign a PDF with a signature image": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}