{
  "id": "E0VVtub6VBVXdaHC",
  "name": "AI Employee Onboarding Automation",
  "tags": [],
  "nodes": [
    {
      "id": "e0fcb79d-dd4f-4e33-8c21-3748b2823597",
      "name": "Onboarding Form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        528,
        320
      ],
      "parameters": {
        "options": {},
        "formTitle": "Employee Onboarding Form",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Full Name",
              "requiredField": true
            },
            {
              "fieldType": "email",
              "fieldLabel": "Email Address",
              "requiredField": true
            },
            {
              "fieldLabel": "Role / Position",
              "requiredField": true
            },
            {
              "fieldLabel": "Department",
              "requiredField": true
            },
            {
              "fieldType": "date",
              "fieldLabel": "Start Date",
              "requiredField": true
            },
            {
              "fieldLabel": "Direct Manager Name",
              "requiredField": true
            },
            {
              "fieldType": "email",
              "fieldLabel": "Direct Manager Email",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Welcome to the team! Please fill in your details to begin the onboarding process."
      },
      "typeVersion": 2.2
    },
    {
      "id": "80bec45e-243f-4754-ae6e-284f453257ec",
      "name": "Store Form Data",
      "type": "n8n-nodes-base.code",
      "position": [
        752,
        320
      ],
      "parameters": {
        "jsCode": "const formData = $input.first().json;\nreturn [{ json: formData }];"
      },
      "typeVersion": 2
    },
    {
      "id": "1496b63a-37ca-450f-8813-a836b7430766",
      "name": "Generate AI Content",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        944,
        512
      ],
      "parameters": {
        "model": "llama-3.3-70b-versatile",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "8b79c699-2081-40b9-9956-ed90c806e004",
      "name": "Welcome Email \u2192 New Hire",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2096,
        176
      ],
      "parameters": {
        "sendTo": "={{ $('Onboarding Form').item.json['Email Address'] }}",
        "message": "={{ $json.data[0].output.welcome_email_body }}",
        "options": {
          "attachmentsUi": {
            "attachmentsBinary": [
              {},
              {
                "property": "data_1"
              }
            ]
          },
          "appendAttribution": false
        },
        "subject": "={{ $json.data[0].output.welcome_email_subject }}"
      },
      "typeVersion": 2.2
    },
    {
      "id": "a5ceee62-2eb5-4d0a-ace3-e14e2ade35f8",
      "name": "Notification Email \u2192 HR Team",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2096,
        560
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "={{ $json.data[0].output.hr_email_body }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ $json.data[0].output.hr_email_subject }}"
      },
      "typeVersion": 2.2
    },
    {
      "id": "7ebbf6a1-3fd4-40db-8d1f-d6cedf82ee0e",
      "name": "Notification Email \u2192 Manager",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2096,
        752
      ],
      "parameters": {
        "sendTo": "=ahamed.farhan2021@gmail.com",
        "message": "={{ $json.data[0].output.manager_email_body }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ $json.data[0].output.manager_email_subject }}"
      },
      "typeVersion": 2.2
    },
    {
      "id": "196252ad-c32b-4826-9b1f-47301774c832",
      "name": "System Access Request \u2192 IT Team",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2096,
        944
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "={{ $json.data[0].output.it_email_body }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ $json.data[0].output.it_email_subject }}"
      },
      "typeVersion": 2.2
    },
    {
      "id": "4a097020-37db-467b-8e4b-888f80047a62",
      "name": "Slack Intro \u2192 General Channel",
      "type": "n8n-nodes-base.slack",
      "position": [
        2096,
        1136
      ],
      "parameters": {
        "text": "={{ $json.data[0].output.slack_general_message }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GENERAL_SLACK_CHANNEL_ID",
          "cachedResultName": "general"
        },
        "otherOptions": {
          "includeLinkToWorkflow": false
        },
        "authentication": "oAuth2"
      },
      "typeVersion": 2.3
    },
    {
      "id": "65525200-6544-4043-b78c-d4ce06e79b26",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        960,
        320
      ],
      "parameters": {
        "text": "=Full Name: {{ $json['Full Name'] }}\nEmail: {{ $json['Email Address'] }}\nRole: {{ $json['Role / Position'] }}\nDepartment: {{ $json['Department'] }}\nStart Date: {{ $json['Start Date'] }}\nManager Name: {{ $json['Direct Manager Name'] }}\nManager Email: {{ $json['Direct Manager Email'] }}\nCompany name : RedsAI",
        "options": {
          "systemMessage": "# Role\n\nYou are a professional HR communications specialist working for [Company Name]. \nYour job is to generate personalized, warm and professional onboarding \ncommunications for new employees joining the company.\n\nYou will receive new employee details and must generate multiple pieces of \ncommunication simultaneously.\n\nAlways sound human. Never sound automated.\n\n---\n\n# Employee Details You Will Receive\n\n- Full Name\n- Email Address\n- Role / Position\n- Department\n- Start Date\n- Direct Manager Name\n- Direct Manager Email\n\n---\n\n# Communications You Must Generate\n\n## 1. Welcome Email (To New Hire)\n\n**Tone:** Warm. Exciting. Encouraging.\n**Purpose:** Make the new employee feel genuinely welcomed and excited about joining.\n\nMust include:\n- Personal greeting using their first name\n- Congratulate them on joining the team\n- Mention their role and department\n- Confirm their start date\n- Let them know their training materials are ready and accessible via a link that will be provided\n- Tell them what to expect on Day 1\n- Sign off from the HR Team\n\n---\n\n## 2. Manager Notification Email (To Direct Manager)\n\n**Tone:** Professional. Informative. Action oriented.\n**Purpose:** Notify the manager that their new team member is onboarded and starting soon.\n\nMust include:\n- Name of the new hire\n- Their role and department\n- Confirmed start date\n- Reminder to prepare workspace and Day 1 plan\n- Request manager to reach out to new hire before start date\n- Sign off from the HR Team\n\n---\n\n## 3. HR Team Notification Email (To HR Team)\n\n**Tone:** Professional. Concise. Factual.\n**Purpose:** Internal summary for HR records and awareness.\n\nMust include:\n- New hire full name\n- Role and department\n- Start date\n- Manager name\n- Confirmation that onboarding has been initiated automatically\n- Status: Onboarding\n- Sign off from Onboarding Automation System\n\n---\n\n## 4. IT System Access Request Email (To IT Team)\n\n**Tone:** Professional. Clear. Direct.\n**Purpose:** Request IT team to set up system access for the new employee before their start date.\n\nMust include:\n- New hire full name\n- Role and department\n- Start date\n- Request to set up the following before start date:\n  * Company email account\n  * System and software access based on role\n  * Hardware setup if required\n  * VPN and security access\n- Urgency note: Must be completed before start date\n- Sign off from HR Team\n\n---\n\n## 5. Slack General Channel Message\n\n**Tone:** Friendly. Casual. Exciting.\n**Purpose:** Introduce the new hire to the entire company on Slack.\n\nMust include:\n- Warm welcome announcement\n- New hire first name\n- Their role and department\n- Start date\n- One encouraging line welcoming them to the team\n- Relevant emojis to keep it friendly\n\n---\n\n## 6. Slack HR Team Channel Message\n\n**Tone:** Professional. Brief. Informative.\n**Purpose:** Quick internal alert for HR team on Slack.\n\nMust include:\n- New hire name\n- Role and department\n- Start date\n- Confirmation that onboarding workflow has been triggered automatically\n- Reminder to verify Google Sheets entry\n\n---\n\n# Output Rules\n\n- Return valid JSON only\n- No markdown\n- No code blocks\n- No extra text outside the JSON\n- All email bodies must be in clean HTML format\n- Keep emails concise but complete\n- Never use placeholder text like [insert name here]\n- Always use the actual employee details provided\n\n---\n\n# Output Format\n\nReturn exactly this JSON structure:\n\n{\n  \"welcome_email_subject\": \"write subject line here\",\n  \"welcome_email_body\": \"full HTML email here\",\n  \"manager_email_subject\": \"write subject line here\",\n  \"manager_email_body\": \"full HTML email here\",\n  \"hr_email_subject\": \"write subject line here\",\n  \"hr_email_body\": \"full HTML email here\",\n  \"it_email_subject\": \"write subject line here\",\n  \"it_email_body\": \"full HTML email here\",\n  \"slack_general_message\": \"slack message here\",\n  \"slack_hr_message\": \"slack HR alert here\"\n}"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "dd832fbf-9b9f-40e6-8d16-7a45b24caa85",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1120,
        496
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"welcome_email_subject\": { \"type\": \"string\" },\n    \"welcome_email_body\": { \"type\": \"string\" },\n    \"manager_email_subject\": { \"type\": \"string\" },\n    \"manager_email_body\": { \"type\": \"string\" },\n    \"hr_email_subject\": { \"type\": \"string\" },\n    \"hr_email_body\": { \"type\": \"string\" },\n    \"it_email_subject\": { \"type\": \"string\" },\n    \"it_email_body\": { \"type\": \"string\" },\n    \"slack_general_message\": { \"type\": \"string\" },\n    \"slack_hr_message\": { \"type\": \"string\" }\n  },\n  \"required\": [\"welcome_email_subject\",\"welcome_email_body\",\"manager_email_subject\",\"manager_email_body\",\"hr_email_subject\",\"hr_email_body\",\"it_email_subject\",\"it_email_body\",\"slack_general_message\",\"slack_hr_message\"]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "2c3537c8-084e-4362-9d9b-620d6e396d31",
      "name": "Download Policy",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1568,
        320
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_COMPANY_POLICY_PDF_FILE_ID"
        },
        "options": {},
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "bbb07cb4-dd5a-4158-9f22-5a52eab4a4bc",
      "name": "Download Handbook",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1328,
        320
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_EMPLOYEE_HANDBOOK_PDF_FILE_ID"
        },
        "options": {},
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "55b69c3f-d360-4dde-8b6e-fcd723fa872c",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1344,
        544
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "83f35279-b2d3-4a61-806b-aba161e3f038",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1584,
        544
      ],
      "parameters": {
        "options": {
          "includeBinaries": true
        },
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "c761bf2e-ec5d-4e1e-90f0-5d585d9d7665",
      "name": "Append row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2096,
        368
      ],
      "parameters": {
        "columns": {
          "value": {
            "Role": "={{ $('Onboarding Form').item.json['Role / Position'] }}",
            "E-mail": "={{ $('Onboarding Form').item.json['Email Address'] }}",
            "Department": "={{ $('Onboarding Form').item.json.Department }}",
            "Full Name ": "={{ $('Onboarding Form').item.json['Full Name'] }}",
            "Start Date": "={{ $('Onboarding Form').item.json['Start Date'] }}",
            "Manager name": "={{ $('Onboarding Form').item.json['Direct Manager Name'] }}"
          },
          "schema": [
            {
              "id": "Full Name ",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Full Name ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "E-mail",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "E-mail",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Role",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Role",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Department",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Department",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Start Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Start Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Manager name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Manager name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "Sheet1",
          "cachedResultUrl": "",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_ONBOARDING_SPREADSHEET_ID",
          "cachedResultUrl": "",
          "cachedResultName": "Employee Onboarding Tracker"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "981957c5-32d0-40ee-aa3f-d2f60896e079",
      "name": "HR team",
      "type": "n8n-nodes-base.slack",
      "position": [
        2096,
        1328
      ],
      "parameters": {
        "text": "={{ $json.data[1].output.slack_hr_message }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_HR_SLACK_CHANNEL_ID",
          "cachedResultName": "hr-team"
        },
        "otherOptions": {
          "includeLinkToWorkflow": false
        },
        "authentication": "oAuth2"
      },
      "typeVersion": 2.4
    },
    {
      "id": "0736df6f-c763-4932-8978-f9f895256ac3",
      "name": "Main Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        -48
      ],
      "parameters": {
        "color": 7,
        "width": 528,
        "height": 924,
        "content": "## \ud83e\uddd1\u200d\ud83d\udcbc AI Employee Onboarding Automation\n\nFully automates the new-hire onboarding experience from a single form submission \u2014 no manual follow-up required.\n\n**Perfect for:** HR teams and ops managers who want consistent, personalised onboarding communications sent instantly when a new employee joins.\n\n---\n\n## How it works\n\n1. **Onboarding Form** \u2014 New hire (or HR) submits name, email, role, department, start date, and manager details.\n2. **Store Form Data** \u2014 Form data is captured and passed to the AI agent.\n3. **AI Agent (Groq)** \u2014 Generates all personalised communications in one call: welcome email, HR/manager/IT notification emails, Slack intro message, and HR Slack alert.\n4. **Download Handbook & Policy** \u2014 Employee handbook and company policy PDFs are fetched from Google Drive.\n5. **Aggregate** \u2014 PDF attachments and AI output are merged into a single item for distribution.\n6. **Welcome Email** \u2014 Sent to the new hire with handbook and policy PDFs attached.\n7. **HR, Manager & IT emails** \u2014 Three separate notification emails dispatched simultaneously.\n8. **Slack messages** \u2014 Company-wide intro posted to #general; internal alert posted to #hr-team.\n9. **Google Sheets** \u2014 New hire record appended to the onboarding tracker.\n\n---\n\n## Setup (~15 minutes)\n\n1. **Groq API** \u2014 Add your key in the *Generate AI Content* node.\n2. **Gmail** \u2014 Connect via OAuth2 (applies to all email nodes). Update `sendTo` addresses in the HR and IT email nodes.\n3. **Slack** \u2014 Connect via OAuth2. Set your `#general` channel in *Slack Intro \u2192 General Channel* and your `#hr-team` channel in *HR team*.\n4. **Google Drive** \u2014 Connect via OAuth2. Replace `YOUR_EMPLOYEE_HANDBOOK_PDF_FILE_ID` and `YOUR_COMPANY_POLICY_PDF_FILE_ID` with your actual Drive file IDs.\n5. **Google Sheets** \u2014 Connect via OAuth2. Replace `YOUR_ONBOARDING_SPREADSHEET_ID` with your sheet ID. Ensure columns match: `Full Name | E-mail | Role | Department | Start Date | Manager name`.\n6. **Company name** \u2014 Update `RedsAI` in the *AI Agent* prompt text to your actual company name.\n7. **Activate** \u2014 Enable the workflow and share the form URL with your HR team."
      },
      "typeVersion": 1
    },
    {
      "id": "f91f02c5-8704-46d2-bc9a-d9ca199d33cd",
      "name": "Section: Form & AI",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        144
      ],
      "parameters": {
        "color": 5,
        "width": 820,
        "height": 564,
        "content": "## 1\ufe0f\u20e3 Form Submission & AI Generation\n\nThe onboarding form collects all new hire details. The AI Agent (Groq Llama 3.3 70B) generates every piece of communication in a single structured call \u2014 welcome email, HR/manager/IT notifications, and both Slack messages \u2014 enforced by the Structured Output Parser."
      },
      "typeVersion": 1
    },
    {
      "id": "84c11d9e-6116-45f4-8834-8318dc7343b5",
      "name": "Section: Documents",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        128
      ],
      "parameters": {
        "color": 3,
        "width": 612,
        "height": 580,
        "content": "## 2\ufe0f\u20e3 Document Preparation\n\nThe Employee Handbook and Company Policy PDFs are downloaded from Google Drive. Both files are merged and aggregated into a single item so they can be attached to the welcome email and passed downstream to all notification nodes."
      },
      "typeVersion": 1
    },
    {
      "id": "6001b155-77ff-4440-ab5c-974287897008",
      "name": "Section: Delivery & Logging",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1952,
        -80
      ],
      "parameters": {
        "color": 6,
        "width": 468,
        "height": 1568,
        "content": "## 3\ufe0f\u20e3 Communications & Logging\n\nAll outputs are dispatched in parallel:\n- **Welcome email** \u2192 new hire (with PDF attachments)\n- **HR notification** \u2192 HR team inbox\n- **Manager notification** \u2192 direct manager\n- **IT access request** \u2192 IT team\n- **Slack #general** \u2192 company-wide intro\n- **Slack #hr-team** \u2192 internal HR alert\n- **Google Sheets** \u2192 onboarding tracker row appended"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "d83d2615-9bb5-40a1-8f53-0b36e7401570",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Download Handbook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Welcome Email \u2192 New Hire",
            "type": "main",
            "index": 0
          },
          {
            "node": "Notification Email \u2192 HR Team",
            "type": "main",
            "index": 0
          },
          {
            "node": "Notification Email \u2192 Manager",
            "type": "main",
            "index": 0
          },
          {
            "node": "System Access Request \u2192 IT Team",
            "type": "main",
            "index": 0
          },
          {
            "node": "Slack Intro \u2192 General Channel",
            "type": "main",
            "index": 0
          },
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "HR team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Policy": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Onboarding Form": {
      "main": [
        [
          {
            "node": "Store Form Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Form Data": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Handbook": {
      "main": [
        [
          {
            "node": "Download Policy",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Generate AI Content": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}