{
  "id": "L87pnGIo6Q1Bmxwe",
  "name": "Automated Client Onboarding and Task Assignment System",
  "tags": [],
  "nodes": [
    {
      "id": "07bd105b-1190-44d1-93e1-c053ee21f3ed",
      "name": "New Client Intake Form",
      "type": "n8n-nodes-base.webhook",
      "position": [
        128,
        128
      ],
      "parameters": {
        "path": "client-intake",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "lastNode"
      },
      "typeVersion": 2.1
    },
    {
      "id": "041c6d4d-0ecb-403b-aefa-69170c5a64bb",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        352,
        128
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "strategyConsultantChannel",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Slack channel ID for Strategy consultant__>"
            },
            {
              "id": "id-2",
              "name": "managementConsultantChannel",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Slack channel ID for Management consultant__>"
            },
            {
              "id": "id-3",
              "name": "itConsultantChannel",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Slack channel ID for IT consultant__>"
            },
            {
              "id": "id-4",
              "name": "googleSheetId",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Google Sheets spreadsheet ID__>"
            },
            {
              "id": "id-5",
              "name": "crmApiUrl",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__CRM API endpoint URL__>"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "872fa072-fb08-4d98-a8bd-1e9d204ccc69",
      "name": "Normalize Client Data",
      "type": "n8n-nodes-base.set",
      "position": [
        576,
        128
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "clientName",
              "type": "string",
              "value": "={{ $json.body.name || $json.body.clientName || '' }}"
            },
            {
              "id": "id-2",
              "name": "clientEmail",
              "type": "string",
              "value": "={{ $json.body.email || $json.body.clientEmail || '' }}"
            },
            {
              "id": "id-3",
              "name": "projectType",
              "type": "string",
              "value": "={{ $json.body.projectType || $json.body.project_type || '' }}"
            },
            {
              "id": "id-4",
              "name": "company",
              "type": "string",
              "value": "={{ $json.body.company || '' }}"
            },
            {
              "id": "id-5",
              "name": "phone",
              "type": "string",
              "value": "={{ $json.body.phone || '' }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "cf830242-4087-4ea3-be16-9db5856bc8cb",
      "name": "Generate Onboarding Checklist",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        800,
        128
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o-mini"
        },
        "options": {
          "instructions": "You are an expert consultant onboarding assistant. Based on the client information and project type provided, generate:\n\n1. A comprehensive onboarding checklist (5-8 items) tailored to the project type\n2. First 3-5 actionable tasks to get started\n3. Key deliverables and milestones\n\nFormat your response as JSON with the following structure:\n{\n  \"checklist\": [\"item1\", \"item2\", ...],\n  \"firstTasks\": [\"task1\", \"task2\", ...],\n  \"deliverables\": [\"deliverable1\", \"deliverable2\", ...]\n}\n\nTailor recommendations based on project type:\n- Strategy: Focus on analysis, planning, and strategic frameworks\n- Management: Focus on process optimization, team coordination, and implementation\n- IT: Focus on technical requirements, system architecture, and development phases"
        },
        "responses": {
          "values": [
            {
              "content": "=Client Name: {{ $json.clientName }}\nProject Type: {{ $json.projectType }}\nCompany: {{ $json.company }}\n\nGenerate a customized onboarding checklist and first tasks for this client."
            }
          ]
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "4058e287-b8ef-45a3-aa34-f40b821430ec",
      "name": "Route by Project Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        1152,
        112
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Strategy",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.projectType }}",
                    "rightValue": "Strategy"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Management",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.projectType }}",
                    "rightValue": "Management"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "IT",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.projectType }}",
                    "rightValue": "IT"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.4
    },
    {
      "id": "f748b31b-de13-4824-9465-af7f180867c3",
      "name": "Log to Google Sheets - Strategy",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1376,
        -64
      ],
      "parameters": {
        "columns": {
          "value": null,
          "schema": [],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "Email"
          ]
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Strategy Clients"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.googleSheetId }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "cb790008-0f9a-4525-a133-6fe29f529b87",
      "name": "Log to Google Sheets - Management",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1376,
        128
      ],
      "parameters": {
        "columns": {
          "value": null,
          "schema": [],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "Email"
          ]
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Management Clients"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.googleSheetId }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "3dfcd637-6395-4fb9-99fd-224d3a498ebd",
      "name": "Log to Google Sheets - IT",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1376,
        320
      ],
      "parameters": {
        "columns": {
          "value": null,
          "schema": [],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "Email"
          ]
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "IT Clients"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.googleSheetId }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "be157be1-bdf8-4c9e-9a98-c9c393b962e8",
      "name": "Notify Strategy Consultant",
      "type": "n8n-nodes-base.slack",
      "position": [
        1600,
        -64
      ],
      "parameters": {
        "text": "=\ud83c\udfaf *New Strategy Client Assigned*\n\n*Client:* {{ $json.clientName }}\n*Company:* {{ $json.company }}\n*Email:* {{ $json.clientEmail }}\n*Phone:* {{ $json.phone }}\n\n*Onboarding Checklist:*\n{{ $json.message.content ? JSON.parse($json.message.content).checklist.map((item, i) => `${i+1}. ${item}`).join(\"\\n\") : \"See full details in Google Sheets\" }}\n\n*First Tasks:*\n{{ $json.message.content ? JSON.parse($json.message.content).firstTasks.map((item, i) => `${i+1}. ${item}`).join(\"\\n\") : \"See full details in Google Sheets\" }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.strategyConsultantChannel }}"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.4
    },
    {
      "id": "772b5298-b5f2-4cf3-b67c-ffa66117c483",
      "name": "Notify Management Consultant",
      "type": "n8n-nodes-base.slack",
      "position": [
        1600,
        128
      ],
      "parameters": {
        "text": "=\ud83d\udcca *New Management Client Assigned*\n\n*Client:* {{ $json.clientName }}\n*Company:* {{ $json.company }}\n*Email:* {{ $json.clientEmail }}\n*Phone:* {{ $json.phone }}\n\n*Onboarding Checklist:*\n{{ $json.message.content ? JSON.parse($json.message.content).checklist.map((item, i) => `${i+1}. ${item}`).join(\"\\n\") : \"See full details in Google Sheets\" }}\n\n*First Tasks:*\n{{ $json.message.content ? JSON.parse($json.message.content).firstTasks.map((item, i) => `${i+1}. ${item}`).join(\"\\n\") : \"See full details in Google Sheets\" }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.managementConsultantChannel }}"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.4
    },
    {
      "id": "bcea8b2e-1734-47b2-9e98-da4aff1c8c99",
      "name": "Notify IT Consultant",
      "type": "n8n-nodes-base.slack",
      "position": [
        1600,
        320
      ],
      "parameters": {
        "text": "=\ud83d\udcbb *New IT Client Assigned*\n\n*Client:* {{ $json.clientName }}\n*Company:* {{ $json.company }}\n*Email:* {{ $json.clientEmail }}\n*Phone:* {{ $json.phone }}\n\n*Onboarding Checklist:*\n{{ $json.message.content ? JSON.parse($json.message.content).checklist.map((item, i) => `${i+1}. ${item}`).join(\"\\n\") : \"See full details in Google Sheets\" }}\n\n*First Tasks:*\n{{ $json.message.content ? JSON.parse($json.message.content).firstTasks.map((item, i) => `${i+1}. ${item}`).join(\"\\n\") : \"See full details in Google Sheets\" }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.itConsultantChannel }}"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.4
    },
    {
      "id": "e0766430-f4f5-4066-a783-0525fda159fd",
      "name": "Send Welcome Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1824,
        128
      ],
      "parameters": {
        "html": "=<html>\n<body style=\"font-family: Arial, sans-serif; line-height: 1.6; color: #333;\">\n  <h2 style=\"color: #0066cc;\">Welcome, {{ $json.clientName }}! \ud83c\udf89</h2>\n  \n  <p>Thank you for choosing our consulting services. We're excited to partner with you on your <strong>{{ $json.projectType }}</strong> project.</p>\n  \n  <h3>What's Next?</h3>\n  <p>Your dedicated consultant has been assigned and will reach out shortly to schedule your kickoff meeting.</p>\n  \n  <h3>Your Onboarding Checklist:</h3>\n  <ul>\n    {{ $json.message.content ? JSON.parse($json.message.content).checklist.map(item => `<li>${item}</li>`).join(\"\") : \"<li>Details will be shared in your kickoff meeting</li>\" }}\n  </ul>\n  \n  <h3>First Tasks:</h3>\n  <ul>\n    {{ $json.message.content ? JSON.parse($json.message.content).firstTasks.map(item => `<li>${item}</li>`).join(\"\") : \"<li>Details will be shared in your kickoff meeting</li>\" }}\n  </ul>\n  \n  <p>If you have any questions, feel free to reply to this email.</p>\n  \n  <p>Best regards,<br>Your Consulting Team</p>\n</body>\n</html>",
        "options": {},
        "subject": "=Welcome to Our Consulting Services - {{ $json.clientName }}",
        "toEmail": "={{ $json.clientEmail }}",
        "fromEmail": "<__PLACEHOLDER_VALUE__Your company email address__>"
      },
      "typeVersion": 2.1
    },
    {
      "id": "a88b0726-da82-453c-8de3-890f8f85a6b7",
      "name": "Schedule Kickoff Meeting",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        2048,
        128
      ],
      "parameters": {
        "end": "={{ $now.plus(2, 'days').set({ hour: 11, minute: 0 }).toISO() }}",
        "start": "={{ $now.plus(2, 'days').set({ hour: 10, minute: 0 }).toISO() }}",
        "calendar": {
          "__rl": true,
          "mode": "id",
          "value": "primary"
        },
        "additionalFields": {
          "summary": "=Kickoff Meeting - {{ $json.clientName }}",
          "attendees": [
            "={{ $json.clientEmail }}"
          ],
          "description": "=Initial kickoff meeting for {{ $json.projectType }} project with {{ $json.clientName }} from {{ $json.company }}.\n\nAgenda:\n- Introductions\n- Project overview\n- Timeline and deliverables\n- Next steps"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "71e577bc-0c52-4e95-a532-8ce1d4312bc7",
      "name": "Sync to CRM",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2272,
        128
      ],
      "parameters": {
        "url": "={{ $('Workflow Configuration').first().json.crmApiUrl }}",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"name\": \"{{ $json.clientName }}\",\n  \"email\": \"{{ $json.clientEmail }}\",\n  \"company\": \"{{ $json.company }}\",\n  \"phone\": \"{{ $json.phone }}\",\n  \"projectType\": \"{{ $json.projectType }}\",\n  \"status\": \"onboarding\",\n  \"onboardingData\": {{ $json.message.content || \"{}\" }}\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType"
      },
      "typeVersion": 4.3
    },
    {
      "id": "f8dc1762-176d-44ee-89fa-cc6085d42fba",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 672,
        "height": 656,
        "content": "## Webhook & Config"
      },
      "typeVersion": 1
    },
    {
      "id": "f4341e50-8203-41f7-b51c-b637334faf78",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        768,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 496,
        "height": 656,
        "content": "## AI Routing "
      },
      "typeVersion": 1
    },
    {
      "id": "a4f00111-5414-4640-9790-e46416ee5839",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        -160
      ],
      "parameters": {
        "color": 7,
        "width": 496,
        "height": 656,
        "content": "## Log & Notify"
      },
      "typeVersion": 1
    },
    {
      "id": "0a94791e-11f1-49f1-a067-9cbe994b2b1a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1808,
        -160
      ],
      "parameters": {
        "color": 7,
        "width": 656,
        "height": 656,
        "content": "## CRM"
      },
      "typeVersion": 1
    },
    {
      "id": "349666d6-6917-4d9c-ab7c-1da5813b8834",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -32
      ],
      "parameters": {
        "width": 336,
        "height": 576,
        "content": "## Main\nThis workflow automates consulting client onboarding, task creation, and routing. AI generates a checklist based on project type and assigns tasks to the correct team member.\n\n## Setup\n1. Connect your Webhook/Form credentials for client intake.\n2. Configure Google Sheets to store client info.\n3. Connect OpenAI credentials for checklist/task generation.\n4. Connect Slack for internal notifications.\n5. Connect email for client communication.\n6. Optional: CRM integration for automated logging.\n\n**Author:** Hyrum Hurst, AI Automation Engineer\n**Company:** QuarterSmart\n**Contact:** hyrum@quartersmart.com\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1e490925-4e1a-4e0c-8235-4b377d3393f5",
  "connections": {
    "Send Welcome Email": {
      "main": [
        [
          {
            "node": "Schedule Kickoff Meeting",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify IT Consultant": {
      "main": [
        [
          {
            "node": "Send Welcome Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Client Data": {
      "main": [
        [
          {
            "node": "Generate Onboarding Checklist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Project Type": {
      "main": [
        [
          {
            "node": "Log to Google Sheets - Strategy",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log to Google Sheets - Management",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log to Google Sheets - IT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Client Intake Form": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Normalize Client Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Kickoff Meeting": {
      "main": [
        [
          {
            "node": "Sync to CRM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to Google Sheets - IT": {
      "main": [
        [
          {
            "node": "Notify IT Consultant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Strategy Consultant": {
      "main": [
        [
          {
            "node": "Send Welcome Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Management Consultant": {
      "main": [
        [
          {
            "node": "Send Welcome Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Onboarding Checklist": {
      "main": [
        [
          {
            "node": "Route by Project Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to Google Sheets - Strategy": {
      "main": [
        [
          {
            "node": "Notify Strategy Consultant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to Google Sheets - Management": {
      "main": [
        [
          {
            "node": "Notify Management Consultant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}