{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "7d319d97-0af6-4fd3-84e7-86a5a68bc6d1",
      "name": "Sticky Note22",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2752,
        -848
      ],
      "parameters": {
        "width": 476,
        "height": 740,
        "content": "## How it works\n\nThis workflow generates a complete onboarding package with 4 personalized documents: welcome letter with first-day logistics, comprehensive benefits guide, IT setup instructions with role-specific equipment, and required forms (emergency contacts + direct deposit). All documents are converted to PDF, archived to Google Drive in an employee folder, and emailed as a single package. HR gets a Slack notification when complete.\n\n## Setup steps\n\n1. **Configure webhook** - Connect from your HRIS (BambooHR/Workday) or ATS\n2. **Customize company data** - Edit branding and policies in \"Validate & Enrich Data\" node\n3. **Add HTML to PDF API** - Get key at htmlcsstoimage.com (1-5\u00a2 per document)\n4. **Connect Google Drive** - Authenticate for document archival\n5. **Connect Gmail** - Authenticate for employee delivery\n6. **Add Slack webhook** - Get URL from Slack for HR notifications\n7. **Test with sample employee data** before production use\n\n\ud83d\udca1 **Required data:** firstName, lastName, email, jobTitle, department, startDate"
      },
      "typeVersion": 1
    },
    {
      "id": "67b97226-e112-4ce6-9776-b37fed653d86",
      "name": "Webhook Trigger2",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -2016,
        32
      ],
      "parameters": {
        "path": "onboard-employee",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "id": "ba11beee-a05e-4761-8c99-1add8e68e622",
      "name": "Sticky Note23",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2064,
        -240
      ],
      "parameters": {
        "color": 7,
        "width": 408,
        "height": 520,
        "content": "## Input & Smart Processing\n\nReceives employee data from your HRIS, validates required fields, generates unique employee IDs, maps departments to office locations, detects role type (tech/sales/management) for customized equipment and training."
      },
      "typeVersion": 1
    },
    {
      "id": "08c0a4ef-0619-4d00-af8f-076748f7bd91",
      "name": "Validate & Enrich Data2",
      "type": "n8n-nodes-base.code",
      "position": [
        -1792,
        32
      ],
      "parameters": {
        "jsCode": "// Validate and enrich employee data\nconst item = $input.first().json;\n\n// Required fields\nconst requiredFields = ['firstName', 'lastName', 'email', 'jobTitle', 'department', 'startDate'];\nconst missingFields = requiredFields.filter(field => !item[field]);\n\nif (missingFields.length > 0) {\n  throw new Error(`Missing: ${missingFields.join(', ')}`);\n}\n\n// Validate email\nconst emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\nif (!emailRegex.test(item.email)) {\n  throw new Error('Invalid email format');\n}\n\n// Format dates\nconst startDate = new Date(item.startDate);\nif (isNaN(startDate.getTime())) {\n  throw new Error('Invalid start date');\n}\n\nconst formatDate = (date) => {\n  return date.toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' });\n};\n\nitem.startDateFormatted = formatDate(startDate);\nitem.currentDate = formatDate(new Date());\n\n// Generate employee ID\nif (!item.employeeId) {\n  const year = startDate.getFullYear();\n  const random = Math.floor(Math.random() * 10000).toString().padStart(4, '0');\n  item.employeeId = `EMP-${year}-${random}`;\n}\n\n// Full name\nitem.fullName = `${item.firstName} ${item.lastName}`;\n\n// Determine employment type defaults\nitem.employmentType = item.employmentType || 'Full-Time';\nitem.location = item.location || 'San Francisco, CA';\nitem.workSchedule = item.workSchedule || 'Monday-Friday, 9:00 AM - 5:00 PM';\n\n// Manager info\nitem.managerName = item.managerName || 'Department Manager';\nitem.managerEmail = item.managerEmail || `user@example.com`;\nitem.managerPhone = item.managerPhone || '+1234567890';\n\n// HR contact\nitem.hrContactName = item.hrContactName || 'HR Department';\nitem.hrContactEmail = item.hrContactEmail || 'user@example.com';\nitem.hrContactPhone = item.hrContactPhone || '+1234567890';\n\n// Salary info (if provided)\nif (item.salary) {\n  item.salary = parseFloat(item.salary);\n  item.salaryFormatted = `$${item.salary.toLocaleString('en-US')}`;\n}\n\n// Benefits eligibility\nitem.benefitsEligible = item.employmentType === 'Full-Time';\nitem.benefitsStartDate = new Date(startDate.getTime() + 30*24*60*60*1000).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' });\n\n// Role-specific categorization\nconst techRoles = ['Software Engineer', 'Developer', 'Data Scientist', 'IT Specialist', 'DevOps Engineer'];\nconst managementRoles = ['Manager', 'Director', 'VP', 'Executive'];\nconst salesRoles = ['Sales', 'Account Executive', 'Business Development'];\n\nitem.requiresITEquipment = techRoles.some(role => item.jobTitle.includes(role));\nitem.requiresManagementTraining = managementRoles.some(role => item.jobTitle.includes(role));\nitem.requiresSalesTools = salesRoles.some(role => item.jobTitle.includes(role));\n\n// Department-specific info\nconst departmentInfo = {\n  'Engineering': { floor: '3rd Floor', dressCode: 'Casual', parkingSpot: 'Garage Level 2' },\n  'Sales': { floor: '2nd Floor', dressCode: 'Business Casual', parkingSpot: 'Garage Level 1' },\n  'Marketing': { floor: '4th Floor', dressCode: 'Business Casual', parkingSpot: 'Garage Level 2' },\n  'Finance': { floor: '5th Floor', dressCode: 'Business Professional', parkingSpot: 'Garage Level 1' },\n  'HR': { floor: '1st Floor', dressCode: 'Business Casual', parkingSpot: 'Garage Level 1' },\n  'Operations': { floor: '2nd Floor', dressCode: 'Casual', parkingSpot: 'Garage Level 3' }\n};\n\nconst deptInfo = departmentInfo[item.department] || { floor: '2nd Floor', dressCode: 'Business Casual', parkingSpot: 'Visitor Parking' };\nitem.officeFloor = deptInfo.floor;\nitem.dressCode = deptInfo.dressCode;\nitem.parkingSpot = deptInfo.parkingSpot;\n\n// Company info\nitem.companyName = item.companyName || 'Media Jade';\nitem.companyAddress = item.companyAddress || '456 Company Street, San Francisco, CA 94105';\nitem.companyPhone = item.companyPhone || '+1234567890';\nitem.companyWebsite = item.companyWebsite || 'www.mediajde.com';\n\n// Document tracking\nitem.documentPackId = `PACK-${item.employeeId}-${Date.now()}`;\nitem.generatedAt = new Date().toISOString();\n\nreturn { json: item };"
      },
      "typeVersion": 2
    },
    {
      "id": "4b3b88ee-4dd7-47ca-b49f-528acfb28bc1",
      "name": "Sticky Note24",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        -288
      ],
      "parameters": {
        "color": 7,
        "width": 508,
        "height": 480,
        "content": "## PDF Processing\n\nOrganizes all 4 documents into array with numbered filenames (1_Welcome, 2_Benefits, 3_IT, 4_Forms), then batch converts to professional print-ready PDFs."
      },
      "typeVersion": 1
    },
    {
      "id": "a3670d77-adc0-4188-8a88-4b48e3b576d9",
      "name": "Generate Welcome Letter2",
      "type": "n8n-nodes-base.code",
      "position": [
        -1584,
        -64
      ],
      "parameters": {
        "jsCode": "// Generate Welcome Letter HTML\nconst item = $input.first().json;\n\nconst html = `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <style>\n        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');\n        * { margin: 0; padding: 0; box-sizing: border-box; }\n        body { font-family: 'Inter', sans-serif; line-height: 1.7; color: #1f2937; padding: 60px 80px; }\n        .header { text-align: center; margin-bottom: 50px; padding-bottom: 30px; border-bottom: 3px solid #3b82f6; }\n        .company-name { color: #3b82f6; font-size: 32px; font-weight: 700; margin-bottom: 10px; }\n        .doc-title { color: #1e40af; font-size: 24px; font-weight: 600; margin-top: 20px; }\n        .content { font-size: 15px; color: #374151; }\n        .content p { margin-bottom: 20px; }\n        .highlight-box { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); padding: 25px; border-radius: 10px; border-left: 5px solid #3b82f6; margin: 30px 0; }\n        .highlight-box h3 { color: #1e40af; font-size: 18px; margin-bottom: 15px; }\n        .info-table { width: 100%; margin: 20px 0; }\n        .info-table td { padding: 10px; font-size: 15px; }\n        .info-table td:first-child { font-weight: 600; color: #1e40af; width: 180px; }\n        .signature-section { margin-top: 60px; padding-top: 30px; border-top: 2px solid #e5e7eb; }\n        .footer { margin-top: 50px; padding-top: 20px; border-top: 2px solid #e5e7eb; text-align: center; font-size: 13px; color: #6b7280; }\n    </style>\n</head>\n<body>\n    <div class=\"header\">\n        <div class=\"company-name\">${item.companyName}</div>\n        <p style=\"color: #6b7280; font-size: 14px;\">${item.companyAddress}</p>\n        <p style=\"color: #6b7280; font-size: 14px;\">${item.companyPhone} | ${item.companyWebsite}</p>\n        <h1 class=\"doc-title\">Welcome to ${item.companyName}!</h1>\n    </div>\n\n    <div class=\"content\">\n        <p style=\"font-size: 16px;\"><strong>${item.currentDate}</strong></p>\n        \n        <p>Dear ${item.fullName},</p>\n        \n        <p>On behalf of everyone at ${item.companyName}, I am thrilled to welcome you to our team! We are excited to have you join us as <strong>${item.jobTitle}</strong> in our ${item.department} department.</p>\n        \n        <p>Your skills, experience, and enthusiasm impressed us throughout the hiring process, and we are confident that you will make significant contributions to our organization's success.</p>\n        \n        <div class=\"highlight-box\">\n            <h3>\ud83d\udcc5 Your First Day Details</h3>\n            <table class=\"info-table\">\n                <tr>\n                    <td>Start Date:</td>\n                    <td><strong>${item.startDateFormatted}</strong></td>\n                </tr>\n                <tr>\n                    <td>Reporting Time:</td>\n                    <td><strong>9:00 AM</strong></td>\n                </tr>\n                <tr>\n                    <td>Location:</td>\n                    <td><strong>${item.location}</strong></td>\n                </tr>\n                <tr>\n                    <td>Office:</td>\n                    <td><strong>${item.officeFloor}, Reception Area</strong></td>\n                </tr>\n                <tr>\n                    <td>Dress Code:</td>\n                    <td><strong>${item.dressCode}</strong></td>\n                </tr>\n                <tr>\n                    <td>Parking:</td>\n                    <td><strong>${item.parkingSpot}</strong></td>\n                </tr>\n            </table>\n        </div>\n        \n        <p><strong>What to Bring on Your First Day:</strong></p>\n        <ul style=\"margin-left: 30px; margin-bottom: 20px;\">\n            <li>Valid government-issued photo ID (driver's license or passport)</li>\n            <li>Social Security card or proof of eligibility to work</li>\n            <li>Completed new hire documents (included in this package)</li>\n            <li>Direct deposit information (bank routing and account numbers)</li>\n            <li>Emergency contact information</li>\n        </ul>\n        \n        <div class=\"highlight-box\">\n            <h3>\ud83d\udc64 Your Manager and Team</h3>\n            <table class=\"info-table\">\n                <tr>\n                    <td>Direct Manager:</td>\n                    <td><strong>${item.managerName}</strong></td>\n                </tr>\n                <tr>\n                    <td>Manager Email:</td>\n                    <td>${item.managerEmail}</td>\n                </tr>\n                <tr>\n                    <td>Manager Phone:</td>\n                    <td>${item.managerPhone}</td>\n                </tr>\n                <tr>\n                    <td>Department:</td>\n                    <td><strong>${item.department}</strong></td>\n                </tr>\n                <tr>\n                    <td>Work Schedule:</td>\n                    <td>${item.workSchedule}</td>\n                </tr>\n            </table>\n        </div>\n        \n        <p><strong>Your First Week:</strong></p>\n        <p>During your first week, you will participate in our comprehensive onboarding program, which includes:</p>\n        <ul style=\"margin-left: 30px; margin-bottom: 20px;\">\n            <li>Company orientation and culture overview</li>\n            <li>IT setup and equipment allocation</li>\n            <li>Benefits enrollment session</li>\n            <li>Department introduction and team meetings</li>\n            <li>Workspace setup and facility tour</li>\n            <li>One-on-one meetings with key stakeholders</li>\n            ${item.requiresManagementTraining ? '<li>Management training and leadership orientation</li>' : ''}\n            ${item.requiresSalesTools ? '<li>Sales tools training and CRM setup</li>' : ''}\n        </ul>\n        \n        ${item.benefitsEligible ? `\n        <div class=\"highlight-box\">\n            <h3>\ud83c\udfe5 Benefits Information</h3>\n            <p>As a ${item.employmentType} employee, you are eligible for our comprehensive benefits package starting on <strong>${item.benefitsStartDate}</strong>. You will receive detailed information about:</p>\n            <ul style=\"margin-left: 30px; margin-top: 15px;\">\n                <li>Health, dental, and vision insurance</li>\n                <li>401(k) retirement plan with company match</li>\n                <li>Paid time off (PTO) and holidays</li>\n                <li>Life and disability insurance</li>\n                <li>Professional development opportunities</li>\n                <li>Employee wellness programs</li>\n            </ul>\n        </div>\n        ` : ''}\n        \n        <p><strong>Questions Before Your Start Date?</strong></p>\n        <p>If you have any questions or need assistance before your first day, please don't hesitate to contact our HR department:</p>\n        <p style=\"margin-left: 20px;\">\n            <strong>${item.hrContactName}</strong><br>\n            Email: ${item.hrContactEmail}<br>\n            Phone: ${item.hrContactPhone}\n        </p>\n        \n        <p>We look forward to seeing you on ${item.startDateFormatted} and watching you grow with ${item.companyName}. Welcome aboard!</p>\n        \n        <div class=\"signature-section\">\n            <p><strong>Warm regards,</strong></p>\n            <p style=\"margin-top: 20px;\">\n                <strong>${item.hrContactName}</strong><br>\n                Human Resources Department<br>\n                ${item.companyName}\n            </p>\n        </div>\n    </div>\n    \n    <div class=\"footer\">\n        <p><strong>${item.companyName}</strong> | ${item.companyAddress}</p>\n        <p>This letter is confidential and intended solely for ${item.fullName}</p>\n    </div>\n</body>\n</html>\n`;\n\nreturn { json: { ...item, welcomeLetterHtml: html } };"
      },
      "typeVersion": 2
    },
    {
      "id": "d3a7caa0-780e-43d7-a594-640df1c28e26",
      "name": "Generate Benefits Guide2",
      "type": "n8n-nodes-base.code",
      "position": [
        -1584,
        144
      ],
      "parameters": {
        "jsCode": "// Generate Benefits Enrollment Guide HTML\nconst item = $input.first().json;\n\nconst html = `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <style>\n        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');\n        * { margin: 0; padding: 0; box-sizing: border-box; }\n        body { font-family: 'Inter', sans-serif; line-height: 1.7; color: #1f2937; padding: 60px 80px; }\n        .header { text-align: center; margin-bottom: 40px; padding-bottom: 25px; border-bottom: 3px solid #10b981; }\n        .company-name { color: #10b981; font-size: 28px; font-weight: 700; }\n        .doc-title { color: #065f46; font-size: 22px; font-weight: 600; margin-top: 15px; }\n        .section { margin-bottom: 35px; }\n        .section h2 { color: #065f46; font-size: 20px; font-weight: 700; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #d1fae5; }\n        .benefit-card { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); padding: 20px; border-radius: 10px; margin-bottom: 20px; border-left: 5px solid #10b981; }\n        .benefit-card h3 { color: #065f46; font-size: 18px; margin-bottom: 12px; }\n        .benefit-card ul { margin-left: 25px; color: #047857; }\n        .benefit-card li { margin-bottom: 8px; }\n        .important-box { background: #fef3c7; padding: 20px; border-radius: 8px; border-left: 5px solid #f59e0b; margin: 25px 0; }\n        .important-box h3 { color: #92400e; font-size: 16px; margin-bottom: 10px; }\n        .footer { margin-top: 40px; padding-top: 20px; border-top: 2px solid #e5e7eb; text-align: center; font-size: 13px; color: #6b7280; }\n    </style>\n</head>\n<body>\n    <div class=\"header\">\n        <div class=\"company-name\">${item.companyName}</div>\n        <h1 class=\"doc-title\">Benefits Enrollment Guide</h1>\n        <p style=\"color: #6b7280; margin-top: 10px;\">Employee: ${item.fullName} | ID: ${item.employeeId}</p>\n    </div>\n\n    <div class=\"important-box\">\n        <h3>\u26a0\ufe0f Important Enrollment Information</h3>\n        <p><strong>Enrollment Deadline:</strong> You must complete your benefits enrollment within <strong>30 days</strong> of your start date.</p>\n        <p style=\"margin-top: 10px;\"><strong>Coverage Effective Date:</strong> ${item.benefitsStartDate}</p>\n        <p style=\"margin-top: 10px;\"><strong>Enrollment Portal:</strong> benefits.${item.companyWebsite}/enroll</p>\n    </div>\n\n    <div class=\"section\">\n        <h2>\ud83c\udfe5 Health Insurance</h2>\n        <div class=\"benefit-card\">\n            <h3>Medical Coverage Options</h3>\n            <ul>\n                <li><strong>PPO Plan:</strong> Comprehensive coverage with network and out-of-network options. Premium: $150/month (employee), $400/month (family)</li>\n                <li><strong>HMO Plan:</strong> Lower cost option with network providers. Premium: $80/month (employee), $250/month (family)</li>\n                <li><strong>HDHP with HSA:</strong> High deductible plan with Health Savings Account. Premium: $50/month (employee), $180/month (family)</li>\n            </ul>\n            <p style=\"margin-top: 12px; color: #047857;\"><strong>Company Contribution:</strong> ${item.companyName} covers 80% of employee premiums and 60% of dependent premiums.</p>\n        </div>\n        \n        <div class=\"benefit-card\">\n            <h3>Dental Coverage</h3>\n            <ul>\n                <li>Preventive care covered at 100%</li>\n                <li>Basic procedures covered at 80%</li>\n                <li>Major procedures covered at 50%</li>\n                <li>Premium: $25/month (employee), $60/month (family)</li>\n            </ul>\n        </div>\n        \n        <div class=\"benefit-card\">\n            <h3>Vision Coverage</h3>\n            <ul>\n                <li>Annual eye exam covered at 100%</li>\n                <li>$150 allowance for frames or contacts</li>\n                <li>Premium: $10/month (employee), $25/month (family)</li>\n            </ul>\n        </div>\n    </div>\n\n    <div class=\"section\">\n        <h2>\ud83d\udcb0 Retirement Benefits</h2>\n        <div class=\"benefit-card\">\n            <h3>401(k) Retirement Plan</h3>\n            <ul>\n                <li><strong>Eligibility:</strong> Immediate enrollment upon hire</li>\n                <li><strong>Company Match:</strong> 100% match on first 3% of salary, 50% match on next 2%</li>\n                <li><strong>Maximum Match:</strong> 4% of annual salary</li>\n                <li><strong>Vesting Schedule:</strong> Immediate vesting for employee contributions, 3-year cliff vesting for company match</li>\n                <li><strong>Investment Options:</strong> 20+ mutual funds, target-date funds, and self-directed brokerage</li>\n            </ul>\n        </div>\n    </div>\n\n    <div class=\"section\">\n        <h2>\ud83c\udfd6\ufe0f Time Off Benefits</h2>\n        <div class=\"benefit-card\">\n            <h3>Paid Time Off (PTO)</h3>\n            <ul>\n                <li><strong>Vacation Days:</strong> 15 days per year (pro-rated first year)</li>\n                <li><strong>Sick Days:</strong> 10 days per year</li>\n                <li><strong>Personal Days:</strong> 3 days per year</li>\n                <li><strong>Paid Holidays:</strong> 11 federal holidays</li>\n                <li><strong>Accrual:</strong> PTO accrues bi-weekly starting from your first day</li>\n            </ul>\n        </div>\n    </div>\n\n    <div class=\"section\">\n        <h2>\ud83d\udee1\ufe0f Insurance Benefits</h2>\n        <div class=\"benefit-card\">\n            <h3>Life Insurance</h3>\n            <ul>\n                <li><strong>Basic Life:</strong> 1x annual salary provided at no cost</li>\n                <li><strong>Supplemental Life:</strong> Available up to 5x annual salary (employee pays premium)</li>\n                <li><strong>Dependent Life:</strong> Optional coverage for spouse and children</li>\n            </ul>\n        </div>\n        \n        <div class=\"benefit-card\">\n            <h3>Disability Insurance</h3>\n            <ul>\n                <li><strong>Short-Term Disability:</strong> 60% of salary for up to 90 days (company paid)</li>\n                <li><strong>Long-Term Disability:</strong> 60% of salary after 90 days (company paid)</li>\n                <li><strong>Supplemental LTD:</strong> Available to increase coverage to 70% of salary</li>\n            </ul>\n        </div>\n    </div>\n\n    <div class=\"section\">\n        <h2>\ud83d\udcda Additional Benefits</h2>\n        <div class=\"benefit-card\">\n            <h3>Professional Development</h3>\n            <ul>\n                <li>$2,000 annual budget for training and conferences</li>\n                <li>Tuition reimbursement up to $5,000 per year for approved programs</li>\n                <li>LinkedIn Learning access for all employees</li>\n                <li>Internal mentorship and coaching programs</li>\n            </ul>\n        </div>\n        \n        <div class=\"benefit-card\">\n            <h3>Wellness Programs</h3>\n            <ul>\n                <li>Gym membership reimbursement up to $50/month</li>\n                <li>Employee Assistance Program (EAP) for confidential counseling</li>\n                <li>Annual wellness screenings at no cost</li>\n                <li>Healthy snacks and beverages in break rooms</li>\n            </ul>\n        </div>\n        \n        <div class=\"benefit-card\">\n            <h3>Work-Life Balance</h3>\n            <ul>\n                <li>Flexible work arrangements (hybrid schedule available)</li>\n                <li>Remote work equipment allowance</li>\n                <li>Commuter benefits and transit subsidies</li>\n                <li>Employee discount programs</li>\n            </ul>\n        </div>\n    </div>\n\n    <div class=\"important-box\">\n        <h3>\ud83d\udccb Next Steps for Enrollment</h3>\n        <ol style=\"margin-left: 25px; color: #78350f;\">\n            <li style=\"margin-bottom: 8px;\">Review all benefit options carefully</li>\n            <li style=\"margin-bottom: 8px;\">Log into the benefits portal at benefits.${item.companyWebsite}/enroll</li>\n            <li style=\"margin-bottom: 8px;\">Use your employee ID (${item.employeeId}) and temporary password sent separately</li>\n            <li style=\"margin-bottom: 8px;\">Complete enrollment by selecting your coverage options</li>\n            <li style=\"margin-bottom: 8px;\">Designate beneficiaries for life insurance and 401(k)</li>\n            <li style=\"margin-bottom: 8px;\">Submit enrollment before deadline: ${item.benefitsStartDate}</li>\n        </ol>\n        <p style=\"margin-top: 15px; color: #78350f;\"><strong>Questions?</strong> Contact HR at ${item.hrContactEmail} or ${item.hrContactPhone}</p>\n    </div>\n\n    <div class=\"footer\">\n        <p><strong>${item.companyName} Benefits Department</strong></p>\n        <p>This guide provides a summary of benefits. Refer to official plan documents for complete details.</p>\n    </div>\n</body>\n</html>\n`;\n\nreturn { json: { ...item, benefitsGuideHtml: html } };"
      },
      "typeVersion": 2
    },
    {
      "id": "def685f9-c356-41bc-8822-5d2942c3b0e9",
      "name": "Sticky Note25",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        -336
      ],
      "parameters": {
        "color": 7,
        "width": 620,
        "height": 560,
        "content": "## Storage & Delivery\n\nArchives all 4 PDFs to Google Drive in employee folder for compliance, aggregates them, then sends complete package via email with action items checklist and first-day summary."
      },
      "typeVersion": 1
    },
    {
      "id": "226a2eab-8e84-485a-9a7b-4544c62d8196",
      "name": "Generate IT Setup Guide2",
      "type": "n8n-nodes-base.code",
      "position": [
        -1360,
        -64
      ],
      "parameters": {
        "jsCode": "// Generate IT Setup Instructions HTML\nconst item = $input.first().json;\n\nconst html = `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <style>\n        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');\n        * { margin: 0; padding: 0; box-sizing: border-box; }\n        body { font-family: 'Inter', sans-serif; line-height: 1.7; color: #1f2937; padding: 60px 80px; }\n        .header { text-align: center; margin-bottom: 40px; padding-bottom: 25px; border-bottom: 3px solid #8b5cf6; }\n        .doc-title { color: #6b21a8; font-size: 22px; font-weight: 600; margin-top: 15px; }\n        .section { margin-bottom: 35px; }\n        .section h2 { color: #6b21a8; font-size: 20px; font-weight: 700; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #e9d5ff; }\n        .equipment-card { background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%); padding: 20px; border-radius: 10px; margin-bottom: 20px; border-left: 5px solid #8b5cf6; }\n        .equipment-card h3 { color: #6b21a8; font-size: 18px; margin-bottom: 12px; }\n        .step-box { background: #f8fafc; padding: 18px; border-radius: 8px; margin-bottom: 15px; border-left: 3px solid #8b5cf6; }\n        .step-box h4 { color: #6b21a8; font-size: 16px; margin-bottom: 10px; }\n        .credential-box { background: #fef3c7; padding: 20px; border-radius: 8px; border: 2px dashed #f59e0b; margin: 25px 0; text-align: center; }\n        .footer { margin-top: 40px; padding-top: 20px; border-top: 2px solid #e5e7eb; text-align: center; font-size: 13px; color: #6b7280; }\n    </style>\n</head>\n<body>\n    <div class=\"header\">\n        <div class=\"company-name\" style=\"color: #8b5cf6; font-size: 28px; font-weight: 700;\">${item.companyName}</div>\n        <h1 class=\"doc-title\">IT Setup & Access Instructions</h1>\n        <p style=\"color: #6b7280; margin-top: 10px;\">Employee: ${item.fullName} | ID: ${item.employeeId}</p>\n    </div>\n\n    <div class=\"section\">\n        <h2>\ud83d\udcbb Equipment Allocation</h2>\n        <div class=\"equipment-card\">\n            <h3>Your IT Equipment Package</h3>\n            <p style=\"margin-bottom: 15px;\">The following equipment will be ready for you on your first day:</p>\n            <ul style=\"margin-left: 25px; color: #6b21a8;\">\n                ${item.requiresITEquipment ? `\n                <li><strong>Laptop:</strong> MacBook Pro 16\" or Dell XPS 15 (your choice)</li>\n                <li><strong>External Monitor:</strong> 27\" 4K display</li>\n                <li><strong>Keyboard & Mouse:</strong> Wireless keyboard and ergonomic mouse</li>\n                <li><strong>Headset:</strong> Noise-cancelling headset for calls</li>\n                <li><strong>Laptop Stand:</strong> Adjustable ergonomic stand</li>\n                <li><strong>Docking Station:</strong> USB-C hub with multiple ports</li>\n                ` : `\n                <li><strong>Laptop:</strong> Standard business laptop (Dell Latitude)</li>\n                <li><strong>Monitor:</strong> 24\" display</li>\n                <li><strong>Keyboard & Mouse:</strong> Standard wireless set</li>\n                `}\n                <li><strong>Phone:</strong> Desk phone with voicemail setup</li>\n                <li><strong>Cables & Adapters:</strong> All necessary connectivity items</li>\n            </ul>\n            <p style=\"margin-top: 15px; color: #7c3aed;\"><strong>Equipment Pick-up:</strong> Report to IT Help Desk on ${item.officeFloor} at 9:00 AM on your first day.</p>\n        </div>\n    </div>\n\n    <div class=\"credential-box\">\n        <h3 style=\"color: #92400e; font-size: 18px; margin-bottom: 15px;\">\ud83d\udd10 Your Login Credentials</h3>\n        <p style=\"color: #78350f; font-size: 16px; margin-bottom: 10px;\"><strong>Username:</strong> ${item.firstName.toLowerCase()}.${item.lastName.toLowerCase()}@${item.companyWebsite.replace('www.', '')}</p>\n        <p style=\"color: #78350f; font-size: 16px;\"><strong>Temporary Password:</strong> Will be provided by IT on your first day</p>\n        <p style=\"color: #78350f; font-size: 13px; margin-top: 15px;\">\u26a0\ufe0f You will be required to change your password during first login</p>\n    </div>\n\n    <div class=\"section\">\n        <h2>\ud83d\udd27 First Day IT Setup Steps</h2>\n        \n        <div class=\"step-box\">\n            <h4>Step 1: Computer Setup & Login</h4>\n            <p>IT technician will help you:</p>\n            <ul style=\"margin-left: 25px; margin-top: 10px;\">\n                <li>Power on and configure your laptop</li>\n                <li>Connect to company network</li>\n                <li>Log in with temporary credentials and create new password</li>\n                <li>Set up multi-factor authentication (MFA)</li>\n            </ul>\n        </div>\n        \n        <div class=\"step-box\">\n            <h4>Step 2: Email & Calendar Access</h4>\n            <p>Configure your email and calendar:</p>\n            <ul style=\"margin-left: 25px; margin-top: 10px;\">\n                <li>Access Outlook/Gmail at mail.${item.companyWebsite}</li>\n                <li>Set up email signature with your contact information</li>\n                <li>Configure calendar settings and time zone</li>\n                <li>Subscribe to department calendars</li>\n            </ul>\n        </div>\n        \n        <div class=\"step-box\">\n            <h4>Step 3: Essential Software Installation</h4>\n            <p>IT will install or provide access to:</p>\n            <ul style=\"margin-left: 25px; margin-top: 10px;\">\n                <li><strong>Microsoft Office 365:</strong> Word, Excel, PowerPoint, Teams</li>\n                <li><strong>Slack:</strong> Team communication platform</li>\n                <li><strong>Zoom:</strong> Video conferencing software</li>\n                <li><strong>VPN Client:</strong> For secure remote access</li>\n                ${item.requiresITEquipment ? `\n                <li><strong>Development Tools:</strong> IDEs, Git, Docker, etc.</li>\n                <li><strong>Database Access:</strong> Production and staging environments</li>\n                ` : ''}\n                ${item.requiresSalesTools ? `\n                <li><strong>Salesforce CRM:</strong> Customer relationship management</li>\n                <li><strong>LinkedIn Sales Navigator:</strong> Prospecting tool</li>\n                ` : ''}\n                <li><strong>Password Manager:</strong> Company-approved password vault</li>\n            </ul>\n        </div>\n        \n        <div class=\"step-box\">\n            <h4>Step 4: Network & Access Setup</h4>\n            <p>Configure network and system access:</p>\n            <ul style=\"margin-left: 25px; margin-top: 10px;\">\n                <li>Connect to WiFi network: <strong>${item.companyName}-Corporate</strong></li>\n                <li>Set up VPN for remote work access</li>\n                <li>Configure printer connections for ${item.officeFloor}</li>\n                <li>Access shared drives and department folders</li>\n                <li>Set up phone extension and voicemail (Ext: TBD by IT)</li>\n            </ul>\n        </div>\n        \n        <div class=\"step-box\">\n            <h4>Step 5: Security & Compliance</h4>\n            <p>Complete mandatory security setup:</p>\n            <ul style=\"margin-left: 25px; margin-top: 10px;\">\n                <li>Enable multi-factor authentication (MFA) on all accounts</li>\n                <li>Review and acknowledge IT security policies</li>\n                <li>Complete cybersecurity awareness training (online module)</li>\n                <li>Configure device encryption and screen lock</li>\n                <li>Install antivirus and endpoint protection software</li>\n            </ul>\n        </div>\n    </div>\n\n    <div class=\"section\">\n        <h2>\ud83d\udd17 Important System Links</h2>\n        <div class=\"equipment-card\">\n            <table style=\"width: 100%;\">\n                <tr>\n                    <td style=\"padding: 10px; font-weight: 600; width: 200px;\">Employee Portal:</td>\n                    <td style=\"padding: 10px;\">portal.${item.companyWebsite}</td>\n                </tr>\n                <tr>\n                    <td style=\"padding: 10px; font-weight: 600;\">Email Access:</td>\n                    <td style=\"padding: 10px;\">mail.${item.companyWebsite}</td>\n                </tr>\n                <tr>\n                    <td style=\"padding: 10px; font-weight: 600;\">IT Help Desk:</td>\n                    <td style=\"padding: 10px;\">helpdesk.${item.companyWebsite} or ext. 4357 (HELP)</td>\n                </tr>\n                <tr>\n                    <td style=\"padding: 10px; font-weight: 600;\">VPN Portal:</td>\n                    <td style=\"padding: 10px;\">vpn.${item.companyWebsite}</td>\n                </tr>\n                <tr>\n                    <td style=\"padding: 10px; font-weight: 600;\">Password Reset:</td>\n                    <td style=\"padding: 10px;\">password.${item.companyWebsite}</td>\n                </tr>\n                <tr>\n                    <td style=\"padding: 10px; font-weight: 600;\">Learning Portal:</td>\n                    <td style=\"padding: 10px;\">training.${item.companyWebsite}</td>\n                </tr>\n            </table>\n        </div>\n    </div>\n\n    <div class=\"section\">\n        <h2>\ud83d\udcde IT Support Contacts</h2>\n        <div class=\"equipment-card\">\n            <p><strong>IT Help Desk:</strong> Available Monday-Friday, 7:00 AM - 7:00 PM</p>\n            <p style=\"margin-top: 10px;\"><strong>Phone:</strong> +1234567890 (HELP)</p>\n            <p><strong>Email:</strong> ithelpdesk@${item.companyWebsite.replace('www.', '')}</p>\n            <p><strong>Slack Channel:</strong> #it-support</p>\n            <p style=\"margin-top: 15px; color: #7c3aed;\"><strong>Emergency After-Hours:</strong> +1234567890 (Critical issues only)</p>\n        </div>\n    </div>\n\n    <div class=\"section\">\n        <h2>\u26a0\ufe0f Important IT Policies</h2>\n        <ul style=\"margin-left: 25px; color: #374151;\">\n            <li style=\"margin-bottom: 8px;\">All company equipment remains property of ${item.companyName}</li>\n            <li style=\"margin-bottom: 8px;\">Never share passwords or login credentials with anyone</li>\n            <li style=\"margin-bottom: 8px;\">Report suspicious emails or security incidents immediately</li>\n            <li style=\"margin-bottom: 8px;\">Use VPN when accessing company systems remotely</li>\n            <li style=\"margin-bottom: 8px;\">Keep software and security patches up to date</li>\n            <li style=\"margin-bottom: 8px;\">Lock your computer when away from your desk</li>\n            <li style=\"margin-bottom: 8px;\">Do not install unauthorized software without IT approval</li>\n        </ul>\n    </div>\n\n    <div class=\"footer\">\n        <p><strong>${item.companyName} IT Department</strong></p>\n        <p>For technical assistance, contact IT Help Desk | ithelpdesk@${item.companyWebsite.replace('www.', '')}</p>\n    </div>\n</body>\n</html>\n`;\n\nreturn { json: { ...item, itSetupHtml: html } };"
      },
      "typeVersion": 2
    },
    {
      "id": "fa808c15-970b-4570-82a0-6cda86d3e702",
      "name": "Generate Forms2",
      "type": "n8n-nodes-base.code",
      "position": [
        -1360,
        144
      ],
      "parameters": {
        "jsCode": "// Generate Emergency Contact & Direct Deposit Forms HTML\nconst item = $input.first().json;\n\nconst html = `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <style>\n        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');\n        * { margin: 0; padding: 0; box-sizing: border-box; }\n        body { font-family: 'Inter', sans-serif; line-height: 1.7; color: #1f2937; padding: 60px 80px; }\n        .header { text-align: center; margin-bottom: 40px; padding-bottom: 25px; border-bottom: 3px solid #ef4444; }\n        .doc-title { color: #991b1b; font-size: 22px; font-weight: 600; margin-top: 15px; }\n        .section { margin-bottom: 40px; page-break-inside: avoid; }\n        .section h2 { color: #991b1b; font-size: 20px; font-weight: 700; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #fecaca; }\n        .form-table { width: 100%; border-collapse: collapse; margin-bottom: 25px; }\n        .form-table td { padding: 15px; border: 2px solid #e5e7eb; }\n        .form-table td:first-child { background: #f9fafb; font-weight: 600; width: 200px; }\n        .signature-line { border-bottom: 2px solid #1f2937; width: 300px; display: inline-block; margin: 0 10px; }\n        .checkbox { display: inline-block; width: 20px; height: 20px; border: 2px solid #1f2937; margin-right: 10px; vertical-align: middle; }\n        .info-box { background: #fef3c7; padding: 20px; border-radius: 8px; border-left: 5px solid #f59e0b; margin: 20px 0; }\n        .footer { margin-top: 50px; padding-top: 20px; border-top: 2px solid #e5e7eb; font-size: 12px; color: #6b7280; }\n    </style>\n</head>\n<body>\n    <div class=\"header\">\n        <div style=\"color: #ef4444; font-size: 28px; font-weight: 700;\">${item.companyName}</div>\n        <h1 class=\"doc-title\">Emergency Contact & Direct Deposit Authorization</h1>\n        <p style=\"color: #6b7280; margin-top: 10px;\">Employee: ${item.fullName} | ID: ${item.employeeId}</p>\n    </div>\n\n    <div class=\"section\">\n        <h2>\ud83d\udea8 Emergency Contact Information</h2>\n        <p style=\"margin-bottom: 20px;\">Please provide contact information for individuals to be notified in case of an emergency. List at least two emergency contacts.</p>\n        \n        <h3 style=\"color: #991b1b; font-size: 18px; margin: 25px 0 15px 0;\">Primary Emergency Contact</h3>\n        <table class=\"form-table\">\n            <tr>\n                <td>Full Name:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Relationship:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Primary Phone:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Secondary Phone:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Email Address:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Home Address:</td>\n                <td>&nbsp;</td>\n            </tr>\n        </table>\n        \n        <h3 style=\"color: #991b1b; font-size: 18px; margin: 25px 0 15px 0;\">Secondary Emergency Contact</h3>\n        <table class=\"form-table\">\n            <tr>\n                <td>Full Name:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Relationship:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Primary Phone:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Secondary Phone:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Email Address:</td>\n                <td>&nbsp;</td>\n            </tr>\n        </table>\n    </div>\n\n    <div style=\"page-break-before: always;\"></div>\n\n    <div class=\"section\">\n        <h2>\ud83d\udcb0 Direct Deposit Authorization</h2>\n        <p style=\"margin-bottom: 20px;\">Complete this form to have your paycheck directly deposited into your bank account(s). Direct deposit is mandatory for all employees.</p>\n        \n        <div class=\"info-box\">\n            <p><strong>\u26a0\ufe0f Important:</strong> Please attach a voided check or bank letter confirming your account details. Direct deposit will be activated within 1-2 pay cycles.</p>\n        </div>\n        \n        <h3 style=\"color: #991b1b; font-size: 18px; margin: 25px 0 15px 0;\">Primary Account (Required)</h3>\n        <table class=\"form-table\">\n            <tr>\n                <td>Bank Name:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Account Type:</td>\n                <td>\n                    <span class=\"checkbox\"></span> Checking\n                    <span style=\"margin-left: 30px;\" class=\"checkbox\"></span> Savings\n                </td>\n            </tr>\n            <tr>\n                <td>Routing Number:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Account Number:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Deposit Amount:</td>\n                <td>\n                    <span class=\"checkbox\"></span> Entire Net Pay\n                    <span style=\"margin-left: 20px;\" class=\"checkbox\"></span> Fixed Amount: $<span class=\"signature-line\" style=\"width: 150px;\"></span>\n                    <span style=\"margin-left: 20px;\" class=\"checkbox\"></span> Percentage: <span class=\"signature-line\" style=\"width: 80px;\"></span>%\n                </td>\n            </tr>\n        </table>\n        \n        <h3 style=\"color: #991b1b; font-size: 18px; margin: 25px 0 15px 0;\">Secondary Account (Optional)</h3>\n        <table class=\"form-table\">\n            <tr>\n                <td>Bank Name:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Account Type:</td>\n                <td>\n                    <span class=\"checkbox\"></span> Checking\n                    <span style=\"margin-left: 30px;\" class=\"checkbox\"></span> Savings\n                </td>\n            </tr>\n            <tr>\n                <td>Routing Number:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Account Number:</td>\n                <td>&nbsp;</td>\n            </tr>\n            <tr>\n                <td>Deposit Amount:</td>\n                <td>\n                    <span class=\"checkbox\"></span> Remaining Balance\n                    <span style=\"margin-left: 20px;\" class=\"checkbox\"></span> Fixed Amount: $<span class=\"signature-line\" style=\"width: 150px;\"></span>\n                    <span style=\"margin-left: 20px;\" class=\"checkbox\"></span> Percentage: <span class=\"signature-line\" style=\"width: 80px;\"></span>%\n                </td>\n            </tr>\n        </table>\n    </div>\n\n    <div class=\"section\">\n        <h2>\u270d\ufe0f Authorization and Signature</h2>\n        <p style=\"margin-bottom: 25px;\">I hereby authorize ${item.companyName} to initiate credit entries and to initiate, if necessary, debit entries and adjustments for any credit entries made in error to my account(s) indicated above. I acknowledge that the origination of ACH transactions to my account must comply with the provisions of U.S. law. This authority will remain in effect until I notify ${item.companyName} in writing to cancel it in such time as to afford ${item.companyName} a reasonable opportunity to act on it.</p>\n        \n        <div style=\"margin-top: 50px;\">\n            <table style=\"width: 100%;\">\n                <tr>\n                    <td style=\"width: 50%; padding-right: 20px;\">\n                        <p style=\"margin-bottom: 10px;\"><strong>Employee Signature:</strong></p>\n                        <div class=\"signature-line\" style=\"width: 100%; margin: 0;\"></div>\n                    </td>\n                    <td style=\"width: 50%; padding-left: 20px;\">\n                        <p style=\"margin-bottom: 10px;\"><strong>Date:</strong></p>\n                        <div class=\"signature-line\" style=\"width: 100%; margin: 0;\"></div>\n                    </td>\n                </tr>\n            </table>\n        </div>\n        \n        <div style=\"margin-top: 40px;\">\n            <table style=\"width: 100%;\">\n                <tr>\n                    <td style=\"width: 50%; padding-right: 20px;\">\n                        <p style=\"margin-bottom: 10px;\"><strong>Print Name:</strong></p>\n                        <p style=\"border-bottom: 2px solid #1f2937; padding: 10px;\">${item.fullName}</p>\n                    </td>\n                    <td style=\"width: 50%; padding-left: 20px;\">\n                        <p style=\"margin-bottom: 10px;\"><strong>Employee ID:</strong></p>\n                        <p style=\"border-bottom: 2px solid #1f2937; padding: 10px;\">${item.employeeId}</p>\n                    </td>\n                </tr>\n            </table>\n        </div>\n    </div>\n\n    <div class=\"section\">\n        <h2>\ud83d\udccb Required Documents Checklist</h2>\n        <p style=\"margin-bottom: 15px;\">Please ensure you submit the following with this form:</p>\n        <div style=\"margin-left: 20px;\">\n            <p style=\"margin-bottom: 12px;\"><span class=\"checkbox\"></span> Voided check or bank letter for primary account</p>\n            <p style=\"margin-bottom: 12px;\"><span class=\"checkbox\"></span> Voided check or bank letter for secondary account (if applicable)</p>\n            <p style=\"margin-bottom: 12px;\"><span class=\"checkbox\"></span> Copy of government-issued photo ID</p>\n            <p style=\"margin-bottom: 12px;\"><span class=\"checkbox\"></span> Social Security card or proof of work eligibility</p>\n        </div>\n    </div>\n\n    <div class=\"footer\">\n        <p><strong>For HR Use Only</strong></p>\n        <p style=\"margin-top: 10px;\">Received by: _______________ Date: _______________ Processed by: _______________ Date: _______________</p>\n        <p style=\"margin-top: 15px;\"><strong>${item.companyName} Human Resources Department</strong></p>\n        <p>Please return completed form to: ${item.hrContactEmail} or submit in person to HR on ${item.officeFloor}</p>\n    </div>\n</body>\n</html>\n`;\n\nreturn { json: { ...item, formsHtml: html } };"
      },
      "typeVersion": 2
    },
    {
      "id": "e48326eb-583a-459c-aa67-6ab968647c86",
      "name": "Prepare Document Array2",
      "type": "n8n-nodes-base.code",
      "position": [
        -1136,
        32
      ],
      "parameters": {
        "jsCode": "// Merge all HTML documents and convert references\nconst item = $input.first().json;\n\n// Collect all generated HTML documents\nconst documents = [\n  { name: 'Welcome_Letter', html: item.welcomeLetterHtml, order: 1 },\n  { name: 'Benefits_Guide', html: item.benefitsGuideHtml, order: 2 },\n  { name: 'IT_Setup_Instructions', html: item.itSetupHtml, order: 3 },\n  { name: 'Emergency_Contact_Direct_Deposit_Forms', html: item.formsHtml, order: 4 }\n];\n\n// Sort by order\ndocuments.sort((a, b) => a.order - b.order);\n\n// Return array of documents for PDF conversion\nreturn documents.map(doc => ({\n  json: {\n    ...item,\n    documentName: doc.name,\n    documentHtml: doc.html,\n    fileName: `${doc.order}_${doc.name}_${item.employeeId}.pdf`\n  }\n}));"
      },
      "typeVersion": 2
    },
    {
      "id": "c4c43fa7-e9dd-4195-809f-9d640e342886",
      "name": "Sticky Note27",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1616,
        -336
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 632,
        "content": "## Document Generation\n\nCreates 4 personalized HTML documents: (1) Welcome letter with first-day details and manager info, (2) Benefits guide with enrollment deadlines and plan comparisons, (3) IT setup with role-specific equipment lists, (4) Forms for emergency contacts and direct deposit authorization."
      },
      "typeVersion": 1
    },
    {
      "id": "e65fa7da-e2b4-4b11-bca8-7af1fc509a4f",
      "name": "Set HTML Field2",
      "type": "n8n-nodes-base.set",
      "position": [
        -912,
        32
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "html_content",
              "name": "html",
              "type": "string",
              "value": "={{ $json.documentHtml }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c503a37f-8e9d-470a-bbc4-0a1df8ef5124",
      "name": "Convert to PDF2",
      "type": "n8n-nodes-htmlcsstopdf.htmlcsstopdf",
      "position": [
        -704,
        32
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6f4e902d-c4e1-4780-9290-c94ffddc2598",
      "name": "Sticky Note28",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -224
      ],
      "parameters": {
        "color": 7,
        "width": 376,
        "height": 468,
        "content": "## Tracking & Alerts\n\nLogs delivery in HR system with completion tracking for signature requirements, then sends Slack notification to HR team with employee details and manager assignment confirmation."
      },
      "typeVersion": 1
    },
    {
      "id": "54118929-529f-4bd0-a3b6-fa1d01e66c46",
      "name": "Save to Drive2",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -480,
        32
      ],
      "parameters": {
        "name": "={{ $json.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "b0a438e5-b226-422f-96b7-7be923ea8dd0",
      "name": "Aggregate All Documents2",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -320,
        32
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {}
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e35ed48b-be50-43f5-95f2-1a666efbb74e",
      "name": "Prepare Email Package2",
      "type": "n8n-nodes-base.code",
      "position": [
        -160,
        32
      ],
      "parameters": {
        "jsCode": "// Prepare email with all document attachments\nconst items = $input.all();\n\nif (items.length === 0) {\n  throw new Error('No documents to send');\n}\n\n// Get employee info from first item\nconst employeeData = items[0].json;\n\n// Collect all PDF data\nconst attachments = items.map(item => ({\n  name: item.json.fileName,\n  data: item.binary?.data?.data || '',\n  type: 'application/pdf'\n}));\n\nconst emailBody = `\nDear ${employeeData.fullName},\n\nWelcome to ${employeeData.companyName}! We're excited to have you join our team as ${employeeData.jobTitle} in the ${employeeData.department} department.\n\nYour start date is ${employeeData.startDateFormatted}. Please find attached your complete onboarding document package, which includes:\n\n1. Welcome Letter - Important first-day information and what to bring\n2. Benefits Enrollment Guide - Comprehensive overview of your benefits options\n3. IT Setup Instructions - Technology equipment and access details\n4. Forms Package - Emergency contact and direct deposit authorization forms\n\nIMPORTANT ACTION ITEMS:\n\u2022 Review all attached documents before your start date\n\u2022 Complete and bring signed forms on your first day\n\u2022 Prepare direct deposit information (voided check or bank letter)\n\u2022 List your emergency contacts\n\u2022 Note your reporting time and location\n\nYour First Day:\n\u2022 Date: ${employeeData.startDateFormatted}\n\u2022 Time: 9:00 AM\n\u2022 Location: ${employeeData.location}\n\u2022 Report to: Reception on ${employeeData.officeFloor}\n\u2022 Dress Code: ${employeeData.dressCode}\n\nIf you have any questions before your start date, please don't hesitate to contact:\n\n${employeeData.hrContactName}\n${employeeData.hrContactEmail}\n${employeeData.hrContactPhone}\n\nWe look forward to welcoming you to the ${employeeData.companyName} team!\n\nBest regards,\n${employeeData.hrContactName}\nHuman Resources Department\n${employeeData.companyName}\n`;\n\nreturn [{\n  json: {\n    ...employeeData,\n    emailTo: employeeData.email,\n    emailSubject: `Welcome to ${employeeData.companyName} - Your Onboarding Package`,\n    emailBody: emailBody,\n    documentCount: attachments.length,\n    attachments: attachments\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "f7d804ae-ee0d-4ec4-af4f-838468b696e1",
      "name": "Send to Employee2",
      "type": "n8n-nodes-base.gmail",
      "position": [
        0,
        32
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "0d50f60b-f47c-4535-bd49-83ae0dbb5041",
      "name": "Log in HR System2",
      "type": "n8n-nodes-base.code",
      "position": [
        416,
        32
      ],
      "parameters": {
        "jsCode": "// Log onboarding package in HR system\nconst item = $input.first().json;\n\nconst hrSystemLog = {\n  employeeId: item.employeeId,\n  fullName: item.fullName,\n  email: item.email,\n  jobTitle: item.jobTitle,\n  department: item.department,\n  startDate: item.startDate,\n  employmentType: item.employmentType,\n  \n  // Onboarding package details\n  documentPackId: item.documentPackId,\n  documentsGenerated: item.documentCount,\n  generatedAt: item.generatedAt,\n  sentAt: new Date().toISOString(),\n  \n  // Document tracking\n  documents: [\n    { name: 'Welcome Letter', status: 'Sent', requiresSignature: false },\n    { name: 'Benefits Guide', status: 'Sent', requiresSignature: false },\n    { name: 'IT Setup Instructions', status: 'Sent', requiresSignature: false },\n    { name: 'Emergency Contact Form', status: 'Sent', requiresSignature: true, dueDate: item.startDate },\n    { name: 'Direct Deposit Form', status: 'Sent', requiresSignature: true, dueDate: item.startDate }\n  ],\n  \n  // Completion tracking\n  completionStatus: {\n    documentsReceived: true,\n    formsCompleted: false,\n    benefitsEnrolled: false,\n    itSetupComplete: false,\n    onboardingComplete: false\n  },\n  \n  // Manager and HR info\n  managerName: item.managerName,\n  managerEmail: item.managerEmail,\n  hrContact: item.hrContactName,\n  \n  // Benefits eligibility\n  benefitsEligible: item.benefitsEligible,\n  benefitsStartDate: item.benefitsStartDate,\n  \n  // IT requirements\n  requiresITEquipment: item.requiresITEquipment,\n  requiresManagementTraining: item.requiresManagementTraining,\n  requiresSalesTools: item.requiresSalesTools,\n  \n  // API integration\n  apiEndpoint: 'https://api.yourhrsystem.com/onboarding',\n  apiMethod: 'POST',\n  \n  // Activity log\n  activityLog: [\n    {\n      timestamp: new Date().toISOString(),\n      action: 'Onboarding Package Generated',\n      user: 'System',\n      details: `Generated ${item.documentCount} documents for ${item.fullName}`\n    },\n    {\n      timestamp: new Date().toISOString(),\n      action: 'Documents Sent',\n      user: 'System',\n      details: `Sent onboarding package to ${item.email}`\n    }\n  ]\n};\n\nreturn {\n  json: {\n    ...item,\n    hrSystemLog: hrSystemLog,\n    loggedAt: new Date().toISOString()\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "3980cdd0-e4e8-4fac-a57d-0cbe32a776d8",
      "name": "Notify HR Team2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        656,
        32
      ],
      "parameters": {
        "url": "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK",
        "options": {},
        "jsonBody": "={\n  \"text\": \"\ud83d\udc4b New Employee Onboarding Package Sent\",\n  \"blocks\": [\n    {\n      \"type\": \"section\",\n      \"text\": {\n        \"type\": \"mrkdwn\",\n        \"text\": \"*\ud83d\udc4b Onboarding Package Delivered*\\n\\n*Employee:* {{ $json.fullName }}\\n*ID:* {{ $json.employeeId }}\\n*Position:* {{ $json.jobTitle }}\\n*Department:* {{ $json.department }}\\n*Start Date:* {{ $json.startDateFormatted }}\\n*Email:* {{ $json.email }}\\n\\n*Documents Sent:*\\n\u2022 Welcome Letter\\n\u2022 Benefits Enrollment Guide\\n\u2022 IT Setup Instructions\\n\u2022 Emergency Contact & Direct Deposit Forms\\n\\n*Manager:* {{ $json.managerName }} ({{ $json.managerEmail }})\\n\\n\u2705 All documents archived in employee folder\"\n      }\n    }\n  ]\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.1
    }
  ],
  "connections": {
    "Save to Drive2": {
      "main": [
        [
          {
            "node": "Aggregate All Documents2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to PDF2": {
      "main": [
        [
          {
            "node": "Save to Drive2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Forms2": {
      "main": [
        [
          {
            "node": "Prepare Document Array2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set HTML Field2": {
      "main": [
        [
          {
            "node": "Convert to PDF2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Trigger2": {
      "main": [
        [
          {
            "node": "Validate & Enrich Data2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log in HR System2": {
      "main": [
        [
          {
            "node": "Notify HR Team2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send to Employee2": {
      "main": [
        [
          {
            "node": "Log in HR System2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Email Package2": {
      "main": [
        [
          {
            "node": "Send to Employee2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Document Array2": {
      "main": [
        [
          {
            "node": "Set HTML Field2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate & Enrich Data2": {
      "main": [
        [
          {
            "node": "Generate Welcome Letter2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate All Documents2": {
      "main": [
        [
          {
            "node": "Prepare Email Package2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Benefits Guide2": {
      "main": [
        [
          {
            "node": "Generate Forms2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate IT Setup Guide2": {
      "main": [
        [
          {
            "node": "Generate Benefits Guide2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Welcome Letter2": {
      "main": [
        [
          {
            "node": "Generate IT Setup Guide2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}