{
  "id": "4CTZmDghFqoIOP2v",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Onboarding Automation for New Developers:",
  "tags": [],
  "nodes": [
    {
      "id": "b7966c54-38b1-4a82-9477-8cd7e9384d81",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -752,
        -192
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0e1b2b00-40a3-410c-8eff-1b90c3cddb0d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -32
      ],
      "parameters": {
        "width": 368,
        "height": 416,
        "content": "## \ud83d\udccb Generate Notion Onboarding Checklist\n**Action:**  \n- Creates personalized onboarding checklist page in Notion.  \n**Description:**  \n- Dynamic page title: \"{Name} - Onboarding Checklist\"  \n- Structured checklist content:  \n  - Welcome header with team and emojis  \n  - Access links (Slack, GitHub, Jira, Notion)  \n  - Assigned buddy info for mentorship  \n  - Start date and onboarding status tracker  \n- Uses Notion Blocks API for rich formatting.  \n- Returns page URL for welcome email.  \n- Central hub for new hire onboarding tasks and resources.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "30f2733c-43d1-48cc-aa69-e4ba2bda1a89",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        0
      ],
      "parameters": {
        "width": 272,
        "height": 528,
        "content": "## \ud83d\udc64 Define New Hire Profile Data\n**Action:**  \n- Structures new employee information for multi-platform onboarding.  \n**Description:**  \n- Consolidates data into a standardized format:  \n  - Personal Info: Name, email, username  \n  - Company Details: Organization, start date, assigned buddy  \n  - Access Links: Slack, GitHub, Jira, Notion invitations  \n  - Custom Messages: Welcome message template, checklist name  \n- Acts as single source of truth for downstream nodes.  \n- Ensures consistent format across Notion, Jira, email, and AI.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "7021de1e-54d6-42cc-9e2f-898ac9cccbb6",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        -1088
      ],
      "parameters": {
        "height": 480,
        "content": "## \ud83d\udcca Log Jira Provisioning Failures to Error Sheet\n**Action:**  \n- Records Jira account creation errors in a Google Sheet.  \n**Description:**  \n- Captures failures like duplicate email, API auth errors, or invalid access.  \n- Maintains queryable database for HR/IT troubleshooting.  \n- Ensures onboarding failures don\u2019t go unnoticed.  \n- Critical for SLA compliance and smooth new hire experience.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c2fd3b41-2f64-4b56-86cb-8f0bb5d24810",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -1088
      ],
      "parameters": {
        "height": 464,
        "content": "## \ud83c\udfab Create Jira User Account\n**Action:**  \n- Automatically provisions new Jira user account via API.  \n**Description:**  \n- Calls Jira REST API (`/rest/api/3/user`) with POST method.  \n- Creates user with email, display name, username, and product access.  \n- Eliminates manual admin account creation.  \n- Returns account ID for validation and error handling.  \n- Requires Jira admin API credentials.  \n- Ensures immediate access to Jira boards and issue tracking.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f42a8d38-4e5d-4891-9448-4e29340a4fc7",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -1136
      ],
      "parameters": {
        "height": 496,
        "content": "## \u2705 Validate Jira Account Creation Success\n**Action:**  \n- Confirms Jira user account creation was successful.  \n**Description:**  \n- Checks for valid `accountId` in API response.  \n- **True Path:** Routes to Merge node to continue onboarding.  \n- **False Path:** Routes to error logging for troubleshooting.  \n- Catches duplicate emails, invalid credentials, permission issues, or rate limits.  \n- Prevents incomplete onboarding propagation downstream.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "a93fe17d-57ff-46a3-88da-6bc25f75e1b4",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        640
      ],
      "parameters": {
        "width": 368,
        "height": 384,
        "content": "## \ud83e\udd16 AI-Generated Welcome Message Creator\n**Action:**  \n- Generates personalized, warm onboarding message via GPT-4o.  \n**Description:**  \n- Leverages Azure OpenAI to craft messages using new hire info, buddy, role, and access links.  \n- Maintains professional, motivational, and emoji-inclusive tone.  \n- Message under 200 words for email compatibility.  \n- Output used in emails and Slack messages.  \n- Customizable per department or seniority via prompt adjustments.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "79f38e52-ec40-4e4d-b8bf-26e7b1368cc4",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        0
      ],
      "parameters": {
        "width": 288,
        "height": 448,
        "content": "## \ud83e\uddfe Format Comprehensive Welcome Email\n**Action:**  \n- Builds full HTML email with all onboarding resources and AI message.  \n**Description:**  \n- Personalized greeting and warm AI message.  \n- Clickable links: Notion checklist, Jira board, Slack, GitHub.  \n- Buddy assignment and start date included.  \n- Mobile-responsive and professional template.  \n- Output JSON formatted for Gmail node (to, subject, body).\n"
      },
      "typeVersion": 1
    },
    {
      "id": "63413c56-62dd-41af-a286-ca069d339f3a",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1440,
        0
      ],
      "parameters": {
        "height": 432,
        "content": "## \ud83d\udce7 Send Welcome Email to New Hire\n**Action:**  \n- Delivers comprehensive onboarding email to new hire inbox.  \n**Description:**  \n- Sends HTML email including AI message, access links, buddy info, and start date.  \n- Subject: \"Welcome to Techdome, {Name}! \ud83c\udf89\"  \n- Optionally CC HR/manager for tracking.  \n- Ensures new hire receives all onboarding info in one organized email.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "df323705-b891-4892-a7c4-206937c53b4d",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        800
      ],
      "parameters": {
        "height": 432,
        "content": "## \ud83e\udde0 GPT-4o Language Model Configuration\n**Action:**  \n- Configures GPT-4o model for generating onboarding messages.  \n**Description:**  \n- Sets system prompt defining onboarding assistant persona.  \n- Ensures consistent tone and style across all messages.  \n- Handles edge cases like missing buddy or delayed start dates.  \n- Optimized for friendly, professional output.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "1bb5da54-d2f4-48a3-b8ad-868c68ff41ee",
      "name": "Define New Hire Profile Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -352,
        -192
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "8513651a-27c6-4bd3-8c6e-cc97ed899eed",
              "name": "name",
              "type": "string",
              "value": "John Doe"
            },
            {
              "id": "1e3fd393-81ca-4a12-83c0-f4ccd85efd85",
              "name": "email",
              "type": "string",
              "value": "user@example.com"
            },
            {
              "id": "0360d8ac-7b76-4da2-8d63-c9ee0f8f1264",
              "name": "username",
              "type": "string",
              "value": "johndoe"
            },
            {
              "id": "b79a4c3b-e334-4087-bbe8-3d227cd8c0aa",
              "name": "organization",
              "type": "string",
              "value": "saurabh organization"
            },
            {
              "id": "cd2f48e9-897e-4fde-8c4b-d1727b477a50",
              "name": "start_date",
              "type": "string",
              "value": "12/02/2025"
            },
            {
              "id": "c230c4bf-fe47-48f6-a7f2-f8c8cb374c18",
              "name": "buddy",
              "type": "string",
              "value": "depak sen "
            },
            {
              "id": "a9c3ce7b-d717-48bb-a7e8-34549d3f4167",
              "name": "welcome_message",
              "type": "string",
              "value": "Welcome newscctv to Techdome\u2019s Developer Team \ud83c\udf89"
            },
            {
              "id": "bd3bc9f1-dadf-47b2-be3e-2750d80e8047",
              "name": "slack_invite_link",
              "type": "string",
              "value": "https://join.slack.com/t/techdome/invite/your-link"
            },
            {
              "id": "441dcb27-f0c2-445f-8d4e-77c57774c107",
              "name": "github_invite_link",
              "type": "string",
              "value": "https://github.com/orgs/techdome/invitation"
            },
            {
              "id": "22509df0-86fc-4143-95d6-633b3f1d008b",
              "name": "jira_project_link",
              "type": "string",
              "value": "https://newscctv22.atlassian.net/jira/software/c/projects/SCRUM/boards/1"
            },
            {
              "id": "11e48083-8fdd-424e-8c42-8fc2ff667cbf",
              "name": "notion_checklist_name",
              "type": "string",
              "value": "Developer Onboarding Checklist"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "aeef0657-f3b6-480c-b120-578329f22e32",
      "name": "Create Jira User Account",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        64,
        -576
      ],
      "parameters": {
        "url": "={{$node[\"Define New Hire Profile Data\"].json[\"jira_domain\"]}}/rest/api/3/user",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"emailAddress\": \"{{$json[\"email\"]}}\",\n  \"displayName\": \"{{$json[\"name\"]}}\",\n  \"name\": \"{{$json[\"username\"]}}\",\n  \"products\": [\"jira-software\"]\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "aed4e501-ddbf-41f6-a5e2-08b7d7e970ce",
      "name": "Validate Jira Account Creation Success",
      "type": "n8n-nodes-base.if",
      "position": [
        352,
        -576
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e2adb005-2b3c-4d1e-8445-442df1fe925a",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json[\"accountId\"] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "2c67259a-cdd1-43ee-a4af-6bd780d56eda",
      "name": "Log Jira Provisioning Failures to Error Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        752,
        -560
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "error_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "error_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "error",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "error",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "error_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1338537721,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Uldk_4BxWbdZTDZxFUeohIfeBmGHHqVEl9Ogb0l6R8Y/edit#gid=1338537721",
          "cachedResultName": "error log sheet"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Uldk_4BxWbdZTDZxFUeohIfeBmGHHqVEl9Ogb0l6R8Y",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Uldk_4BxWbdZTDZxFUeohIfeBmGHHqVEl9Ogb0l6R8Y/edit?usp=drivesdk",
          "cachedResultName": "Interviewer Brief Pack "
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "79686adb-3cad-4af2-81d9-af44b4306352",
      "name": " Generate Notion Onboarding Checklist",
      "type": "n8n-nodes-base.notion",
      "position": [
        224,
        -192
      ],
      "parameters": {
        "title": "={{$json[\"name\"]}} - Onboarding Checklist",
        "pageId": {
          "__rl": true,
          "mode": "id",
          "value": "265802b91fa080f69fffd0fc1daffe3d"
        },
        "simple": false,
        "blockUi": {
          "blockValues": [
            {
              "type": "heading_1",
              "textContent": "={{ $json.notion_checklist_name }}"
            },
            {
              "textContent": "=\ud83d\udc4b Welcome {{$json[\"name\"]}} to Techdome\u2019s Developer Team \ud83c\udf89    Your onboarding journey starts today! Here\u2019s everything you\u2019ll need to get started:    - \ud83d\udcac **Slack Access:** [Join Workspace]({{$json[\"slack_invite_link\"]}})   - \ud83d\udcbb **GitHub Access:** [Join Organization]({{$json[\"github_invite_link\"]}})   - \ud83e\uddfe **Jira Project Board:** [View Tasks]({{$json[\"jira_project_link\"]}})   - \ud83d\uddd2\ufe0f   You\u2019ll be guided by your buddy **{{$json[\"buddy\"]}}**, who will help you with setup and initial tasks.    Let\u2019s make your first week a great start \ud83d\ude80   Status: *Invited* | Start Date: {{$json[\"start_date\"]}}"
            }
          ]
        },
        "options": {}
      },
      "credentials": {
        "notionApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "00068c67-c7a8-42ba-8d53-ee634de6e10f",
      "name": "AI-Generated Welcome Message Creator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        208,
        432
      ],
      "parameters": {
        "text": "=You are Techdome\u2019s onboarding assistant. \nCompose a warm, friendly onboarding message for a new developer.\n\nHere\u2019s the new hire data in JSON:\n{{ JSON.stringify($json) }}\n\nUse the details to:\n- Welcome the developer by name\n- Mention their buddy\n- Share joining links (Slack, GitHub, Jira, Notion)\n- Add a short motivational line at the end\n\nKeep the tone conversational and include emojis (\ud83c\udf89 \ud83d\ude80 \ud83d\udcac \ud83d\udcbb \ud83e\uddfe).\nFormat the message as text for email or Slack.\n",
        "options": {
          "systemMessage": "=You are an assistant that specializes in generating onboarding messages for new employees.\nMake the message sound welcoming, professional, and motivating. Keep it under 200 words.\n"
        },
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "f1cad5d9-1870-4e1a-b6ad-551d7afb5f20",
      "name": " GPT-4o Language Model Configuration",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        128,
        640
      ],
      "parameters": {
        "model": "gpt-4o",
        "options": {}
      },
      "credentials": {
        "azureOpenAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8343b46b-d2c3-45d2-b0f7-0921d8ca56f8",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        32
      ],
      "parameters": {
        "width": 272,
        "height": 416,
        "content": "## \ud83d\udd17 Consolidate Onboarding Data Streams\n**Action:**  \n- Merges data from Jira, Notion, and AI-generated message for unified email payload.  \n**Description:**  \n- Combines:  \n  1. Jira account info  \n  2. Notion checklist URL  \n  3. AI-generated welcome text  \n- Prevents premature email sending with \u201cWait for All Input\u201d mode.  \n- Critical integration point ensuring new hire receives complete information.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "fe3a7d1f-2722-4451-8bc4-131e8a0e1dbe",
      "name": "Consolidate Onboarding Data Streams",
      "type": "n8n-nodes-base.merge",
      "position": [
        816,
        -208
      ],
      "parameters": {
        "numberInputs": 3
      },
      "typeVersion": 3.2
    },
    {
      "id": "8988e72b-a0ae-489e-ae9a-b60e66288738",
      "name": " Format Comprehensive Welcome Email",
      "type": "n8n-nodes-base.code",
      "position": [
        1184,
        -192
      ],
      "parameters": {
        "jsCode": "// Get merged data\nconst data = $json;\n\n// Handle possible nested AI output\nlet aiOutput =\n  data.output?.text ||\n  data.output ||\n  \"Welcome to Techdome! We\u2019re excited to have you join the team \ud83d\ude80\";\n\n// Links\nconst notionLink = data.url || \"https://www.notion.so/\";\nconst jiraLink =\n  \"https://newscctv22.atlassian.net/jira/software/c/projects/SCRUM/boards/1\";\n\n// Employee info\nconst employee = {\n  name: \"Saurabh Garg\",\n  email: \"user@example.com\",\n  buddy: \"Depak Sen\",\n  start_date: \"12/02/2025\",\n  slack_invite_link: \"https://join.slack.com/t/techdome/invite/your-link\",\n  github_invite_link: \"https://github.com/orgs/techdome/invitation\",\n};\n\n// Use AI node tone if exists, else wrap into a neat template\nconst emailBodyHTML = `\n<html>\n<body style=\"font-family:Arial, sans-serif; color:#333;\">\n  <p>Hi <b>${employee.name}</b>,</p>\n  \n  <p>${aiOutput}</p>\n\n  <p>Here are some useful links to get started:</p>\n  <ul>\n    <li>\ud83d\udccb <a href=\"${notionLink}\" target=\"_blank\">Notion Onboarding Checklist</a></li>\n    <li>\ud83d\udcca <a href=\"${jiraLink}\" target=\"_blank\">Jira Project Board</a></li>\n    <li>\ud83d\udcac <a href=\"${employee.slack_invite_link}\" target=\"_blank\">Slack Workspace</a></li>\n    <li>\ud83d\udcbb <a href=\"${employee.github_invite_link}\" target=\"_blank\">GitHub Organization</a></li>\n  </ul>\n\n  <p>\ud83d\udc65 Your onboarding buddy: <b>${employee.buddy}</b><br>\n  \ud83d\uddd3\ufe0f Start Date: <b>${employee.start_date}</b></p>\n\n  <p>We\u2019re thrilled to have you onboard and can\u2019t wait to see your impact at <b>Techdome</b>! \ud83c\udf89</p>\n  \n  <p>Best regards,<br>\n  The Techdome Team</p>\n</body>\n</html>\n`;\n\n// Final output for Gmail\nreturn [\n  {\n    json: {\n      to: employee.email,\n      subject: `Welcome to Techdome, ${employee.name}! \ud83c\udf89`,\n      body: emailBodyHTML,\n    },\n  },\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "5360177e-34f4-4623-a9df-1d7a99d4eec6",
      "name": "Send Welcome Email to New Hire",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1488,
        -192
      ],
      "parameters": {
        "sendTo": "={{ $json.to }}",
        "message": "={{ $json.body }}",
        "options": {},
        "subject": "={{ $json.subject }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "48b8eb87-3227-4183-950b-3065212fbae9",
  "connections": {
    "Create Jira User Account": {
      "main": [
        [
          {
            "node": "Validate Jira Account Creation Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define New Hire Profile Data": {
      "main": [
        [
          {
            "node": "AI-Generated Welcome Message Creator",
            "type": "main",
            "index": 0
          },
          {
            "node": " Generate Notion Onboarding Checklist",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create Jira User Account",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    " Format Comprehensive Welcome Email": {
      "main": [
        [
          {
            "node": "Send Welcome Email to New Hire",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Consolidate Onboarding Data Streams": {
      "main": [
        [
          {
            "node": " Format Comprehensive Welcome Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    " GPT-4o Language Model Configuration": {
      "ai_languageModel": [
        [
          {
            "node": "AI-Generated Welcome Message Creator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI-Generated Welcome Message Creator": {
      "main": [
        [
          {
            "node": "Consolidate Onboarding Data Streams",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Define New Hire Profile Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    " Generate Notion Onboarding Checklist": {
      "main": [
        [
          {
            "node": "Consolidate Onboarding Data Streams",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Validate Jira Account Creation Success": {
      "main": [
        [
          {
            "node": "Consolidate Onboarding Data Streams",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Jira Provisioning Failures to Error Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}