{
  "name": "Employee Onboarding Automation",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "new-hire-webhook",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-new-hire",
      "name": "Webhook - New Hire Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        400
      ]
    },
    {
      "parameters": {
        "fromEmail": "hr@company.com",
        "toEmail": "={{$json.email}}",
        "subject": "Welcome to the Team, {{$json.firstName}}! \ud83c\udf89",
        "emailType": "html",
        "message": "<h1>Welcome {{$json.firstName}}!</h1><p>We're thrilled to have you join our team as <strong>{{$json.jobTitle}}</strong>.</p><h2>What to Expect:</h2><ul><li>Your start date: {{$json.startDate}}</li><li>Department: {{$json.department}}</li><li>Manager: {{$json.managerName}}</li></ul><h2>Before Day 1:</h2><ol><li>Complete your profile in our HR system</li><li>Review the employee handbook</li><li>Set up your accounts (instructions coming)</li></ol><p>We'll be sending you more information in the coming days. If you have any questions, feel free to reach out!</p><p>Best regards,<br>HR Team</p>"
      },
      "id": "send-welcome-email",
      "name": "Send Welcome Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 1,
      "position": [
        450,
        300
      ],
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "resource": "user",
        "operation": "create",
        "email": "={{$json.email}}",
        "firstName": "={{$json.firstName}}",
        "lastName": "={{$json.lastName}}",
        "password": "={{$json.tempPassword}}",
        "additionalFields": {
          "organizationUnit": "/{{$json.department}}",
          "changePasswordAtNextLogin": true
        }
      },
      "id": "create-google-workspace",
      "name": "Create Google Workspace Account",
      "type": "n8n-nodes-base.googleWorkspace",
      "typeVersion": 1,
      "position": [
        450,
        400
      ],
      "credentials": {
        "googleWorkspaceServiceAccount": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "channel": "#general",
        "text": "\ud83d\udc4b Please join us in welcoming *{{$json.firstName}} {{$json.lastName}}* to the team!\n\n*Role:* {{$json.jobTitle}}\n*Department:* {{$json.department}}\n*Start Date:* {{$json.startDate}}\n\nLet's make them feel at home! \ud83c\udf89"
      },
      "id": "announce-slack",
      "name": "Announce on Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [
        450,
        500
      ],
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "url": "https://it-provisioning.company.com/api/equipment",
        "method": "POST",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={{ {\n  \"employeeId\": $json.employeeId,\n  \"name\": $json.firstName + \" \" + $json.lastName,\n  \"email\": $json.email,\n  \"department\": $json.department,\n  \"equipment\": [\n    \"Laptop\",\n    \"Monitor\",\n    \"Keyboard\",\n    \"Mouse\",\n    \"Headset\"\n  ],\n  \"startDate\": $json.startDate\n} }}"
      },
      "id": "request-equipment",
      "name": "Request IT Equipment",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        650,
        300
      ],
      "credentials": {
        "httpBasicAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "functionCode": "// Create onboarding tasks\nconst employee = $input.item.json;\n\nconst tasks = [\n  {\n    day: 0,\n    title: \"Send welcome package\",\n    assignee: \"HR\",\n    description: \"Send company swag and welcome materials\"\n  },\n  {\n    day: 1,\n    title: \"Office tour and introductions\",\n    assignee: \"Manager\",\n    description: \"Introduce to team and show around the office\"\n  },\n  {\n    day: 1,\n    title: \"Setup workstation\",\n    assignee: \"IT\",\n    description: \"Configure laptop and accounts\"\n  },\n  {\n    day: 2,\n    title: \"Review company policies\",\n    assignee: \"HR\",\n    description: \"Go through employee handbook\"\n  },\n  {\n    day: 3,\n    title: \"Department overview\",\n    assignee: \"Manager\",\n    description: \"Explain team structure and processes\"\n  },\n  {\n    day: 5,\n    title: \"First project assignment\",\n    assignee: \"Manager\",\n    description: \"Assign initial tasks\"\n  },\n  {\n    day: 14,\n    title: \"2-week check-in\",\n    assignee: \"HR\",\n    description: \"How is onboarding going?\"\n  },\n  {\n    day: 30,\n    title: \"30-day review\",\n    assignee: \"Manager\",\n    description: \"Performance and feedback session\"\n  },\n  {\n    day: 90,\n    title: \"90-day evaluation\",\n    assignee: \"Manager\",\n    description: \"Comprehensive review\"\n  }\n];\n\nreturn tasks.map(task => ({\n  json: {\n    employeeId: employee.employeeId,\n    employeeName: `${employee.firstName} ${employee.lastName}`,\n    email: employee.email,\n    taskTitle: task.title,\n    taskDescription: task.description,\n    assignee: task.assignee,\n    dueDate: new Date(new Date(employee.startDate).getTime() + task.day * 24 * 60 * 60 * 1000).toISOString(),\n    status: 'pending'\n  }\n}));"
      },
      "id": "create-onboarding-tasks",
      "name": "Create Onboarding Tasks",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        650,
        400
      ]
    },
    {
      "parameters": {
        "operation": "create",
        "projectId": "onboarding-tracker",
        "name": "={{$json.taskTitle}} - {{$json.employeeName}}",
        "additionalFields": {
          "assignee": "={{$json.assignee}}",
          "notes": "={{$json.taskDescription}}",
          "due_on": "={{$json.dueDate}}"
        }
      },
      "id": "create-asana-tasks",
      "name": "Create Asana Tasks",
      "type": "n8n-nodes-base.asana",
      "typeVersion": 1,
      "position": [
        850,
        400
      ],
      "credentials": {
        "asanaApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "sheetId": "employee-onboarding",
        "range": "A:Z",
        "options": {}
      },
      "id": "log-to-hr-system",
      "name": "Log to HR System",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        650,
        500
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "unit": "days",
        "amount": 7,
        "options": {}
      },
      "id": "wait-7-days",
      "name": "Wait 7 Days",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        850,
        300
      ]
    },
    {
      "parameters": {
        "fromEmail": "hr@company.com",
        "toEmail": "={{$json.email}}",
        "subject": "How's your first week going? \ud83c\udf1f",
        "emailType": "html",
        "message": "<h2>Hi {{$json.firstName}},</h2><p>You've completed your first week with us! We hope you're settling in well.</p><p>Please take a moment to share your feedback:</p><ul><li>How has your onboarding experience been?</li><li>Do you have everything you need?</li><li>Any questions or concerns?</li></ul><p><a href='https://company.com/feedback/first-week'>Share Your Feedback</a></p><p>Best regards,<br>HR Team</p>"
      },
      "id": "send-week-1-followup",
      "name": "Send Week 1 Follow-up",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 1,
      "position": [
        1050,
        300
      ],
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { \"success\": true, \"message\": \"Onboarding process initiated\", \"employeeId\": $json.employeeId } }}"
      },
      "id": "webhook-response",
      "name": "Webhook Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        850,
        200
      ]
    }
  ],
  "connections": {
    "Webhook - New Hire Trigger": {
      "main": [
        [
          {
            "node": "Send Welcome Email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create Google Workspace Account",
            "type": "main",
            "index": 0
          },
          {
            "node": "Announce on Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Welcome Email": {
      "main": [
        [
          {
            "node": "Request IT Equipment",
            "type": "main",
            "index": 0
          },
          {
            "node": "Webhook Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Google Workspace Account": {
      "main": [
        [
          {
            "node": "Create Onboarding Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Announce on Slack": {
      "main": [
        [
          {
            "node": "Log to HR System",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request IT Equipment": {
      "main": [
        [
          {
            "node": "Wait 7 Days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Onboarding Tasks": {
      "main": [
        [
          {
            "node": "Create Asana Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 7 Days": {
      "main": [
        [
          {
            "node": "Send Week 1 Follow-up",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}