Actions38
- User Actions
- Department Actions
- User Group Actions
- User Group Member Actions
- Unit Actions
- Workforce Type Actions
- Custom User Field Actions
- Contact Scope Actions
Overview
The "Add A Workforce Type" operation in the Workforce Type resource allows users to create a new workforce type entry within the Lark Contacts system. This node is useful for organizations managing employee classifications or categories, enabling them to define and add custom workforce types programmatically.
Typical use cases include:
- Automating the addition of new workforce categories during HR onboarding processes.
- Synchronizing workforce types from external systems into Lark Contacts.
- Managing localized workforce type names through internationalization support.
Properties
Name | Meaning |
---|---|
Authentication | Method of authentication to access the API: either "Tenant Token" or "OAuth2". |
Content | The main content or name of the workforce type as a string. |
Enum Status | Numeric status code representing the state of the workforce type (e.g., active/inactive). |
Enum Type | Numeric type code categorizing the workforce type. |
I 18 N Content | Collection of localized content entries, each with a locale (language/region code) and value (localized string). Enables multi-language support for the workforce type name. |
Use Custom Body | Boolean flag indicating whether to send a fully custom JSON body instead of individual fields. |
Custom Body | When "Use Custom Body" is enabled, this JSON object is sent as the request body, allowing full customization of the payload. |
Output
The node outputs JSON data representing the response from the Lark Contacts API after adding the workforce type. This typically includes details of the newly created workforce type such as its ID, content, status, type, and any localized content provided.
No binary data output is involved in this operation.
Dependencies
- Requires an API key credential for authentication, either via a Tenant Token or OAuth2.
- The node communicates with the Lark Suite Open APIs at
https://open.larksuite.com/open-apis
. - Proper configuration of credentials in n8n is necessary to authenticate requests.
Troubleshooting
- Authentication errors: Ensure that the correct authentication method is selected and that the provided token or OAuth2 credentials are valid and have sufficient permissions.
- Invalid input data: If the API returns validation errors, verify that required fields like
content
,enum_status
, andenum_type
are correctly set and conform to expected formats. - Custom Body issues: When using the custom body option, ensure the JSON structure matches the API specification exactly; malformed JSON or missing required fields will cause errors.
- Localization problems: For
i18n_content
, confirm that each item includes bothlocale
andvalue
fields properly filled to avoid incomplete localization data.