Send AI job application auto-replies with Gmail, OpenAI GPT-4o and SMTP

This workflow automatically replies to job applications received via email using AI. It monitors a Gmail inbox for incoming job application emails, filters relevant messages, and uses an AI agent to generate professional and personalized responses. The workflow then sends the reply back to the applicant using SMTP. Key Features: - Detects job application emails automatically - Uses AI to generate professional HR responses - Structured output parsing for reliable responses - Sends replies using your company email - Fully automated hiring response system Perfect for HR teams, startups, and recruiters who want to automate candidate communication.

17 nodesmanual trigger0 views0 copiesProductivity
GmailTriggerLmChatOpenAiAgentOutputParserStructuredEmailSend

Workflow JSON

{"id":"HApWnFS5OFYeT2mU","meta":{"instanceId":"cd85e2ca4f76efc43b2440fb23c17eaa4937a3abf54776244bd0a689d171e1bd","templateCredsSetupCompleted":true},"name":"EmailAutoReply","tags":[],"nodes":[{"id":"a5d6cb90-5aee-4269-b9f2-71e11e68d6df","name":"Gmail Trigger","type":"n8n-nodes-base.gmailTrigger","position":[-96,80],"parameters":{"simple":false,"filters":{"labelIds":["Label_2862649459238172600"]},"options":{},"pollTimes":{"item":[{"mode":"everyMinute"}]}},"credentials":{"gmailOAuth2":{"id":"4VIIUTF24mDLFogT","name":"Gmail account"}},"typeVersion":1.3},{"id":"0f62160f-d729-4f70-8a3b-783749fbf418","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[768,240],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o","cachedResultName":"gpt-4o"},"options":{},"builtInTools":{}},"credentials":{"openAiApi":{"id":"TXbRSzdqmrC69SOw","name":"OpenAi account"}},"typeVersion":1.3},{"id":"83ca0c1b-1965-4385-8ffa-6f06e01768c0","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[800,-16],"parameters":{"text":"=You are an HR assistant at Luminar Technology. Your task is to generate professional and courteous email replies to job applicants based on their application details.\n\nHere are the rules:\n\n1. Address the applicant by their name from the email subject or body.\n2. Mention the position they applied for.\n3. Thank them for applying.\n4. Keep the tone friendly, professional, and concise.\n5. Do not include sensitive internal information.\n6. Provide a closing with \"Best regards\" or \"Sincerely\" from the hiring team.\n\nUse this JSON format in your output:\n\n{\n  \"subject\": \"<email subject for reply>\",\n  \"body\": \"<email body for reply>\"\n}\n\nThe inputs you will receive:\n{\n  \"candidateEmail\": {{ $json.candidateEmail }},\n  \"companyEmail\": {{ $json.companyEmail }},\n  \"subject\": {{ $json.subject }}\n}\n\nGenerate the reply email based on this input.\nSpecial Note:Remove the name of the candidate from the subject.","options":{},"promptType":"define","hasOutputParser":true},"typeVersion":3.1},{"id":"c59224b3-79e0-46a4-9e7e-e95c6df36850","name":"Edit Fields","type":"n8n-nodes-base.set","position":[448,-16],"parameters":{"options":{},"assignments":{"assignments":[{"id":"61d9e339-0a62-42c6-8e1c-71c9d88e32b9","name":"candidateEmail","type":"string","value":"={{ $json.replyTo.text }}"},{"id":"db19c417-706a-49f5-ae61-4badce206fd8","name":"subject","type":"string","value":"={{ $json.subject }}"},{"id":"14d21a5e-0fae-4049-9420-cf3f29576ee0","name":"companyEmail","type":"string","value":"={{ $json.to.text }}"}]}},"typeVersion":3.4},{"id":"11f0387a-7249-407d-b196-ceb3f49d0b87","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[1120,240],"parameters":{"schemaType":"manual","inputSchema":"{\n  \"type\": \"object\",\n  \"properties\": {\n    \"subject\": {\n      \"type\": \"string\",\n      \"description\": \"The email subject for the reply\"\n    },\n    \"body\": {\n      \"type\": \"string\",\n      \"description\": \"The email body for the reply\"\n    }\n  },\n  \"required\": [\"subject\", \"body\"]\n}"},"typeVersion":1.3},{"id":"8d429b4d-78a3-40fa-bd8d-e04beecc5885","name":"Send an Email","type":"n8n-nodes-base.emailSend","position":[1168,-16],"webhookId":"2b2c0db8-744e-4d8a-9df0-e25e5835318f","parameters":{"text":"={{ $json.output.body }}","options":{"appendAttribution":false},"subject":"={{ $json.output.subject }}","toEmail":"={{ $('Edit Fields').item.json.candidateEmail }}","fromEmail":"={{ $('Edit Fields').item.json.companyEmail }}","emailFormat":"text"},"credentials":{"smtp":{"id":"oLfSateRBeHo7fAo","name":"SMTP account"}},"typeVersion":2.1},{"id":"37bc69a6-c64e-4a16-b599-52035522985c","name":"If","type":"n8n-nodes-base.if","position":[160,80],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"7cd82b1b-2fca-4d81-b45a-da69d1dd9a9d","operator":{"type":"boolean","operation":"true","singleValue":true},"leftValue":"={{$json.subject.toLowerCase().includes(\"job application\")}}","rightValue":""}]}},"typeVersion":2.3},{"id":"64e652f4-eabb-43ec-bb5e-b423240a66ba","name":"No Operation, do nothing","type":"n8n-nodes-base.noOp","position":[448,176],"parameters":{},"typeVersion":1},{"id":"7daa6bb4-f21f-49d0-b897-e53568fc5fcc","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-160,-976],"parameters":{"color":4,"height":1024,"content":"๐Ÿ“ฉ Gmail Trigger โ€“ Receive Job Applications\n\nThis node monitors incoming emails from Gmail.\n\nโš ๏ธ IMPORTANT SETUP (Forwarding Required):\n\nSince this workflow is designed for custom domain emails (e.g. hello@luminartechnology.com),\nyou must forward those emails to Gmail.\n\n๐Ÿ‘‰ Steps:\n1. Go to your email provider (e.g. Titan Email)\n2. Enable forwarding:\n   hello@yourdomain.com โ†’ yourgmail@gmail.com\n\nโš ๏ธ Gmail Filtering Setup (REQUIRED):\n\nForwarded emails may:\n- Skip Inbox\n- Be marked as read\n- Not trigger n8n\n\n๐Ÿ‘‰ Fix this using Gmail Filters:\n\n1. Go to Gmail โ†’ Settings โ†’ Filters โ†’ Create Filter\n2. Set:\n   To: hello@yourdomain.com\n\n3. Select:\n   โœ” Apply label โ†’ \"job-applications\"\n   โœ” Mark as UNREAD\n   โœ” Never send to spam\n   โœ” Apply to existing messages\n\n๐Ÿ‘‰ In this node:\n- Set Label = job-applications\n\nThis ensures n8n correctly detects forwarded job applications."},"typeVersion":1},{"id":"26ed7790-76b6-4599-a400-089b876b58ce","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[160,-464],"parameters":{"color":4,"width":176,"height":496,"content":"๐Ÿ” Filter Job Application Emails\n\nThis node checks if the incoming email is a job application.\n\nCondition:\n- Subject contains \"Job Application\"\n\n๐Ÿ‘‰ You can customize this to match your hiring format:\nExamples:\n- \"New Job Application\"\n- \"Application for\"\n- \"CV Submission\"\n\nOnly matching emails will continue in the workflow."},"typeVersion":1},{"id":"4eefe12a-8082-4391-8707-5c93f5a6d1b6","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[384,-576],"parameters":{"color":4,"width":208,"height":528,"content":"๐Ÿงน Prepare Email Data for AI Processing\n\nThis node extracts and prepares required fields:\n\n- candidateEmail โ†’ extracted from email data\n- subject โ†’ original email subject\n- companyEmail โ†’ your receiving email\n\n๐Ÿ‘‰ This simplifies the data before sending it to the AI Agent.\n\nโš ๏ธ Note:\nFor forwarded emails, the actual candidate email may not be in the \"From\" field.\nAI will help extract the correct email from the email body."},"typeVersion":1},{"id":"cfa624dc-c620-4afb-86c4-99521f6cd11b","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[784,-544],"parameters":{"color":4,"height":496,"content":"๐Ÿงน Prepare Email Data for AI Processing\n\nThis node extracts and prepares required fields:\n\n- candidateEmail โ†’ extracted from email data\n- subject โ†’ original email subject\n- companyEmail โ†’ your receiving email\n\n๐Ÿ‘‰ This simplifies the data before sending it to the AI Agent.\n\nโš ๏ธ Note:\nFor forwarded emails, the actual candidate email may not be in the \"From\" field.\nAI will help extract the correct email from the email body."},"typeVersion":1},{"id":"c37e284d-629b-48d3-846b-d593a72ace3a","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[736,368],"parameters":{"color":3,"height":272,"content":"๐Ÿง  OpenAI Model\n\nThis node powers the AI Agent.\n\nModel used:\n- GPT-4o (can be changed)\n\n๐Ÿ‘‰ Requires:\n- OpenAI API Key\n\nYou can switch to other models depending on cost/performance needs."},"typeVersion":1},{"id":"49c09219-5775-4b34-bbb9-b161634b5d46","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[1040,384],"parameters":{"color":3,"height":272,"content":"๐Ÿ“ฆ Structured Output \n\nThis node ensures AI returns clean JSON output.\n\nExpected format:\n{\n  \"subject\": \"...\",\n  \"body\": \"...\"\n}\n\n๐Ÿ‘‰ Why important?\n- Prevents broken responses\n- Ensures compatibility with Send Email node\n- Makes workflow stable and production-ready"},"typeVersion":1},{"id":"ffad9b90-4419-4502-b4f2-0c3cd383fba1","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[1104,-448],"parameters":{"color":4,"height":400,"content":"โœ‰๏ธ Send Auto Reply to Candidate\n\nThis node sends the AI-generated response.\n\nConfiguration:\n- Uses SMTP (e.g. Titan Email)\n- Sends from your company email\n- Sends to candidate email\n\nโš™๏ธ Requirements:\n- SMTP credentials must be configured\n- Example:\n  Host: smtp.titan.email\n  Port: 465\n  Secure: SSL\n\nโš ๏ธ Important:\n- Disable \"Append Attribution\" to remove n8n footer\n- Use HTML format for better email styling"},"typeVersion":1},{"id":"b0bed43b-da68-4599-a3b7-02746028c077","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[400,336],"parameters":{"color":3,"height":288,"content":"๐Ÿšซ No Operation (Ignore Non-Matching Emails)\n\nThis node is used when:\n- Email is NOT a job application\n\n๐Ÿ‘‰ Prevents unnecessary processing\n\nKeeps workflow clean and efficient."},"typeVersion":1},{"id":"a8c90617-0be4-409c-b64d-2f304547cfb8","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[-704,-64],"parameters":{"width":480,"height":512,"content":"๐Ÿค– AI Job Application Auto-Reply System(Company Email)\n\nThis workflow automates HR email responses using AI.\n\nFlow:\n1. Receive job applications via Gmail (forwarded from domain email)\n2. Filter relevant emails\n3. Extract data\n4. Generate AI-based reply\n5. Send response automatically\n\n๐Ÿ’ก Ideal for:\n- Startups\n- HR teams\n- Recruitment automation\n\nโš ๏ธ Setup Required:\n- Gmail forwarding + filtering\n- OpenAI API key\n- SMTP configuration"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"binaryMode":"separate","availableInMCP":false,"executionOrder":"v1"},"versionId":"f09d0172-79ce-4512-94a3-171458be52e2","connections":{"If":{"main":[[{"node":"Edit Fields","type":"main","index":0}],[{"node":"No Operation, do nothing","type":"main","index":0}]]},"AI Agent":{"main":[[{"node":"Send an Email","type":"main","index":0}]]},"Edit Fields":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Gmail Trigger":{"main":[[{"node":"If","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Structured Output Parser":{"ai_outputParser":[[{"node":"AI Agent","type":"ai_outputParser","index":0}]]}}}

How to Import This Workflow

  1. 1Copy the workflow JSON above using the Copy Workflow JSON button.
  2. 2Open your n8n instance and go to Workflows.
  3. 3Click Import from JSON and paste the copied workflow.

Don't have an n8n instance? Start your free trial at n8nautomation.cloud

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.