{
  "id": "7S4ihndpWguEUgPR",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "My workflow 3",
  "tags": [],
  "nodes": [
    {
      "id": "14df0331-5d44-471e-a60b-9931f108764c",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -128,
        64
      ],
      "parameters": {
        "simple": false,
        "filters": {
          "q": "Senior Software Engineer"
        },
        "options": {
          "downloadAttachments": true,
          "dataPropertyAttachmentsPrefixName": "CV"
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "6c3f54bf-26d8-4863-b91c-d6760b54bfc4",
      "name": "Upload file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        144,
        -48
      ],
      "parameters": {
        "name": "={{ $json.from.value[0].name }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "13yu3QH6GO5Kx0HbEkwXPiceBH1yDVzTO",
          "cachedResultUrl": "https://drive.google.com/drive/folders/13yu3QH6GO5Kx0HbEkwXPiceBH1yDVzTO",
          "cachedResultName": "Software Engineer Resume"
        },
        "inputDataFieldName": "CV0"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "8b8fb671-bd8d-42cc-8a21-1a518eb8c42b",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        368,
        -48
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "436d2b81-56a7-4cca-a4f3-73fa174ef3d5",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        592,
        -48
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "659a2bfe-607c-46f4-a8c0-748f900dac7d",
      "name": "Information Extractor",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        976,
        -224
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {},
        "schemaType": "manual",
        "inputSchema": "={\n\t\"type\": \"object\",\n\t\"properties\": {\n    \t\"candidate_name\": {\n\t\t\"type\": \"string\"\n\t},\n    \"email_address\": {\n\t\t\"type\": \"string\",\n\t\t\"format\": \"email\"\n    },\n    \"contact_number\": {\n      \"type\": \"string\",\n      \"pattern\": \"^(\\\\+\\\\d{1,3}[- ]?)?\\\\d{10}$\"\n    }\n  }\n}\n"
      },
      "typeVersion": 1.2
    },
    {
      "id": "88b31b2a-4e61-485f-a472-d689b198ac9e",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        976,
        -32
      ],
      "parameters": {
        "model": "openai/gpt-oss-20b:free",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6476ff9c-5460-48d2-9dee-b7109692c87c",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        960,
        112
      ],
      "parameters": {
        "text": "=CV:\n{{ $json.text }}",
        "options": {
          "systemMessage": "=YOU ARE THE WORLD'S MOST ACCURATE AND EFFICIENT CV SUMMARIZER, KNOWN FOR PRODUCING CONCISE AND INFORMATIVE SUMMARIES THAT CAPTURE ALL ESSENTIAL DETAILS.\nYOUR TASK IS TO SUMMARIZE A PROVIDED CV INTO THREE CLEAR SECTIONS: EDUCATIONAL QUALIFICATIONS, JOBN HISTORY, AND SKILL SET. IN ADDITION, YOU MUST EVALUATE THE CANDIDATE'S SUITABILITY FOR A SPECIFIED JOB ROLE AND ASSIGN A SCORE FROM 1 TO 10 BASED ON HOW WELL THEIR QUALIFICATIONS MATCH THE ROLE.\n\nINSTRUCTIONS\n1. EXTRACT AND SUMMARIZE INFORMATION FROM THE CV:\nEDUCATIONAL QUALIFICATIONS: INCLUDE DEGREE NAMES, INSTITUTIONS, AND GRADUATION YEARS.\nJOB HISTORY: LIS JOB TITLES, COMPANIES, AND EMPLOYMENT DATES, WITH A BRIEF OVERVIEW OF KEY RESPONSIBILITIES OR ACHIEVEMENTS.\nSKILL SET: COMPLETE RELEVANT TECHNICAL, SOFT, AND INDUSTRY-SPECIFIC SKILLS.\n\n2. EVALUATE THE CANDIDATE BASED ON THE PROVIDED JOB POST:\nANALYZE RELEVANCE: Compare the candidate's education, work experience, and skill set with the provided job post.\nASSIGN A SCORE (1-10):\n1-3: Weak match (lacks key qualifications or experience).\n4-6: Moderate match (some relevant qalifications but gaps exists).\n7-8: Strong match (meets most job criteria with relevant experience).\n9-10: Excellent match (perfect fit exceeding expectations).\n\nPROVIDE A BRIEF JUSTIFICATION for the assigned score, highlighting key strengths or missing qualifications.\n\n3. OUTPUT FORMAT:\nEducational Qualifications\n\n[Degree], [Institution], [Year]\nJob History\n\n[Job Title], [Company], [Dates]: [Key responsibilities or Achievements]\nSkill Ste\n\n[Skill 1], [Skill 2], [Skill 3], [Skill 4], etc.\nCandidates Evaluation\n\nScore: [1-10]\nJustification: [Brief explanation of why the candidate received this score]\nWHAT TO DO\nDO NOT INCLUDE PERSONAL INFORMATION such as contact details or addresses.\nDO NOT OMIT RELEVANT EDUCATION, JOB, OR SKILL INFORMATION.\nDO NOT ADD YOUR OWN INTERPRETATION OR ASSUMPTIONS ABOUT THE CV CONTENT.\nDO NOT USE INFORMAL LANGUAGE OR EXCESSIVE DETAIL.\nEXAMPLE OUTPUT:\nEducational Qualifications\n\nBachelor of Science in Computer Science, University of Karachi, 2020.\nJob History\n\nSoftware Engineer, Techcorp, 2021-2025: Developed Scalable web applications and optimized database performance.\nSkill Set\n\nPython, Javascript, React, ReactNative, n8n, Zapier, AI, LLM, Team Leadership, Agile Development.\nCandidate Evaluation\n\nScore: 8/10\nJustification: The candidate has a relevant degree, strong technical skills, and 12 years of industry experience. However, lacks experience with cloud technologies mentioned in the job description.\n\nJob Post:\nWe\u2019re seeking a talented and driven Full-Stack Developer with solid experience in Next.js, SAAS Development, Supabase etc. to join our growing team. In this role, you will be instrumental in building and maintaining scalable, high-performance web applications and backend systems.\n\nKey Responsibilities:\n\u2022\tDevelop and scale web applications using Next.js.\n\u2022\tBuild backend infrastructure using Supabase (database, authentication, storage, etc.).\n\u2022\tCollaborate with cross-functional teams in a SaaS product environment.\n\u2022\tIntegrate AI tools and workflows to enhance development efficiency and innovation.\n\u2022\tWrite optimized, maintainable SQL queries and design robust data structures.\n\u2022\tAnalyze and work with existing codebases to extend features or resolve issues.\n\u2022\tEnsure system performance, stability, and security through best practices.\n\nIdeal Candidate should have:\n\u2022\t3+ years of professional development experience.\n\u2022\tA Bachelors in Computer Science, Engineering, Information Technology, or a relevant Field.\n\u2022\tStrong proficiency in Next.js and Supabase.\n\u2022\tDemonstrated experience in SaaS application development.\n\u2022\tAbility to read and work with existing codebases.\n\u2022\tGood understanding of authentication, authorization, and middleware.\n\u2022\tProficiency in SQL, database schema design, and performance tuning.\n\u2022\tActively incorporates AI tools (like Copilot, ChatGPT, etc.) into development processes.\n\u2022\tAbility to work independently and collaboratively in a fast-paced environment.\n\nWhat we Offer:\n\u2022\tCompetitive compensation\n\u2022\tOpportunity to work on innovative, AI-powered tools and services\n\u2022\tCollaborative, fast-paced, and growth-focused environment\nInterested candidates can share the Resume to baluntechsol@gmail.com with the Position mentioned in the Subject line.\n\nIf you are interested, please feel free to DM me or email your Resume to baluntechsol@gmail.com with the Position mentioned in the Subject line."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "930d6fcb-bcb5-4179-b8d2-00037be73b1a",
      "name": "OpenRouter Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        960,
        352
      ],
      "parameters": {
        "model": "openai/gpt-oss-20b:free",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ff7b1234-947b-45d8-9693-c2d9a3c82fa6",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1344,
        128
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c186b601-19ce-4a98-8097-6f9e1d0f1a9e",
              "name": "output",
              "type": "string",
              "value": "={{ $json.output }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f0274105-2a9e-490f-af57-73efb0c7d366",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        1568,
        128
      ],
      "parameters": {
        "jsCode": "// Read raw text from previous node\nconst data = items[0].json;\nconst rawText = String(\n  data.output ||\n  data.outputText ||\n  data.Output ||\n  data.summary ||\n  data.result ||\n  \"\"\n);\n\nif (!rawText) {\n  return [{\n    json: {\n      error: \"No input text found in previous node (tried output / outputText / Output / summary / result).\"\n    }\n  }];\n}\n\n// Helper: extract section\nfunction extractSection(text, sectionName) {\n  if (!text) return \"\";\n  const nameEsc = sectionName.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n  // 1) Bold markdown header: **Section Name**\n  let regex = new RegExp(`\\\\*\\\\*\\\\s*${nameEsc}\\\\s*\\\\*\\\\*[\\\\r\\\\n]+([\\\\s\\\\S]*?)(?=\\\\n\\\\*\\\\*|\\\\n---|$)`, \"i\");\n  let m = text.match(regex);\n  if (m) return m[1].trim();\n\n  // 2) Plain header line\n  regex = new RegExp(`^\\\\s*${nameEsc}\\\\s*$[\\\\r\\\\n]+([\\\\s\\\\S]*?)(?=^\\\\s*\\\\*\\\\*|\\\\n---|$)`, \"im\");\n  m = text.match(regex);\n  if (m) return m[1].trim();\n\n  // 3) Fallback: find the name anywhere\n  regex = new RegExp(nameEsc, \"i\");\n  m = text.match(regex);\n  if (m) {\n    const start = m.index + m[0].length;\n    const rest = text.slice(start);\n    const nextBoundary = rest.search(/\\n\\*\\*|\\n---/i);\n    const end = nextBoundary !== -1 ? start + nextBoundary : text.length;\n    return text.slice(start, end).trim();\n  }\n\n  return \"\";\n}\n\n// Extract score + justification\nfunction extractScoreAndJustification(block) {\n  if (!block) return [\"\", \"\"];\n  const sanitized = block.replace(/\\*/g, \"\").trim();\n\n  let score = \"\";\n  let justification = \"\";\n\n  const scoreMatch = sanitized.match(/Score\\s*[:\\-\u2013\u2014]?\\s*([0-9]{1,2}(?:\\/10)?|N\\/A|NA|n\\/a)/i);\n  if (scoreMatch) {\n    score = scoreMatch[1].trim();\n    if (/^[0-9]{1,2}$/.test(score)) {\n      const n = parseInt(score, 10);\n      if (n >= 0 && n <= 10) score = `${n}/10`;\n    }\n  }\n\n  const justMatch = sanitized.match(/Justification\\s*[:\\-\u2013\u2014]?\\s*([\\s\\S]*)/i);\n  if (justMatch) {\n    justification = justMatch[1].trim();\n  }\n\n  if (!score && sanitized) score = \"N/A\";\n  return [score, justification];\n}\n\n// Extract sections\nconst educationalQualification = extractSection(rawText, \"Educational Qualifications\");\nconst jobHistory = extractSection(rawText, \"Job History\");\nconst skillSet = extractSection(rawText, \"Skill Set\");\nconst candidateEvaluation = extractSection(rawText, \"Candidate Evaluation\");\n\n// Get score + justification\nconst [score, justification] = extractScoreAndJustification(candidateEvaluation);\n\nreturn [{\n  json: {\n    educationalQualification: educationalQualification || \"\",\n    jobHistory: jobHistory || \"\",\n    skillSet: skillSet || \"\",\n    score: score || \"\",\n    justification: justification || \"\"\n  }\n}];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "49e498a3-c87b-4d79-9a59-6947324dcb9a",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1808,
        -48
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.2
    },
    {
      "id": "607b4f93-7b37-4293-8844-fd17ded34785",
      "name": "Append row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2064,
        -208
      ],
      "parameters": {
        "columns": {
          "value": {
            "score": "={{ $json.score }}",
            "skill set": "={{ $json.skillSet }}",
            "Job History": "={{ $json.jobHistory }}",
            "Justification": "={{ $json.justification }}",
            "email_address": "={{ $json.output.email_address }}",
            "candidate_name": "={{ $json.output.candidate_name }}",
            "contact_number": "={{ $json.output.contact_number }}",
            "Educational Qualifications": "={{ $json.educationalQualification }}"
          },
          "schema": [
            {
              "id": "candidate_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "candidate_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "email_address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "contact_number",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "contact_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Educational Qualifications",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Educational Qualifications",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job History",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Job History",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "skill set",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "skill set",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "score",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Justification",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Justification",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/12pqhk8m-YOUR_AWS_SECRET_KEY_HERE#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "12pqhk8m-j2V44jKaNZwG7jKFPUpm4yCe17mHjbr6qUQ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/12pqhk8m-YOUR_AWS_SECRET_KEY_HERE?usp=drivesdk",
          "cachedResultName": "HR_Automation_Workflow"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "e9ad17fd-e688-4c34-80ce-a79dc572b794",
      "name": "Create a record",
      "type": "n8n-nodes-base.airtable",
      "position": [
        2064,
        64
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appAN9KciZeolO2PN",
          "cachedResultUrl": "https://airtable.com/appAN9KciZeolO2PN",
          "cachedResultName": "Senior_Software_Engineer_Resume"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblgro31x2ktE3aEc",
          "cachedResultUrl": "https://airtable.com/appAN9KciZeolO2PN/tblgro31x2ktE3aEc",
          "cachedResultName": "Table 1"
        },
        "columns": {
          "value": {
            "Score": "={{ $json.score }}",
            "Skill set": "={{ $json.skillSet }}",
            "Job History": "={{ $json.jobHistory }}",
            "Justification": "={{ $json.justification }}",
            "email_address": "={{ $json.output.email_address }}",
            "candidate_name": "={{ $json.output.candidate_name }}",
            "contact_number": "={{ $json.output.contact_number }}",
            "Educational Qualifications": "={{ $json.educationalQualification }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "candidate_name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "candidate_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_address",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "email_address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "contact_number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "contact_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Educational Qualifications",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Educational Qualifications",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job History",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Job History",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Skill set",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Skill set",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Score",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Justification",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Justification",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "04901267-ea47-4280-9e19-3e88c9fc7993",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -128,
        -144
      ],
      "parameters": {
        "options": {},
        "formTitle": "Senior Software Engineer"
      },
      "typeVersion": 2.3
    },
    {
      "id": "34eb4149-0501-4d6d-8dc6-f19a59385d58",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -416
      ],
      "parameters": {
        "color": 4,
        "height": 912,
        "content": "GMAIL TRIGGER:\nListen from emails or forms submissions matching the CV's received for specific job position and fetch attachments."
      },
      "typeVersion": 1
    },
    {
      "id": "22690685-9e05-4c1b-a798-bd2646e5214d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        -416
      ],
      "parameters": {
        "height": 912,
        "content": "UPLOAD THE FILE:\nIncoming attachment (CV) is uploaded to the configured Google Drive folder and named from the sender."
      },
      "typeVersion": 1
    },
    {
      "id": "73d68e7c-705c-49e0-a2af-8bea13a69091",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        -416
      ],
      "parameters": {
        "color": 3,
        "width": 192,
        "height": 912,
        "content": "DOWNLOAD THE ATTACHMENT (CV):\nThe stored file is downloaded by ID so it can be read."
      },
      "typeVersion": 1
    },
    {
      "id": "55a5c9bd-9602-4875-aae5-d4497e06b067",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        -416
      ],
      "parameters": {
        "color": 7,
        "height": 912,
        "content": "EXTRACT FROM FILE:\nExtract from File converts the CV (PDF) into plain text."
      },
      "typeVersion": 1
    },
    {
      "id": "05bd2380-4208-4f0e-95be-9f0c0c542721",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        -416
      ],
      "parameters": {
        "color": 5,
        "width": 384,
        "height": 912,
        "content": "Two parallel AI paths:\n\nQuick structured extraction: Information Extractor uses a small schema (name, email, phone) + LM helper to pull contact fields.\n\nFull CV analysis: AI Agent runs a large system prompt to summarize Education, Job History, Skills and to assign a suitability score (1\u201310)."
      },
      "typeVersion": 1
    },
    {
      "id": "fdce16c8-1138-4bb6-9925-efe4357a9f80",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        -416
      ],
      "parameters": {
        "color": 2,
        "height": 912,
        "content": "Normalize agent output: Edit Fields maps the agent response into output."
      },
      "typeVersion": 1
    },
    {
      "id": "9dd5f08c-6528-4650-b411-5e645413ce6e",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        -416
      ],
      "parameters": {
        "width": 208,
        "height": 912,
        "content": "Parse & clean: \nCode runs JS to extract the three summary sections plus score and justification from the agent text (regex-based)."
      },
      "typeVersion": 1
    },
    {
      "id": "90db96b2-a8b0-44a4-8f75-05552c5c1ee1",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        -416
      ],
      "parameters": {
        "color": 4,
        "width": 208,
        "height": 912,
        "content": "Merge datasets: \nMerge combines the schema extraction (contact info) with the AI-parsed summary/score."
      },
      "typeVersion": 1
    },
    {
      "id": "d699e192-b79d-4283-b531-59ff75313ffc",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1968,
        -416
      ],
      "parameters": {
        "color": 6,
        "width": 272,
        "height": 912,
        "content": "Store results: \nFinal record is appended to Google Sheets and inserted into Airtable for tracking, reporting, or downstream workflows."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6658e34c-6f2c-418e-84fd-271309c8fcbb",
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create a record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Information Extractor",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Information Extractor": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Information Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}