{
  "name": "Create manager tasks from Keephub form submissions with OpenAI GPT-4.1",
  "nodes": [
    {
      "id": "5f046833-986d-4b88-8047-e6bec5e006b6",
      "name": "Keephub Form Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        3696,
        3392
      ]
    },
    {
      "id": "747fd501-63b4-4996-bd5d-d3ffb1778ea2",
      "name": "📋 Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3344,
        2816
      ],
      "parameters": {
        "width": 540,
        "height": 800,
        "content": "## 📋 Keephub Form → AI Task Creator\n\n**What it does:**\nAutomatically creates intelligent follow-up tasks for managers when employees submit forms. AI analyzes the submission and generates a contextual"
      }
    },
    {
      "id": "9863427c-44d8-44fc-9c3d-d383cbddec57",
      "name": "🚦 Gate",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3888,
        3136
      ],
      "parameters": {
        "width": 440,
        "height": 476,
        "content": "## 🚦 Webhook Filter\n\n**Purpose:** Ensures only NEW form submissions trigger task creation.\n\n**Filters out:**\n• Status changes (approvals/rejections)\n• Edits to existing submissions\n• Any other webhook"
      }
    },
    {
      "id": "509db577-2764-4119-a3c0-477c9d413ef5",
      "name": "🔍 Context Resolution",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4320,
        3056
      ],
      "parameters": {
        "width": 2264,
        "height": 904,
        "content": "## 🔍 Data Collection & Target Resolution\n\n**1. Extract Form Data**\nNormalizes all field types (NodeSelector, Radio, Checkbox, Date, etc.) into a clean, indexed structure.\n\n**2. Get Submitter**\nFetches"
      }
    },
    {
      "id": "36b456a7-ab81-4e8c-806b-e326f9337b04",
      "name": "🤖 AI Task Design",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7056,
        3056
      ],
      "parameters": {
        "width": 1184,
        "height": 1136,
        "content": "## 🤖 AI-Powered Task Generation\n\n**1. Build AI Prompt**\nCreates a structured prompt with:\n• Form title and all submitted field values\n• Task design rules (language, field types, validation)\n• Instruct"
      }
    },
    {
      "id": "5bb25165-3a6e-458c-9363-07196a1fd88b",
      "name": "⚙️ Config Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6560,
        3056
      ],
      "parameters": {
        "width": 500,
        "height": 644,
        "content": "## ⚙️ Configuration\n\nEdit these values in the **⚙️ Config** node:\n\n**`groupId`** (string, recommended)\nKeephub group ID to target (e.g., \"65f8a3b2c1234567890abcde\").\n• **With groupId:** Task assigned "
      }
    },
    {
      "id": "57e1bcea-03b3-412b-bb3f-978c3d967c8a",
      "name": "Status Change?",
      "type": "n8n-nodes-base.if",
      "position": [
        3920,
        3392
      ]
    },
    {
      "id": "a6a5dfb7-2433-4811-bad6-b7a200f8c5fb",
      "name": "Is Edit?",
      "type": "n8n-nodes-base.if",
      "position": [
        4112,
        3472
      ]
    },
    {
      "id": "f237ae01-ee10-446a-8e58-282537441177",
      "name": "Extract Form Data",
      "type": "n8n-nodes-base.code",
      "position": [
        4384,
        3632
      ]
    },
    {
      "id": "35c784a5-9e78-4458-af10-60fa3ba40868",
      "name": "Get Submitter",
      "type": "n8n-nodes-keephub.keephub",
      "position": [
        4624,
        3632
      ]
    },
    {
      "id": "2885478b-5607-467a-8626-4bb031c6d2f0",
      "name": "Resolve Org Node",
      "type": "n8n-nodes-base.code",
      "position": [
        4864,
        3632
      ]
    },
    {
      "id": "e254d82c-1c2d-4f3f-9e25-c366d17c0cba",
      "name": "Get Parent Node",
      "type": "n8n-nodes-keephub.keephub",
      "position": [
        5104,
        3632
      ]
    },
    {
      "id": "993a4a4f-3e92-4fea-bd99-f57528dc44c8",
      "name": "Get Form Schema",
      "type": "n8n-nodes-keephub.keephub",
      "position": [
        6304,
        3552
      ]
    },
    {
      "id": "2ee0543f-fb0c-4c0b-8f2d-6117340b9cae",
      "name": "⚙️ Config",
      "type": "n8n-nodes-base.set",
      "position": [
        6768,
        3552
      ]
    },
    {
      "id": "e7335a47-6017-4b2d-a712-47c9b04db9f1",
      "name": "Build AI Prompt",
      "type": "n8n-nodes-base.code",
      "position": [
        7216,
        3552
      ]
    },
    {
      "id": "3315bc2d-0dc6-4838-a9b0-b4cf1a5c1696",
      "name": "Design Task with AI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        7408,
        3552
      ]
    },
    {
      "id": "c7a8f42f-9eb3-4e43-89ef-0c76537c4615",
      "name": "Compose Task",
      "type": "n8n-nodes-base.code",
      "position": [
        7696,
        3552
      ]
    },
    {
      "id": "1e90ce6e-bc35-4ce1-99e4-6ed2383ca0bc",
      "name": "Create Task",
      "type": "n8n-nodes-keephub.keephub",
      "position": [
        7936,
        3552
      ]
    },
    {
      "id": "86f33f87-089d-4681-beba-0e7330a0a875",
      "name": "Get Root Node",
      "type": "n8n-nodes-keephub.keephub",
      "position": [
        5344,
        3696
      ]
    },
    {
      "id": "11ae0758-4053-424a-80cf-af2d725f2154",
      "name": "⚠️ Group Targeting",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6560,
        3696
      ],
      "parameters": {
        "width": 500,
        "height": 496,
        "content": "## ⚠️ Critical: Group Targeting\n\n**Without `groupId` → task assigned to EVERYONE**\nManagers, employees, interns, contractors—all users on the parent node will see the task.\n\n**To target specific group"
      }
    },
    {
      "id": "1ce770a8-8ffb-40f2-8275-9d1753099a5b",
      "name": "Extract Parent Target",
      "type": "n8n-nodes-base.code",
      "position": [
        5344,
        3552
      ]
    },
    {
      "id": "fb288916-ad61-4d6a-bba3-a957fb9026bf",
      "name": "Extract Root Target",
      "type": "n8n-nodes-base.code",
      "position": [
        5584,
        3696
      ]
    }
  ],
  "connections": {
    "Is Edit?": {
      "main": [
        [],
        [
          {
            "node": "Extract Form Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compose Task": {
      "main": [
        [
          {
            "node": "Create Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Root Node": {
      "main": [
        [
          {
            "node": "Extract Root Target",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Submitter": {
      "main": [
        [
          {
            "node": "Resolve Org Node",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "⚙️ Config": {
      "main": [
        [
          {
            "node": "Build AI Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Status Change?": {
      "main": [
        [],
        [
          {
            "node": "Is Edit?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build AI Prompt": {
      "main": [
        [
          {
            "node": "Design Task with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Form Schema": {
      "main": [
        [
          {
            "node": "⚙️ Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Parent Node": {
      "main": [
        [
          {
            "node": "Extract Parent Target",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Root Node",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Resolve Org Node": {
      "main": [
        [
          {
            "node": "Get Parent Node",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Form Data": {
      "main": [
        [
          {
            "node": "Get Submitter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Design Task with AI": {
      "main": [
        [
          {
            "node": "Compose Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Root Target": {
      "main": [
        [
          {
            "node": "Get Form Schema",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keephub Form Webhook": {
      "main": [
        [
          {
            "node": "Status Change?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Parent Target": {
      "main": [
        [
          {
            "node": "Get Form Schema",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}