{
  "name": "Resume_parser_workflow",
  "nodes": [
    {
      "parameters": {
        "operation": "get",
        "messageId": "={{ $('Gmail Trigger1').item.json.id }}",
        "simple": false,
        "options": {
          "downloadAttachments": true
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        -660,
        100
      ],
      "id": "60f14160-38c7-4ec0-a223-3b58f422ab11",
      "name": "Gmail1",
      "webhookId": "4b28560e-aae8-47eb-9cbe-0b865937bde1",
      "credentials": {
        "gmailOAuth2": {
          "id": "YudyVrpCkxCvVT7q",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "filters": {}
      },
      "type": "n8n-nodes-base.gmailTrigger",
      "typeVersion": 1.2,
      "position": [
        -1680,
        100
      ],
      "id": "5a6080e7-59af-45f7-a29b-77b5afdf94c3",
      "name": "Gmail Trigger1",
      "credentials": {
        "gmailOAuth2": {
          "id": "YudyVrpCkxCvVT7q",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://www.docsaar.com/api/chatgpt_resume_parsing",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization"
            }
          ]
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "chatgpt_resume",
              "inputDataFieldName": "=attachment_0"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -440,
        100
      ],
      "id": "19d0bb82-b750-413c-b2bb-3a0926d96573",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=You are an email classifier that determines whether an email is resume or job application-related. Analyze the email subject and content to identify if it contains job applications, resume submissions, recruitment communications, or career-related correspondence.\n\nYour task: Read the provided email subject and content, then respond with only \"YES\" if it's a resume/job application-related email, or \"NO\" if it's not.\n\nResume/Job Application indicators include:\n- Job application submissions, resume attachments mentioned\n- Words like: resume, CV, application, position, job, career, hiring, recruitment\n- Cover letter content, job interest expressions\n- Interview requests, scheduling, follow-ups\n- References to job postings, position titles, company roles\n- Candidate introductions, qualifications, experience summaries\n- HR communications about applications\n- Job portal notifications, LinkedIn job alerts\n- Recruitment agency correspondence\n\nNOT resume/job emails:\n- General business communications\n- Marketing emails, newsletters\n- Personal messages unrelated to jobs\n- Company announcements (unless hiring-related)\n- Customer service inquiries\n- Social notifications\n- Educational content without job context\n\nInput Format\n\nEmail Subject:{{ $('Gmail Trigger1').item.json.Subject }}\n\nEmail Content:{{ $('Gmail Trigger1').item.json.snippet }}\n\nOutput Format\n\nRespond with only one word: YES or NO\n",
        "hasOutputParser": true,
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        -1460,
        100
      ],
      "id": "e00195b6-6c2f-4d39-9ac5-79970201cedf",
      "name": "Basic LLM Chain1"
    },
    {
      "parameters": {
        "schemaType": "manual"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.2,
      "position": [
        -1300,
        380
      ],
      "id": "81062b98-1402-41c0-a6b0-b923e976cb83",
      "name": "Structured Output Parser1"
    },
    {
      "parameters": {
        "modelName": "models/gemini-2.0-flash-exp",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        -1460,
        380
      ],
      "id": "2844d7e8-839b-438f-a1b8-4bdd1f6b6ddf",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "id": "Oe6fDP5JGsPbjSX0",
          "name": "Google Gemini(PaLM) Api account 2"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "52fb0f89-8545-4767-8358-4caeff05b13e",
              "leftValue": "",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -1100,
        100
      ],
      "id": "0cc39140-7fb4-4090-b608-5e6e1208ef29",
      "name": "If4"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "9b617efc-9094-40c7-98d2-f1087dc997be",
              "leftValue": "={{ $json.output }}",
              "rightValue": 200,
              "operator": {
                "type": "object",
                "operation": "notExists",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -220,
        100
      ],
      "id": "c0e8a759-0789-4ae3-84ee-6e3c6e6ae601",
      "name": "If5"
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "1nt1bjtUypj-lJi6tyGi-zKpS6Op7ukfwThT5VvOoKuo",
          "mode": "list",
          "cachedResultName": "Resume mail",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nt1bjtUypj-lJi6tyGi-zKpS6Op7ukfwThT5VvOoKuo/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nt1bjtUypj-lJi6tyGi-zKpS6Op7ukfwThT5VvOoKuo/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "PDF(Status/error)": "=Fail/ {{ $('HTTP Request').item.json.error }}",
            "Time": "={{ $('Gmail Trigger1').item.json.id }}"
          },
          "matchingColumns": [
            "Time"
          ],
          "schema": [
            {
              "id": "Email from",
              "displayName": "Email from",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Time",
              "displayName": "Time",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "PDF(Status/error)",
              "displayName": "PDF(Status/error)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "displayName": "Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone",
              "displayName": "Phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Date of birth",
              "displayName": "Date of birth",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Address",
              "displayName": "Address",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        0,
        0
      ],
      "id": "15107166-51ed-4fd4-853e-a024cc6ea19f",
      "name": "Google Sheets5",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "7SJUwpH0RHWK85Lw",
          "name": "Google Sheets account 2"
        }
      }
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "1nt1bjtUypj-lJi6tyGi-zKpS6Op7ukfwThT5VvOoKuo",
          "mode": "list",
          "cachedResultName": "Resume mail",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nt1bjtUypj-lJi6tyGi-zKpS6Op7ukfwThT5VvOoKuo/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nt1bjtUypj-lJi6tyGi-zKpS6Op7ukfwThT5VvOoKuo/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Email from": "={{ $('Gmail Trigger1').item.json.From }}",
            "PDF(Status/error)": "Success",
            "Time": "={{ $('Gmail Trigger1').item.json.id }}",
            "Name": "={{ $('HTTP Request').item.json.output.name.value }}",
            "Phone": "={{ $json.output.phone.value }}",
            "Address": "={{ $json.output.address.value }}"
          },
          "matchingColumns": [
            "Time"
          ],
          "schema": [
            {
              "id": "Email from",
              "displayName": "Email from",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Time",
              "displayName": "Time",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "PDF(Status/error)",
              "displayName": "PDF(Status/error)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "displayName": "Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone",
              "displayName": "Phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Date of birth",
              "displayName": "Date of birth",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Address",
              "displayName": "Address",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        0,
        200
      ],
      "id": "0adb5086-da24-4c8d-a3a9-706d2d7fb9b9",
      "name": "Google Sheets6",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "7SJUwpH0RHWK85Lw",
          "name": "Google Sheets account 2"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1nt1bjtUypj-lJi6tyGi-zKpS6Op7ukfwThT5VvOoKuo",
          "mode": "list",
          "cachedResultName": "Resume mail",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nt1bjtUypj-lJi6tyGi-zKpS6Op7ukfwThT5VvOoKuo/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nt1bjtUypj-lJi6tyGi-zKpS6Op7ukfwThT5VvOoKuo/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Email from": "={{ $('Gmail Trigger1').item.json.From }}",
            "Time": "={{ $('Gmail Trigger1').item.json.id }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "Email from",
              "displayName": "Email from",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Time",
              "displayName": "Time",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "PDF(Status/error)",
              "displayName": "PDF(Status/error)",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "displayName": "Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone",
              "displayName": "Phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Date of birth",
              "displayName": "Date of birth",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Address",
              "displayName": "Address",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        -880,
        100
      ],
      "id": "57ed5347-7579-4033-bdea-223fcc4f3795",
      "name": "Google Sheets7",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "7SJUwpH0RHWK85Lw",
          "name": "Google Sheets account 2"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Gmail1": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger1": {
      "main": [
        [
          {
            "node": "Basic LLM Chain1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "If5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain1": {
      "main": [
        [
          {
            "node": "If4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Basic LLM Chain1",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "If4": {
      "main": [
        [
          {
            "node": "Google Sheets7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If5": {
      "main": [
        [
          {
            "node": "Google Sheets5",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Google Sheets6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets7": {
      "main": [
        [
          {
            "node": "Gmail1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b227416d-c072-488b-a7f4-de09e7021dfc",
  "meta": {
    "instanceId": "6809f00d7bcb5a5b7a774baeadbd2f2056071b1c35d8241d6a5c361f7eb43ead"
  },
  "id": "hIydbhFyWEH306tZ",
  "tags": []
}