{
  "name": "Generate document drafts from PDFs using Google Drive, GPT-4 & notifications",
  "nodes": [
    {
      "id": "0828fc42-59fb-40e3-b8d2-c7c00ce873a5",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        40,
        160
      ]
    },
    {
      "id": "9e9ef858-3a08-4c0a-b230-792c77a32ade",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        480,
        160
      ]
    },
    {
      "id": "c82d3fee-ab06-49a1-acc5-770f3462d804",
      "name": "Information Extractor",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        920,
        160
      ]
    },
    {
      "id": "254616b5-5270-47b7-9abd-e8fc19ec0ea3",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        940,
        320
      ]
    },
    {
      "id": "cd5312ee-6680-4c43-a35a-de0088363cc3",
      "name": "CREATE GOOGLE DOC",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        1640,
        160
      ]
    },
    {
      "id": "caee797a-3c11-4f71-9afd-4ecc8163a68d",
      "name": "Aggregate Extract Text",
      "type": "n8n-nodes-base.code",
      "position": [
        700,
        160
      ]
    },
    {
      "id": "7d3b7269-b1d0-4c32-b094-fef84a8d9b90",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 1220,
        "height": 480,
        "content": "This step retrieves the PDF from the designated Google Drive folder and extracts key information from it using an OpenAI agent. The extraction process can be customized to target specific data within "
      }
    },
    {
      "id": "f78cfa9f-dddb-4154-a18c-2a07cfe49e56",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1220,
        0
      ],
      "parameters": {
        "width": 1640,
        "height": 480,
        "content": "This part of the workflow uses an OpenAI agent to generate a draft based on the extracted binary data from the PDF. It then creates a Google Document within the same Google Drive folder and updates it"
      }
    },
    {
      "id": "f957fb25-a35d-43fd-8641-5d3ba1a1fb5a",
      "name": "Email Summary Agent",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2080,
        160
      ]
    },
    {
      "id": "8955dc77-672b-4fbc-943f-472f5120a03a",
      "name": "Drafting Agent",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1280,
        160
      ]
    },
    {
      "id": "457dae81-f2b1-4719-a573-efe5e755e7be",
      "name": "Download Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        260,
        160
      ]
    },
    {
      "id": "940c2be4-ea9b-4851-aa87-3a8677133723",
      "name": "UPDATE Google Docs",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        1880,
        160
      ]
    },
    {
      "id": "6dea5a05-adac-41e8-adbb-4eb352dcc20b",
      "name": "Edit Email Message",
      "type": "n8n-nodes-base.set",
      "position": [
        2440,
        160
      ]
    },
    {
      "id": "0ff51fb9-f2f1-4684-aef0-93f96eb7f758",
      "name": "Send Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2680,
        160
      ]
    }
  ],
  "connections": {
    "Drafting Agent": {
      "main": [
        [
          {
            "node": "CREATE GOOGLE DOC",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CREATE GOOGLE DOC": {
      "main": [
        [
          {
            "node": "UPDATE Google Docs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Aggregate Extract Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Information Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Edit Email Message": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UPDATE Google Docs": {
      "main": [
        [
          {
            "node": "Email Summary Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Summary Agent": {
      "main": [
        [
          {
            "node": "Edit Email Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Download Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Google Drive": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Information Extractor": {
      "main": [
        [
          {
            "node": "Drafting Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Extract Text": {
      "main": [
        [
          {
            "node": "Information Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}