{
  "name": "resume-builder",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "generate-resume",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "3287b89e-19f6-4e2b-aea2-a0852ab1ae1b",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1.1,
      "position": [
        -440,
        -180
      ]
    },
    {
      "parameters": {
        "jsCode": "const body = $('Webhook').first().json.body;\nconst company_name = body.company_name;\nconst job_description = body.job_description;\n\nconst profile = {\nname: \"Your Name\",\nemail: \"your-email@example.com\",\nphone: \"+XX-XXXXXXXXXX\",\nlinkedin: \"linkedin.com/in/your-profile\",\ngithub: \"github.com/your-username\",\nportfolio: \"your-portfolio.com\",\nportfolio_2: \"your-secondary-portfolio.com\",\nlocation: \"Your City, Country\",\n\neducation: [\n{\ndegree: \"Your Degree\",\ninstitution: \"Your Institution\",\nduration: \"Start - End\",\ngpa: \"Your GPA / Result\"\n}\n],\n\nprojects: [\n{\nname: \"Project Title\",\ntech_stack: \"Tools / Methods Used\",\nproblem_solution: {\nproblem: \"Describe the problem\",\nsolution: \"Describe your solution\"\n},\nsystem_architecture: \"High-level workflow\",\nmetrics: {\nmetric: \"value\"\n},\ndescription: \"Short project description\",\nhighlights: [\n\"Key achievement\",\n\"Another highlight\"\n]\n}\n],\n\ntechnical_skills: {\nskills: []\n},\n\nsoft_skills: [],\n\ncertifications: [\n{\nname: \"Certification Title\",\nissuer: \"Issuing Organization\",\nyear: \"YYYY\"\n}\n]\n};\n\nconst prompt = 'You are a professional ATS resume writer. Create a complete tailored ATS-optimized resume as a single clean HTML file.\\n\\nCANDIDATE PROFILE:\\n' + JSON.stringify(profile, null, 2) + '\\n\\nTARGET COMPANY: ' + company_name + '\\n\\nJOB DESCRIPTION:\\n' + job_description + '\\n\\nINSTRUCTIONS:\\n1. FIXED SECTIONS - copy exactly: name, email, phone, linkedin, github, portfolio, location, education\\n2. PROFESSIONAL SUMMARY: Write 3-4 sharp sentences tailored to ' + company_name + ' and this JD.\\n3. SKILLS: Pick only relevant skills matching this JD. Group as Technical Skills and Soft Skills.\\n4. PROJECTS: Pick the most relevant projects. Rewrite bullets to emphasize JD-matching aspects. Use strong action verbs.\\n5. CERTIFICATIONS: Include only relevant certifications for this role.\\n6. ATS RULES: Single column only. No images no icons. Standard section names: Summary Skills Projects Certifications Education. JD keywords must appear naturally throughout.\\n\\nHTML CSS REQUIREMENTS:\\nFont Arial sans-serif. Body 11.5px line-height 1.6. Max-width 780px margin auto padding 40px. Name 24px bold centered. Contact line 11px centered separated by pipe symbol. Section headers 12px bold uppercase letter-spacing 1px border-bottom 1.5px solid #222 margin-top 20px. Background white text #1a1a1a. Include media print. All in one HTML file with CSS in style tag.\\n\\nOUTPUT: Return ONLY raw HTML starting with <!DOCTYPE html>. No markdown no backticks no explanation.';\n\nreturn [{ json: { prompt, company_name } }];"
      },
      "id": "3381a2f1-f31f-4f6a-9149-539afb55d6ae",
      "name": "Build Prompt",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -220,
        -180
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=add-your-own-key",
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "={{ JSON.stringify({ contents: [{ parts: [{ text: $json.prompt }] }], generationConfig: { temperature: 0.2, maxOutputTokens: 8192 } }) }}",
        "options": {}
      },
      "id": "23ac3a00-46b4-495d-9cf5-f9f0e4a28c71",
      "name": "Gemini API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        0,
        -180
      ]
    },
    {
      "parameters": {
        "jsCode": "const response = $json;\nconst company = $('Build Prompt').first().json.company_name;\n\nlet html = response.candidates[0].content.parts[0].text;\nhtml = html.replace(/^```html\\s*/i, '').replace(/^```\\s*/i, '').replace(/\\s*```$/i, '').trim();\n\nreturn [{ json: { html, company_name: company } }];"
      },
      "id": "797ad5fa-8ddd-4731-ba79-23b90b33eca6",
      "name": "Extract HTML",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        220,
        -180
      ]
    },
    {
      "parameters": {
        "respondWith": "text",
        "responseBody": "={{ $json.html }}",
        "options": {
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "text/html"
              }
            ]
          }
        }
      },
      "id": "1c408d20-2eb7-4dc4-9b68-c7a3c5859ded",
      "name": "Respond",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        440,
        -180
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Build Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Prompt": {
      "main": [
        [
          {
            "node": "Gemini API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini API": {
      "main": [
        [
          {
            "node": "Extract HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract HTML": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "57f2c955-c302-4d35-b48a-0d61432458b1",
  "id": "DNKjH3KjHPuFPPXy",
  "tags": []
}