{
  "name": "Weekly Job Recap",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtHour": 21
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        0,
        0
      ],
      "id": "5aa7dd43-8605-4af8-b901-2a79f5671b07",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1nr4iHcGb0BlB5mfscdjpSmnIq9g4jAnJok0rcfIR3y8",
          "mode": "list",
          "cachedResultName": "Full Time Applications",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nr4iHcGb0BlB5mfscdjpSmnIq9g4jAnJok0rcfIR3y8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1601282352,
          "mode": "list",
          "cachedResultName": "2026",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nr4iHcGb0BlB5mfscdjpSmnIq9g4jAnJok0rcfIR3y8/edit#gid=1601282352"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        208,
        0
      ],
      "id": "a4f87425-9c03-4e0c-8b81-f217eb1a8748",
      "name": "Get row(s) in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "claude-sonnet-4-20250514",
          "mode": "list",
          "cachedResultName": "claude-sonnet-4-20250514"
        },
        "messages": {
          "values": [
            {
              "content": "=You are an assistant helping track and summarize a job search pipeline.\n\nHere is the current job application data:\n{{ $json.applicationData }}\n\nPlease write a friendly, structured weekly job search digest email with the following sections:\n\n1. **\ud83d\udcca Overview** \u2014 Total applications, and a breakdown by status (Submitted, Interview, Assessment, Rejected)\n\n2. **\ud83d\udd25 Needs Attention** \u2014 Any applications with Interview or Assessment status that may need action\n\n3. **\ud83d\udcc5 Recent Activity** \u2014 Applications added or updated in the last 7 days based on the Update Date column\n\n4. **\ud83d\udca1 Next Steps** \u2014 2-3 actionable suggestions based on the current pipeline state\n\nKeep the tone encouraging and professional. Format it cleanly for an email."
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.anthropic",
      "typeVersion": 1,
      "position": [
        624,
        0
      ],
      "id": "484b02bb-521b-42c8-8508-7a274c01588b",
      "name": "Message a model",
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "rohangandhi202@g.ucla.edu",
        "subject": "Weekly Job Search Recap",
        "message": "={{ $json.emailHtml }}",
        "options": {}
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        1168,
        0
      ],
      "id": "93e81e8f-a7f9-4d06-873d-149005184f38",
      "name": "Send a message",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const rows = $input.all();\nconst data = rows.map(row => row.json);\nconst formatted = JSON.stringify(data, null, 2);\nreturn { json: { applicationData: formatted } };"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        416,
        0
      ],
      "id": "b4cb8a35-9a8c-401a-af79-16f1715a4d22",
      "name": "Code in JavaScript"
    },
    {
      "parameters": {
        "jsCode": "const markdownText = $input.item.json.content[0].text;\n\nconst html = markdownText\n  // Headers\n  .replace(/^### (.*$)/gim, '<h3>$1</h3>')\n  .replace(/^## (.*$)/gim, '<h2>$1</h2>')\n  .replace(/^# (.*$)/gim, '<h1>$1</h1>')\n  // Bold\n  .replace(/\\*\\*(.*?)\\*\\*/gim, '<strong>$1</strong>')\n  // Italic\n  .replace(/\\*(.*?)\\*/gim, '<em>$1</em>')\n  // Bullet points\n  .replace(/^- (.*$)/gim, '<li>$1</li>')\n  .replace(/(<li>.*<\\/li>)/gims, '<ul>$1</ul>')\n  // Horizontal rule\n  .replace(/^---$/gim, '<hr>')\n  // Line breaks\n  .replace(/\\n\\n/g, '</p><p>')\n  .replace(/\\n/g, '<br>');\n\nconst finalHtml = `\n<div style=\"font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; color: #333;\">\n  <p>${html}</p>\n</div>`;\n\nreturn { json: { emailHtml: finalHtml } };"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        960,
        0
      ],
      "id": "9c218b96-2ded-4648-b4e1-0e264c678cf0",
      "name": "Code in JavaScript1"
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "Code in JavaScript1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript1": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "versionId": "16d0f214-2600-4385-b946-baf01040b526",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "w3e5MBfZ3yGX8F9M",
  "tags": []
}