{
  "meta": {
    "instanceId": "e3c8407850ca9c3b141a39a03994d53d17d6a3c944ddd166e5f66eab0878c4c1",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "e47dea40-652d-4037-b767-fb408f856738",
      "name": "Create folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        220,
        -200
      ],
      "parameters": {
        "name": "={{ $json.name + \" - Onboarding\" }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "=1rCt7cyX7b3FQSJRDB8bRT4ho9QEUh0mA"
        },
        "resource": "folder"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "credential-id",
          "name": "googleDriveOAuth2Api Credential"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "c248ad7e-3560-4b08-b849-313134d3fd8b",
      "name": "Create a database page",
      "type": "n8n-nodes-base.notion",
      "position": [
        880,
        -40
      ],
      "parameters": {
        "title": "Clients",
        "options": {},
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "230bb34e-b122-800a-87e4-c5f2e30500b9",
          "cachedResultUrl": "https://www.notion.so/230bb34eb122800a87e4c5f2e30500b9",
          "cachedResultName": "Clients"
        },
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Name|title",
              "title": "={{ $json.name }}"
            },
            {
              "key": "Email|email",
              "emailValue": "={{ $json.email }}"
            },
            {
              "key": "Project Type|select",
              "selectValue": "={{ $json.projectType }}"
            },
            {
              "key": "Budget|select",
              "selectValue": "={{ $json.budget }}"
            },
            {
              "key": "Onboarding Link|url",
              "urlValue": "=https://drive.google.com/drive/folders/{{$json[\"id\"]}}"
            }
          ]
        }
      },
      "credentials": {
        "notionApi": {
          "id": "credential-id",
          "name": "notionApi Credential"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4540bdfe-a7c3-4ec9-ade8-8f5e23bd4655",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        420,
        -200
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0b77f413-5350-49a0-8138-316b47a714a4",
              "name": "uuid",
              "type": "string",
              "value": "={{ $execution.id }}"
            },
            {
              "id": "435421f5-f7c2-439d-84d1-929c55a72dd9",
              "name": "id",
              "type": "string",
              "value": "={{ $json.id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "dff64989-c132-456c-99e7-b8dcfdd294e7",
      "name": "Send a message",
      "type": "n8n-nodes-base.slack",
      "position": [
        1060,
        -40
      ],
      "webhookId": "9ad41590-9e81-4cb5-8cef-8365f05137e0",
      "parameters": {
        "text": "=🚀 New Client Onboarded!\n\n👤 Name: {{$json[\"property_name\"]}}  \n📧 Email: {{$json[\"property_email\"]}}  \n💼 Project Type: {{$json[\"property_project_type\"]}}  \n💰 Budget: {{$json[\"property_budget\"]}}  \n📂 Folder: {{$json[\"property_onboarding_link\"]}}  \n🔗 Notion Page: {{$json[\"url\"]}}\n",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#client-notifications"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "credential-id",
          "name": "slackOAuth2Api Credential"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "a78e08e7-f4f2-4f30-82ba-e3d2b8843d5b",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -220,
        -80
      ],
      "webhookId": "9b989159-6b7d-4b44-89ab-244a2f515dfc",
      "parameters": {
        "path": "/tally-submission",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "9225c3ad-2a66-4440-ba66-3b0b8ee92362",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        640,
        -40
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2,
      "alwaysOutputData": true
    },
    {
      "id": "5024846e-6d16-4a52-b35e-f35afdba65b5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1020,
        -200
      ],
      "parameters": {
        "color": 4,
        "width": 600,
        "height": 440,
        "content": " Client Onboarding Workflow – Setup Guide\n🎯 What this workflow does:\nAutomates client onboarding from a Tally form:\n\nCreates a Google Drive folder\n\nAdds client data to a Notion database\n\nSends a Slack notification to your team\n\n🔧 Manual Setup Instructions\n📥 Tally Form\n\nThis workflow listens for form submissions at:\nhttps://<your-n8n-domain>/webhook/tally-submission\n\nExpected fields: Name, Email, Project Type, Budget\n\n📂 Google Drive\n\nThe parent folder ID is hardcoded → update this:\n1rCt7cyX7b3FQSJRDB8bRT4ho9QEUh0mA\n\nAdd your Google OAuth2 credentials to the node.\n\n🧠 Notion\n\nDatabase ID is hardcoded → replace it with yours:\n230bb34e-b122-800a-87e4-c5f2e30500b9\n\nMake sure your database has fields:\nName, Email, Project Type, Budget, Onboarding Link\n\nAttach your Notion OAuth2 credentials.\n\n🔔 Slack\n\nThe channel #client-notifications is hardcoded → change it if needed.\n\nSlack OAuth2 is required to post messages.\n\n⚠️ This workflow uses hardcoded values (no env vars). Be sure to manually replace folder IDs, database IDs, and Slack channels with your own.\n\n✅ All nodes use OAuth2 — no API keys are exposed."
      },
      "typeVersion": 1
    },
    {
      "id": "c8ab7998-aa90-41f9-8b7d-3505f300777b",
      "name": "Extract Client Fields",
      "type": "n8n-nodes-base.code",
      "position": [
        240,
        80
      ],
      "parameters": {
        "jsCode": "const fields = $json.body.data.fields;\n\nlet result = {};\n\nfields.forEach(field => {\n  const label = field.label.toLowerCase();\n\n  if (label.includes('name')) {\n    result.name = field.value;\n  }\n\n  if (label.includes('email')) {\n    result.email = field.value;\n  }\n\n  if (label.includes('project')) {\n    const selectedId = field.value[0];\n    const option = field.options.find(opt => opt.id === selectedId);\n    result.projectType = option?.text || '';\n  }\n\n  if (label.includes('budget')) {\n    const selectedId = field.value[0];\n    const option = field.options.find(opt => opt.id === selectedId);\n    result.budget = option?.text || '';\n  }\n});\n\nreturn [{ json: result }];\n"
      },
      "typeVersion": 2
    }
  ],
  "pinData": {},
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Create a database page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Extract Client Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create folder": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Client Fields": {
      "main": [
        [
          {
            "node": "Create folder",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Create a database page": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}