Lark Attendance icon

Lark Attendance

Lark Attendance Management

Overview

The "Create Shifts" operation in the "Attendance Shift" resource of the Lark Attendance node allows users to define and create work shifts within the Lark Attendance Management system. This operation is useful for automating attendance scheduling by programmatically setting shift parameters such as flexible timing, punch rules, rest periods, and shift names.

Typical use cases include:

  • Automating shift creation for new teams or departments.
  • Integrating shift schedules with other HR or payroll systems.
  • Customizing attendance rules like late arrival penalties or flexible working hours.

For example, a company can use this node to create a shift named "Morning Shift" with specific punch-in/out times, flexible minutes allowance, and rest time rules, ensuring consistent attendance tracking across employees.

Properties

Name Meaning
Authentication Method of authentication to access the API: either using a Tenant Token or OAuth2.
Flexible Minutes Number of minutes allowed as flexibility in the shift start/end times.
Is Flexible Boolean indicating if the shift timing is flexible.
Late Off Late On Rule Collection of rules defining how many minutes late off or late on are allowed. Each item includes:
- late_off_minutes: Minutes allowed for late off.
- late_on_minutes: Minutes allowed for late on.
No Need Off Boolean indicating whether clocking out (off) is required for the shift.
Punch Time Rule Collection of rules defining punch time behavior. Each item includes:
- early_minutes_as_early
- early_minutes_as_lack
- late_minutes_as_lack
- late_minutes_as_late
- off_delay_minutes
- off_time (string)
- on_advance_minutes
- on_time (string)
Punch Times Number of punch times expected during the shift.
Rest Time Rule Collection of rest periods within the shift. Each item includes:
- rest_begin_time (string)
- rest_end_time (string)
Shift Name The name of the shift being created.
Use Custom Body Option to send a fully custom JSON body instead of using the predefined properties. When enabled, the Custom Body JSON field is used directly.
Custom Body A JSON object representing the entire request body for creating a shift. Used only if "Use Custom Body" is enabled.

Output

The node outputs JSON data representing the response from the Lark Attendance API after creating the shift(s). This typically includes details about the newly created shift such as its ID, name, and configured rules.

If binary data were involved (not indicated here), it would represent files or attachments related to the shift, but this node focuses on JSON data only.

Dependencies

  • Requires an active connection to the Lark Suite Open APIs.
  • Needs authentication via either a Tenant Token credential or OAuth2 credential.
  • The base URL for API requests is https://open.larksuite.com/open-apis.
  • Proper permissions in the Lark Attendance system to create shifts.

Troubleshooting

  • Authentication errors: Ensure that the selected authentication method is correctly configured and the token or OAuth credentials are valid and have sufficient permissions.
  • Invalid input data: If the API returns validation errors, verify that all required fields (e.g., shift_name) are provided and that numeric values are within acceptable ranges.
  • API rate limits: Frequent calls may hit rate limits; consider adding delays or batching requests.
  • Custom Body usage: When using the custom JSON body option, ensure the JSON structure matches the API specification exactly to avoid malformed request errors.

Links and References

Discussion