8
n8n 中文网amn8n.com

通过GPS记录建筑工人签到时的工地考勤

中级

这是一个HR领域的自动化工作流,包含 8 个节点。主要使用 Webhook, Function, EmailSend, GoogleSheets 等节点。 通过地理围栏、Google Sheets和邮件提醒自动化建筑工地考勤跟踪

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "zgVjyTFdUx4JfRnv",
  "meta": {
    "instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
    "templateCredsSetupCompleted": true
  },
  "name": "通过GPS记录建筑工人签到时的工地考勤",
  "tags": [],
  "nodes": [
    {
      "id": "e15aaea0-7665-41dd-b05a-eda638e0550e",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -320,
        40
      ],
      "webhookId": "thaltej-attendance-webhook",
      "parameters": {
        "path": "geofence-thaltej-attendance",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "id": "9958bc29-4e65-4996-86cb-a3cb9fc2cf3b",
      "name": "验证地理围栏并格式化日志",
      "type": "n8n-nodes-base.function",
      "position": [
        -100,
        40
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b0803efa-f662-4071-8752-c47dec49eb98",
      "name": "发送邮件",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        340,
        40
      ],
      "webhookId": "e3d3059b-ff06-4978-b548-7cd0da1bbc59",
      "parameters": {
        "text": "=Hello,\n\nThe attendance sheet has been successfully updated for today.\n\nPlease review the latest punch-in and punch-out entries to ensure everything is in order.\n\n🗓️ Date: {{new Date().toLocaleDateString()}} \n📍 Location: Construction Site (Geofenced)\n\nYou can access the updated sheet here: [Insert Sheet Link]\n\nRegards,  \nn8n Automation System  \n",
        "options": {},
        "subject": "📋 Daily Attendance Updated – Please Review",
        "toEmail": "abcd@gmail.com",
        "fromEmail": "abc@gmail.com",
        "emailFormat": "text"
      },
      "credentials": {
        "smtp": {
          "id": "G1kyF8cSWTZ4vouN",
          "name": "SMTP -test"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "ab599b4d-b6da-458b-967f-8c7a7ad1214e",
      "name": "将数据追加到表格中",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        120,
        40
      ],
      "parameters": {
        "range": "Attendance!A:D",
        "options": {},
        "sheetId": "your_google_sheet_id",
        "operation": "append"
      },
      "credentials": {
        "googleApi": {
          "id": "ScSS2KxGQULuPtdy",
          "name": "Google Sheets- test"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4930e9c8-9e6a-4b31-bcef-717b09c2ef51",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -160
      ],
      "parameters": {
        "color": 6,
        "width": 180,
        "height": 340,
        "content": "接收来自移动端输入(如Google Form或WhatsApp)的签到/签退请求。携带GPS坐标和工人信息。"
      },
      "typeVersion": 1
    },
    {
      "id": "9a36eeaf-b4c8-4e0f-a96b-b4fee8e3be52",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -140,
        -160
      ],
      "parameters": {
        "color": 4,
        "width": 180,
        "height": 340,
        "content": "使用Google Maps API验证工人位置是否在工地地理围栏区域内。同时格式化包含打卡类型、时间和日期的日志。"
      },
      "typeVersion": 1
    },
    {
      "id": "5ed902d5-ce69-4b2b-a532-3cd5c2a8e271",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -160
      ],
      "parameters": {
        "color": 3,
        "width": 180,
        "height": 340,
        "content": "将验证通过的打卡记录追加到Google Sheets中,用于考勤跟踪和报告。"
      },
      "typeVersion": 1
    },
    {
      "id": "ab0ecb3a-53cf-4d58-9196-de9e4134a0e7",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        300,
        -160
      ],
      "parameters": {
        "color": 5,
        "width": 180,
        "height": 340,
        "content": "发送包含考勤详情的通知邮件,或在位置无效时发送警报。"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8d45bac2-3103-430c-a9ab-9f12168e48f2",
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Validate Geofence & Format Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append data to a sheet": {
      "main": [
        [
          {
            "node": "Send email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Geofence & Format Log": {
      "main": [
        [
          {
            "node": "Append data to a sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 人力资源

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量8
分类1
节点类型5
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Oneclick AI Squad

Oneclick AI Squad

@oneclick-ai

The AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.

外部链接
在 n8n.io 查看

分享此工作流