{
  "name": "Research Paper Analyzer & Literature Review Assistant",
  "nodes": [
    {
      "parameters": {
        "content": "## \ud83c\udf93 Research Paper Analyzer\n\n### What this workflow does\n1. Watches Drive for new papers\n2. Pulls out metadata and findings\n3. Searches Semantic Scholar & PubMed\n4. Generates APA citations\n5. Logs to Google Sheets\n6. Creates Notion summary page\n\n### Setup steps\n1. Create \"Research Papers\" folder in Drive\n2. Get PDF Vector API key from pdfvector.com/api-keys\n3. Create Google Sheet with columns below\n4. Create Notion parent page for summaries\n5. Update folder ID, Sheet ID, Notion page ID\n\n### Sheet columns\nTitle, Authors, Year, Journal, DOI, Research Field, Study Type, Sample Size, Keywords, Abstract, Conclusions, Citation, Related Papers Found, File Link, Added Date\n\n### Perfect for\n- PhD students\n- Researchers\n- Literature reviews",
        "height": 480,
        "width": 320,
        "color": 5
      },
      "id": "sticky-main",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        60,
        100
      ]
    },
    {
      "parameters": {
        "content": "## \ud83d\udcda Academic Search\n\n- Semantic Scholar\n- PubMed\n\nFinds up to 10 related papers\nusing keywords from your paper.",
        "height": 160,
        "width": 220
      },
      "id": "sticky-databases",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        820,
        100
      ]
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "value": "YOUR_FOLDER_ID",
          "mode": "list"
        },
        "event": "fileCreated",
        "options": {}
      },
      "id": "gdrive-trigger",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "typeVersion": 1,
      "position": [
        420,
        320
      ],
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "value": "={{ $json.id }}",
          "mode": "id"
        },
        "options": {}
      },
      "id": "gdrive-download",
      "name": "Download Paper",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        620,
        320
      ],
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "extract",
        "inputType": "file",
        "prompt": "Extract research paper metadata as flat fields. title, authorsList (all authors comma-separated as single string), journal, publicationYear (number), doi, abstract, keywordsList (comma-separated keywords as single string), researchField, studyType (one of: Experimental, Observational, Review, Meta-analysis, Case Study, Qualitative, Mixed Methods, Theoretical), sampleSize (number), methodology, mainFindings (semicolon-separated list of main findings as single string), conclusions, limitations (semicolon-separated list as single string), futureResearch (semicolon-separated list as single string).",
        "schema": "{\"type\": \"object\", \"properties\": {\"title\": {\"type\": \"string\"}, \"authorsList\": {\"type\": \"string\"}, \"journal\": {\"type\": \"string\"}, \"publicationYear\": {\"type\": \"number\"}, \"doi\": {\"type\": \"string\"}, \"abstract\": {\"type\": \"string\"}, \"keywordsList\": {\"type\": \"string\"}, \"researchField\": {\"type\": \"string\"}, \"studyType\": {\"type\": \"string\"}, \"sampleSize\": {\"type\": \"number\"}, \"methodology\": {\"type\": \"string\"}, \"mainFindings\": {\"type\": \"string\"}, \"conclusions\": {\"type\": \"string\"}, \"limitations\": {\"type\": \"string\"}, \"futureResearch\": {\"type\": \"string\"}}, \"additionalProperties\": false}"
      },
      "id": "pdfvector-extract",
      "name": "PDF Vector - Extract Paper Info",
      "type": "n8n-nodes-pdfvector.pdfVector",
      "typeVersion": 2,
      "position": [
        820,
        320
      ],
      "credentials": {
        "pdfVectorApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "academic",
        "operation": "search",
        "query": "={{ $json.data?.keywordsList ? $json.data.keywordsList.split(',').slice(0,3).join(' ') : $json.data?.title?.split(' ').slice(0,5).join(' ') || '' }}",
        "providers": [
          "semantic-scholar"
        ],
        "limit": 10,
        "offset": 0
      },
      "id": "pdfvector-search",
      "name": "PDF Vector - Find Related Papers",
      "type": "n8n-nodes-pdfvector.pdfVector",
      "typeVersion": 2,
      "position": [
        1020,
        320
      ],
      "credentials": {
        "pdfVectorApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const paper = $('PDF Vector - Extract Paper Info').item.json.data || $('PDF Vector - Extract Paper Info').item.json;\nconst relatedPapers = $input.first().json.results || [];\nconst fileName = $('Google Drive Trigger').item.json.name;\n\nconst relatedList = relatedPapers.slice(0, 5).map(p =>\n  `\u2022 ${p.title} (${p.year || 'N/A'}) - ${p.citationCount || 0} citations`\n).join('\\n') || 'No related papers found';\n\nconst citation = `${paper.authorsList || 'Unknown'} (${paper.publicationYear || 'n.d.'}). ${paper.title}. ${paper.journal || 'Unknown Journal'}${paper.doi ? `. https://doi.org/${paper.doi}` : ''}`;\n\nconst abstractShort = paper.abstract && paper.abstract.length > 800\n  ? paper.abstract.substring(0, 800) + '...'\n  : (paper.abstract || '');\n\nconst notionSummary = `Authors: ${paper.authorsList || 'N/A'}\\nYear: ${paper.publicationYear || 'N/A'}\\nJournal: ${paper.journal || 'N/A'}\\n\\n${abstractShort}\\n\\n${paper.conclusions || ''}`;\n\nreturn [{ json: {\n  title:         paper.title         || 'Unknown',\n  authorsList:   paper.authorsList   || 'Unknown',\n  publicationYear: paper.publicationYear || 'N/A',\n  journal:       paper.journal       || 'N/A',\n  doi:           paper.doi           || 'N/A',\n  researchField: paper.researchField || 'N/A',\n  studyType:     paper.studyType     || 'N/A',\n  sampleSize:    paper.sampleSize    || 'N/A',\n  keywordsList:  paper.keywordsList  || 'N/A',\n  abstract:      paper.abstract      || 'N/A',\n  conclusions:   paper.conclusions   || 'N/A',\n  mainFindings:  paper.mainFindings  || 'N/A',\n  relatedPapers: relatedList,\n  relatedCount:  relatedPapers.length,\n  citation,\n  notionSummary,\n  fileName,\n  fileId: $('Google Drive Trigger').item.json.id,\n  processedAt: new Date().toISOString()\n}}];"
      },
      "id": "compile-analysis",
      "name": "Compile Analysis",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1220,
        320
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "list"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Title": "={{ $json.title }}",
            "Authors": "={{ $json.authorsList }}",
            "Year": "={{ $json.publicationYear || 'N/A' }}",
            "Journal": "={{ $json.journal || 'N/A' }}",
            "DOI": "={{ $json.doi || 'N/A' }}",
            "Research Field": "={{ $json.researchField || 'N/A' }}",
            "Study Type": "={{ $json.studyType || 'N/A' }}",
            "Sample Size": "={{ $json.sampleSize || 'N/A' }}",
            "Keywords": "={{ $json.keywordsList }}",
            "Abstract": "={{ $json.abstract }}",
            "Conclusions": "={{ $json.conclusions || 'N/A' }}",
            "Citation": "={{ $json.citation }}",
            "Related Papers Found": "={{ $json.relatedCount }}",
            "File Link": "=https://drive.google.com/file/d/{{ $json.fileId }}/view",
            "Added Date": "={{ $json.processedAt.split('T')[0] }}"
          }
        },
        "options": {}
      },
      "id": "sheets-log",
      "name": "Add to Literature Database",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1420,
        320
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "page",
        "operation": "create",
        "pageId": {
          "__rl": true,
          "value": "YOUR_NOTION_PAGE_ID",
          "mode": "id"
        },
        "title": "={{ $json.title }}",
        "contentUi": {
          "contentValues": [
            {
              "type": "text",
              "text": "={{ $json.notionSummary }}"
            }
          ]
        },
        "options": {}
      },
      "id": "notion-page",
      "name": "Create Notion Summary",
      "type": "n8n-nodes-base.notion",
      "typeVersion": 2.2,
      "position": [
        1620,
        320
      ],
      "credentials": {
        "notionApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Download Paper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Paper": {
      "main": [
        [
          {
            "node": "PDF Vector - Extract Paper Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "PDF Vector - Extract Paper Info": {
      "main": [
        [
          {
            "node": "PDF Vector - Find Related Papers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "PDF Vector - Find Related Papers": {
      "main": [
        [
          {
            "node": "Compile Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compile Analysis": {
      "main": [
        [
          {
            "node": "Add to Literature Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to Literature Database": {
      "main": [
        [
          {
            "node": "Create Notion Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "tags": [
    {
      "name": "PDF Vector"
    },
    {
      "name": "Research"
    },
    {
      "name": "Academic"
    },
    {
      "name": "Notion"
    },
    {
      "name": "Literature Review"
    }
  ],
  "meta": {
    "templateCredsSetupCompleted": false
  }
}