{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "297e6687-be2f-41b2-9829-f3c82da3369f",
      "name": "Workflow Explanation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2656,
        -256
      ],
      "parameters": {
        "width": 723,
        "height": 1214,
        "content": "## Overview\nThis workflow automates employee onboarding using data submitted through a Google Form. Based on the employee's department and role, it provisions access to Slack, Jira, and GitHub, and tracks onboarding status.\n\n## Who's it for\n- HR teams managing employee onboarding\n- IT administrators handling access provisioning\n- Companies using Google Forms for new hire intake\n- Teams using Slack, Jira, and GitHub for collaboration\n\n## How it works\n1. A new response is submitted via Google Forms\n2. The workflow checks if the employee has already been processed\n3. If already completed, the admin is notified\n4. If not:\n   - User is added to the appropriate Slack channel\n   - If in the Software department, GitHub access is granted\n   - User is invited to Jira\n   - A Jira onboarding task is created\n5. The Google Sheet is updated to mark onboarding as completed\n\n## Setup Steps\n1. **Google Sheets**: Connect your account and update `YOUR_GOOGLE_SHEET_ID_HERE` in both the trigger and update nodes\n2. **Slack**: Connect your account and update:\n   - Department channel IDs in the Code node config\n   - Admin user ID in \"Notify admin\" node\n3. **Jira**: Connect your account and update:\n   - Project keys in the Code node config\n   - Component IDs in the Code node config\n   - Your site URL in the \"Invite user to Jira\" node\n4. **GitHub**: Connect your account and update:\n   - Organization name in the HTTP node URL\n   - Repository names in the Code node config\n\n## Requirements\n- Google Sheets with form responses\n- Slack workspace with appropriate channels\n- Jira Software Cloud instance\n- GitHub organization with repositories\n\n## Customization\n- Modify department mappings in the Code node to match your org structure\n- Update Slack channel IDs for each department\n- Adjust GitHub repository names for each team\n- Configure Jira component IDs for different roles"
      },
      "typeVersion": 1
    },
    {
      "id": "117f0260-e835-4f4e-be3a-d36a995e22d1",
      "name": "Group: Sorting Office",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1840,
        -80
      ],
      "parameters": {
        "color": 4,
        "width": 992,
        "height": 544,
        "content": "### Data processing and validation\nProcesses form input and checks if onboarding was already completed."
      },
      "typeVersion": 1
    },
    {
      "id": "177cf43c-e5fa-4ae3-8c6b-67ed68fd1dd7",
      "name": "Group: Digital Onboarding",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        -80
      ],
      "parameters": {
        "color": 5,
        "width": 1312,
        "height": 544,
        "content": "### User provisioning and onboarding\nCreates accounts, assigns access, and sets up onboarding tasks."
      },
      "typeVersion": 1
    },
    {
      "id": "04ca7110-16d4-42b6-8d08-07b7cb5f589c",
      "name": "New Google Form Response",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -1792,
        224
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": "Form Responses 1",
        "documentId": "YOUR_GOOGLE_SHEET_ID_HERE"
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bca088fc-bb7d-4655-96e4-91ee6fb4d2af",
      "name": "Map department and team configuration",
      "type": "n8n-nodes-base.code",
      "position": [
        -1536,
        224
      ],
      "parameters": {
        "jsCode": "const config = {\n  departments: {\n    \"Software\": { slack: \"YOUR_SOFTWARE_SLACK_CHANNEL_ID\", jira: \"YOUR_SOFTWARE_JIRA_PROJECT_KEY\" },\n    \"Marketing\": { slack: \"YOUR_MARKETING_SLACK_CHANNEL_ID\", jira: \"YOUR_MKT_JIRA_PROJECT_KEY\" },\n    \"Finance\": { slack: \"YOUR_FINANCE_SLACK_CHANNEL_ID\", jira: \"YOUR_FIN_JIRA_PROJECT_KEY\" },\n    \"Project\": { slack: \"YOUR_PROJECT_SLACK_CHANNEL_ID\", jira: \"YOUR_PROJ_JIRA_PROJECT_KEY\" }\n  },\n  componentMap: {\n    \"FrontEnd\": \"YOUR_FRONTEND_COMPONENT_ID\",\n    \"BackEnd\": \"YOUR_BACKEND_COMPONENT_ID\",\n    \"Mobile\": \"YOUR_MOBILE_COMPONENT_ID\",\n    \"UI/UX\": \"YOUR_UIUX_COMPONENT_ID\",\n    \"Tester\": \"YOUR_TESTER_COMPONENT_ID\",\n    \"Project Manager\": \"YOUR_PM_COMPONENT_ID\",\n    \"Business Analyst\": \"YOUR_BA_COMPONENT_ID\",\n    \"Scrum Master\": \"YOUR_SM_COMPONENT_ID\"\n  },\n  teams: {\n    \"FrontEnd\": \"your-frontend-repo-name\",\n    \"BackEnd\": \"your-backend-repo-name\",\n    \"Mobile\": \"your-mobile-repo-name\",\n    \"UI/UX\": \"your-design-repo-name\",\n    \"Tester\": \"your-qa-repo-name\"\n  }\n};\n\nconst item = $input.item.json;\n\nconst deptConfig = config.departments[item.Department] || { slack: \"YOUR_GENERAL_SLACK_CHANNEL_ID\", jira: \"YOUR_DEFAULT_JIRA_PROJECT_KEY\" };\nconst selectedComponentId = config.componentMap[item.Team];\n\nreturn {\n  ...item,\n  targetSlack: deptConfig.slack,\n  targetJira: deptConfig.jira,\n  targetComponentIds: selectedComponentId ? [selectedComponentId] : [],\n  targetRepo: config.teams[item.Team] || \"your-general-repo-name\",\n  targetGithubUser: item[\"GitHub Username\"],\n  isSoftware: item.Department === \"Software\"\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "d0a68a09-da0a-499f-b0f4-168cf5c9369e",
      "name": "Check if onboarding already completed",
      "type": "n8n-nodes-base.if",
      "position": [
        -1280,
        224
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "633b8d07-5da8-44ea-b949-614ebf7bff8b",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.Status }}",
              "rightValue": "Completed"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f7a4dbfa-7254-40e9-a10a-8843e4bbe55d",
      "name": "Notify admin if already processed",
      "type": "n8n-nodes-base.slack",
      "position": [
        -1040,
        0
      ],
      "parameters": {
        "text": "=Admin notice: User {{ $('Map department and team configuration').item.json['Full Name'] }} ({{ $('Map department and team configuration').item.json.Email }}) was already processed (Status = Completed)",
        "user": "YOUR_SLACK_ADMIN_USER_ID_HERE",
        "select": "user",
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "3d0c824f-6f2f-4740-85de-39c68155a425",
      "name": "Add user to department Slack channel",
      "type": "n8n-nodes-base.slack",
      "onError": "continueRegularOutput",
      "position": [
        -704,
        240
      ],
      "parameters": {
        "resource": "channel",
        "channelId": "={{ $json.targetSlack }}",
        "operation": "join"
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "30cf8687-8dbd-4919-805f-8244ab8c5f0c",
      "name": "Check if department is software",
      "type": "n8n-nodes-base.if",
      "position": [
        -432,
        240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a3432154-31aa-411c-9fd5-ecbe8b80b453",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $('Map department and team configuration').item.json.isSoftware }}",
              "rightValue": "true"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f80d43da-5874-448a-a9ba-70216f7d9998",
      "name": "Add user to GitHub repository",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -192,
        64
      ],
      "parameters": {
        "url": "=https://api.github.com/repos/YOUR_ORG_NAME/{{ $('Map department and team configuration').item.json.targetRepo }}/collaborators/{{ $('Map department and team configuration').item.json['GitHub Username'] }}",
        "method": "PUT",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "permission",
              "value": "push"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/vnd.github.v3+json"
            }
          ]
        },
        "nodeCredentialType": "githubApi"
      },
      "credentials": {
        "githubApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "0112a746-6924-4744-9589-28349e18831f",
      "name": "Create onboarding task in Jira",
      "type": "n8n-nodes-base.jira",
      "position": [
        352,
        256
      ],
      "parameters": {
        "project": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Map department and team configuration').item.json.targetJira }}"
        },
        "summary": "=Onboarding: {{ $('Map department and team configuration').item.json.Email }}",
        "issueType": {
          "__rl": true,
          "mode": "list",
          "value": "10014",
          "cachedResultName": "Task"
        },
        "additionalFields": {
          "description": "=Please complete onboarding for new hire in department: {{ $('Map department and team configuration').item.json.Department }}",
          "componentIds": "={{ [$('Map department and team configuration').item.json.targetComponentIds[0]] }}"
        }
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2683b5ee-e914-4c2a-8585-14f9944ee1dc",
      "name": "Invite user to Jira",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        64,
        256
      ],
      "parameters": {
        "url": "https://YOUR_SITE.atlassian.net",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"emailAddress\": \"{{ $('Map department and team configuration').item.json.Email }}\",\n  \"products\": [\"jira-software\"]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "jiraSoftwareCloudApi"
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "971b0df6-44b4-45cf-acf9-9d8e0da728a4",
      "name": "Update Google Sheet status to completed",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        656,
        256
      ],
      "parameters": {
        "columns": {
          "value": {
            "Email": "={{ $('Map department and team configuration').item.json.Email }}",
            "Status": "Completed"
          },
          "schema": [
            {
              "id": "Email",
              "type": "string",
              "displayName": "Email",
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "displayName": "Status",
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Email"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": "Form Responses 1",
        "documentId": "YOUR_GOOGLE_SHEET_ID_HERE"
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    }
  ],
  "connections": {
    "Invite user to Jira": {
      "main": [
        [
          {
            "node": "Create onboarding task in Jira",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Google Form Response": {
      "main": [
        [
          {
            "node": "Map department and team configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add user to GitHub repository": {
      "main": [
        [
          {
            "node": "Invite user to Jira",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create onboarding task in Jira": {
      "main": [
        [
          {
            "node": "Update Google Sheet status to completed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if department is software": {
      "main": [
        [
          {
            "node": "Add user to GitHub repository",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Invite user to Jira",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add user to department Slack channel": {
      "main": [
        [
          {
            "node": "Check if department is software",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if onboarding already completed": {
      "main": [
        [
          {
            "node": "Notify admin if already processed",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add user to department Slack channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map department and team configuration": {
      "main": [
        [
          {
            "node": "Check if onboarding already completed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}