{
  "name": "\u63a1\u7528\u81ea\u52d5\u5316\u30ef\u30fc\u30af\u30d5\u30ed\u30fc",
  "nodes": [
    {
      "parameters": {
        "path": "recruitment-webhook",
        "httpMethod": "POST",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "webhook-node",
      "name": "Webhook - \u5fdc\u52df\u53d7\u4ed8",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "// \u5165\u529b\u30c7\u30fc\u30bf\u3092 Dify \u7528\u306b\u6574\u5f62\nconst formData = items[0].json.body;\n\nreturn [\n  {\n    json: {\n      inputs: {\n        job_type: formData.job_type || \"\u672a\u8a18\u5165\",\n        motivation: formData.motivation || \"\",\n        skills: formData.skills || \"\",\n        experience: formData.experience || \"\",\n        email: formData.email,\n        name: formData.name\n      },\n      response_mode: \"blocking\",\n      user: \"recruitment-system\"\n    }\n  }\n];"
      },
      "id": "function-node",
      "name": "Function - \u30c7\u30fc\u30bf\u6574\u5f62",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        500,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://dify-api:5001/v1/workflows/run",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": []
        },
        "jsonBody": "={{ JSON.stringify($json) }}",
        "options": {
          "timeout": 30000
        }
      },
      "id": "dify-api-node",
      "name": "HTTP Request - Dify API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        750,
        300
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.data.outputs.rank }}",
              "operation": "equals",
              "value2": "S"
            },
            {
              "value1": "={{ $json.data.outputs.rank }}",
              "operation": "equals",
              "value2": "A"
            }
          ],
          "combinator": "or"
        }
      },
      "id": "if-node",
      "name": "IF - \u30e9\u30f3\u30af\u5224\u5b9a",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        1000,
        300
      ]
    },
    {
      "parameters": {
        "channel": "#recruitment-alerts",
        "text": "\ud83d\udd25 \u6fc0\u30a2\u30c4\u306a\u5fdc\u52df\u304c\u6765\u307e\u3057\u305f\uff01\n\n\u540d\u524d: {{ $json.data.outputs.name }}\n\u30e9\u30f3\u30af: {{ $json.data.outputs.rank }}\n\u8981\u7d04: {{ $json.data.outputs.summary }}\n\u7406\u7531: {{ $json.data.outputs.reason }}\n\n\u8a73\u7d30\u306f Gmail \u306e\u4e0b\u66f8\u304d\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002",
        "otherOptions": {}
      },
      "id": "slack-node",
      "name": "Slack - \u6fc0\u30a2\u30c4\u901a\u77e5",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [
        1300,
        150
      ],
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "draft",
        "operation": "create",
        "subject": "={{ $json.data.outputs.email_subject }}",
        "message": "={{ $json.data.outputs.email_body }}\n\n---\n\u65e5\u7a0b\u8abf\u6574\u306f\u3053\u3061\u3089: https://calendly.com/your-link/30min",
        "toList": "={{ $json.data.outputs.email }}",
        "options": {}
      },
      "id": "gmail-node",
      "name": "Gmail - \u4e0b\u66f8\u304d\u4f5c\u6210",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [
        1300,
        350
      ],
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.GAS_WEB_APP_URL }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "jsonBody": "={{ JSON.stringify({ name: $json.data.outputs.name, email: $json.data.outputs.email, rank: $json.data.outputs.rank, summary: $json.data.outputs.summary, skills: $json.data.outputs.skills }) }}",
        "options": {}
      },
      "id": "gas-api-node",
      "name": "HTTP Request - GAS Web API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1300,
        550
      ]
    }
  ],
  "connections": {
    "Webhook - \u5fdc\u52df\u53d7\u4ed8": {
      "main": [
        [
          {
            "node": "Function - \u30c7\u30fc\u30bf\u6574\u5f62",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Function - \u30c7\u30fc\u30bf\u6574\u5f62": {
      "main": [
        [
          {
            "node": "HTTP Request - Dify API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request - Dify API": {
      "main": [
        [
          {
            "node": "IF - \u30e9\u30f3\u30af\u5224\u5b9a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF - \u30e9\u30f3\u30af\u5224\u5b9a": {
      "main": [
        [
          {
            "node": "Slack - \u6fc0\u30a2\u30c4\u901a\u77e5",
            "type": "main",
            "index": 0
          },
          {
            "node": "Gmail - \u4e0b\u66f8\u304d\u4f5c\u6210",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request - GAS Web API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "timezone": "Asia/Tokyo",
    "errorWorkflow": ""
  },
  "tags": [
    {
      "name": "recruitment",
      "createdAt": "2026-01-01T00:00:00.000Z",
      "updatedAt": "2026-01-01T00:00:00.000Z"
    }
  ]
}