{
  "name": "GW-Admin / Entry (n8n Form) / Milestone",
  "nodes": [
    {
      "parameters": {
        "formTitle": "\u5c08\u6848\u968e\u6bb5\u65e5\u671f\u65b0\u589e\u8868",
        "formDescription": "\u7528\u65bc\u65e2\u6709\u884c\u653f\u5c08\u6848\u5f8c\u7e8c\u65b0\u589e\u91cd\u8981\u65e5\u671f\u3001\u968e\u6bb5\u4efb\u52d9\u8207 Calendar \u63d0\u9192\u3002\u8acb\u5148\u5f9e\u884c\u653f\u5c08\u6848\u7e3d\u63a7\u8868\u78ba\u8a8d\u5c08\u6848\u7de8\u865f\u3002",
        "formFields": {
          "values": [
            {
              "fieldLabel": "\u5c08\u6848\u7de8\u865f",
              "placeholder": "\u8acb\u586b\u884c\u653f\u5c08\u6848\u7e3d\u63a7\u8868\u4e2d\u7684\u5c08\u6848\u7de8\u865f",
              "requiredField": true
            },
            {
              "fieldLabel": "\u5c08\u6848\u540d\u7a31",
              "requiredField": true
            },
            {
              "fieldLabel": "\u65e5\u671f\u985e\u578b",
              "fieldType": "dropdown",
              "requiredField": true,
              "fieldOptions": {
                "values": [
                  {
                    "option": "\u6821\u5167\u5354\u8abf\u6703"
                  },
                  {
                    "option": "\u7b2c\u4e00\u6b21\u6703\u8b70"
                  },
                  {
                    "option": "\u5831\u540d\u958b\u59cb\u65e5"
                  },
                  {
                    "option": "\u5831\u540d\u622a\u6b62\u65e5"
                  },
                  {
                    "option": "\u8cc7\u6599\u56de\u6536\u671f\u9650"
                  },
                  {
                    "option": "\u63a1\u8cfc\u671f\u9650"
                  },
                  {
                    "option": "\u7d93\u8cbb\u6838\u92b7\u671f\u9650"
                  },
                  {
                    "option": "\u6d3b\u52d5\u524d\u6aa2\u67e5\u65e5"
                  },
                  {
                    "option": "\u6b63\u5f0f\u6d3b\u52d5\u65e5\u671f"
                  },
                  {
                    "option": "\u7167\u7247\u8207\u6210\u679c\u8cc7\u6599\u56de\u6536\u65e5"
                  },
                  {
                    "option": "\u6210\u679c\u5831\u544a\u521d\u7a3f\u671f\u9650"
                  },
                  {
                    "option": "\u6210\u679c\u9001\u51fa\u671f\u9650"
                  },
                  {
                    "option": "\u7d50\u6848\u6aa2\u8a0e\u65e5"
                  },
                  {
                    "option": "\u5176\u4ed6"
                  }
                ]
              }
            },
            {
              "fieldLabel": "\u65e5\u671f",
              "fieldType": "date",
              "requiredField": true
            },
            {
              "fieldLabel": "\u63d0\u9192\u8a2d\u5b9a",
              "fieldType": "dropdown",
              "multiselect": true,
              "fieldOptions": {
                "values": [
                  {
                    "option": "\u7576\u5929\u63d0\u9192"
                  },
                  {
                    "option": "\u524d1\u5929\u63d0\u9192"
                  },
                  {
                    "option": "\u524d3\u5929\u63d0\u9192"
                  },
                  {
                    "option": "\u524d7\u5929\u63d0\u9192"
                  },
                  {
                    "option": "\u524d14\u5929\u63d0\u9192"
                  }
                ]
              }
            },
            {
              "fieldLabel": "\u8ca0\u8cac\u4eba",
              "requiredField": true
            },
            {
              "fieldLabel": "\u8ca0\u8cac\u4ebaEmail",
              "fieldType": "email",
              "requiredField": true
            },
            {
              "fieldLabel": "\u662f\u5426\u5beb\u5165\u5f85\u8fa6\u8ffd\u8e64\u8868",
              "fieldType": "dropdown",
              "requiredField": true,
              "fieldOptions": {
                "values": [
                  {
                    "option": "\u662f"
                  },
                  {
                    "option": "\u5426"
                  }
                ]
              }
            },
            {
              "fieldLabel": "\u662f\u5426\u5efa\u7acbCalendar\u63d0\u9192",
              "fieldType": "dropdown",
              "requiredField": true,
              "fieldOptions": {
                "values": [
                  {
                    "option": "\u662f"
                  },
                  {
                    "option": "\u5426"
                  }
                ]
              }
            },
            {
              "fieldLabel": "\u8aaa\u660e",
              "fieldType": "textarea"
            },
            {
              "fieldLabel": "\u5099\u8a3b",
              "fieldType": "textarea"
            }
          ]
        },
        "options": {}
      },
      "id": "form",
      "name": "\u5c08\u6848\u968e\u6bb5\u65e5\u671f\u65b0\u589e\u8868",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2,
      "position": [
        -800,
        0
      ]
    },
    {
      "parameters": {
        "content": "## n8n Form Trigger entry \u2014 Milestone\n\nForwards to `GW-Admin / Core / Milestone`. Fill `Config` with the same IDs you used for project-starter.",
        "height": 200,
        "width": 460,
        "color": 4
      },
      "id": "sticky",
      "name": "Notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -800,
        220
      ]
    },
    {
      "parameters": {
        "jsCode": "const config = {\n  ROOT_FOLDER_ID: 'YOUR_GOOGLE_DRIVE_ROOT_FOLDER_ID',\n  CONTROL_SHEET_ID: 'YOUR_CONTROL_SHEET_ID_FROM_SETUP',\n  CALENDAR_ID: 'primary',\n  ADMIN_EMAIL: 'admin@example.com',\n  TIMEZONE: 'Asia/Taipei'\n};\nconst data = { ...$input.first().json };\ndelete data.submittedAt;\ndelete data.formMode;\n// Multi-select \u63d0\u9192\u8a2d\u5b9a may come back as array; join into comma-separated to match Apps Script behaviour.\nif (Array.isArray(data['\u63d0\u9192\u8a2d\u5b9a'])) data['\u63d0\u9192\u8a2d\u5b9a'] = data['\u63d0\u9192\u8a2d\u5b9a'].join(', ');\nreturn [{ json: { data, config } }];\n"
      },
      "id": "config",
      "name": "Config + normalize",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -560,
        0
      ]
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "REPLACE_WITH_CORE_MILESTONE_WORKFLOW_ID",
          "mode": "id"
        },
        "workflowInputs": {
          "mappingMode": "passThrough"
        },
        "options": {}
      },
      "id": "call-core",
      "name": "Call core",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.2,
      "position": [
        -320,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const r = $input.first().json;\nreturn [{ json: { status: 'added', ...r } }];\n"
      },
      "id": "done",
      "name": "Done",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -80,
        0
      ]
    }
  ],
  "connections": {
    "\u5c08\u6848\u968e\u6bb5\u65e5\u671f\u65b0\u589e\u8868": {
      "main": [
        [
          {
            "node": "Config + normalize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config + normalize": {
      "main": [
        [
          {
            "node": "Call core",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call core": {
      "main": [
        [
          {
            "node": "Done",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": false
}