π₯ Log daily department attendance to Lark Base with Lark
β‘ 5 views Β· π₯ HR & Recruitment
Description
Quick overview
This workflow runs daily (or manually) to pull attendance logs for all users in a Lark department via the Lark Open Platform APIs, then writes each userβs first check-in and last check-out into a Lark Base (Bitable) table in batches.
How it works
- Runs on a daily schedule at 23:30 or starts manually for testing.
- Requests a Lark tenant access token using your Lark app ID and app secret.
- Fetches the list of users in the configured Lark department.
- Calculates the current dayβs start and end timestamps in the configured timezone and prepares one query per user.
- Queries Lark Attendance for each userβs check-in/out flows within the day window.
- Consolidates results per user per day, keeping the first check-in and last check-out and deriving on-time/late and early-out statuses.
- Batch-creates records in the target Lark Base (Bitable) table with the attendance details.
Setup
- Create a Lark app with access to Contact, Attendance, and Bitable APIs, then fill in
app_idandapp_secretin Template Config. - Set your
department_id(open_department_id) in Template Config and adjustdepartmentPageSizeif needed. - Create or choose a Lark Base (Bitable) app and table, then set
bitable_AppTokenandbitable_TableIdin Template Config. - Ensure the target Bitable table has the required fields (Employee, Check In/Out Time, comments, location, Employee Code, and the two status single-select fields with the specified values).
- Optionally adjust
timezone,bitableBatchSize, and the check-in/check-out cutoff times in Template Config to match your attendance rules.
π Nodes Used
HTTP Request, Schedule Trigger
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File