### Start Local Development Server Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/QUICK_REFERENCE.md Starts a local development server for the Feishu node project, enabling live reloading and testing. ```bash npm run dev # Local development server ``` -------------------------------- ### RespondToFeishu Example Configuration Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/CORE_CLASSES.md Provides an example configuration for the RespondToFeishu node, demonstrating how to set response types, JSON payloads, toast messages, and output branches. ```typescript { responseType: 'custom', jsonResponse: { "type": "toast", "data": { "title": "Processing complete", "content": "Request handled successfully" } }, toast: "Workflow executed", outputBranches: true } ``` -------------------------------- ### Batching Option Configuration Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/CONFIGURATION.md Provides an example configuration for batching options, including batch size and interval. This enables parallel execution and rate limiting. ```typescript { options: { timeout: 5000, batching: { batch: { batchSize: 20, batchInterval: 100 // 100ms between batches } } } } ``` -------------------------------- ### FeishuNodeTrigger Example Configuration Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/CORE_CLASSES.md An example configuration for the FeishuNodeTrigger, demonstrating how to subscribe to specific event types like messages and card clicks, and configure response modes and timeouts. ```typescript // Listening to messages and card clicks { authentication: 'feishuNodeCredentialsApi', events: ['im.message.receive_v1', 'card.action.trigger'], responseMode: 'responseNode', options: { responseTimeout: 2500 } } ``` -------------------------------- ### Batch Create Records Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/BITABLE_MODULE.md Provides an example of the payload structure for batch creating records in a Feishu BITABLE. Use this when adding multiple new records simultaneously. ```typescript { base_id: 'bascxxxxxx', table_id: 'tblxxxxxx', records: [ { fields: { "fld_xxxxx": "Item 1", "fld_yyyyy": 10 } }, { fields: { "fld_xxxxx": "Item 2", "fld_yyyyy": 20 } } ] } ``` -------------------------------- ### Create Record Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/BITABLE_MODULE.md Example of a request body to add a new record to a Feishu BITABLE. Includes text, number, and select field types. ```typescript { base_id: 'bascxxxxxx', table_id: 'tblxxxxxx', fields: { "fld_xxxxx": "John Doe", // Text field "fld_yyyyy": 100, // Number field "fld_zzzzz": "option_id_1" // Select field } } ``` -------------------------------- ### Start Skill Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Invokes an AI skill with specified parameters. ```APIDOC ## POST /open-apis/aily/v1/skills/{skill_id}/invoke ### Description Starts and invokes an AI skill, passing any necessary input parameters. ### Method POST ### Endpoint /open-apis/aily/v1/skills/{skill_id}/invoke ### Parameters #### Path Parameters - **skill_id** (string) - Required - The identifier of the AI skill to start. #### Request Body - **parameters** (object) - Optional - Input parameters required by the AI skill. ``` -------------------------------- ### List Views Response Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/BITABLE_MODULE.md This is an example of the response structure when listing all views within a table using the `bitable:list_views` operation. It includes view details and pagination information. ```typescript { items: Array<{ view_id: string; name: string; type: string; // grid, gantt, kanban, gallery, form }>; page_token?: string; } ``` -------------------------------- ### Feishu Node Rate Limiting Configuration Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/CONFIGURATION.md Configure batch size and interval to manage Feishu API rate limits. This example demonstrates settings for approximately 1000 items within a 500 requests per minute limit. ```text batchSize: 10 batchInterval: 100ms = 100 batches × 100ms = ~10 seconds = Within rate limit ``` -------------------------------- ### Run n8n-Feishu Node Development Server Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/README.md Starts the n8n-node development server for local testing and iteration. ```bash npm run dev # Runs n8n-node dev server for local testing ``` -------------------------------- ### Upload Image Operation Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/MESSAGE_MODULE.md This example demonstrates how to structure the request payload for the message:image_upload operation. It specifies the resource, operation, and the source of the image file. ```typescript { resource: 'message', operation: 'message:image_upload', image_file: 'data from file input node' } ``` -------------------------------- ### Create Single-Select Field Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/BITABLE_MODULE.md Example of creating a single-select field in a BITABLE. Specifies the field name, type code for single select, and the available options with their names and colors. ```typescript // Create single-select field { base_id: 'bascxxxxxx', table_id: 'tblxxxxxx', name: 'Status', type: 3, // single select property: { options: [ { name: 'Open', color: 0 }, { name: 'In Progress', color: 1 }, { name: 'Done', color: 2 } ] } } ``` -------------------------------- ### Manual Pagination Setup Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/QUICK_REFERENCE.md Configure manual pagination by setting `page_size` for the number of items per request and using `page_token` to manage subsequent requests. ```typescript page_size: 50 // Items per request page_token: '' // Empty for first request // In next call: page_token: 'token_from_previous' // Use returned token ``` -------------------------------- ### Update Field Response Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/BITABLE_MODULE.md This is an example of the response structure when a field's properties are successfully updated using the `bitable:update_field` operation. ```typescript { field_id: string; name: string; type: number; property: { ... }; } ``` -------------------------------- ### ResourceFactory Example Usage Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/CORE_CLASSES.md Illustrates how to use the ResourceFactory to build a ResourceBuilder and retrieve specific operation call methods, typically within a Feishu n8n node's implementation. ```typescript // In FeishuNode.node.ts const resourceBuilder = ResourceFactory.build(__dirname); // resourceBuilder.getCall('message', 'message:send') returns MessageSendOperate.call ``` -------------------------------- ### Upload Image Response Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/MESSAGE_MODULE.md This TypeScript snippet illustrates the response format after successfully uploading an image. It provides the image_key required for embedding the image in messages. ```typescript { image_key: string; // Key for use in image messages } ``` -------------------------------- ### ResourceBuilder Property Structure Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/CORE_CLASSES.md Illustrates the structure of the INodeProperties array generated by the build() method, including resource, operation, and parameter properties. ```typescript [ { displayName: 'Resource', name: 'resource', options: [...] }, { displayName: 'Operation', name: 'operation', displayOptions: { show: { resource: ['message'] } }, ... }, { displayName: 'Receive ID Type', name: 'receive_id_type', displayOptions: { show: { resource: ['message'], operation: ['message:send'] } }, ... }, // ... more properties ] ``` -------------------------------- ### Feishu Trigger Node - Callback Toast Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/CONFIGURATION.md Illustrates how a user perceives a toast message when interacting with a card, configured via the 'callbackToast' option in immediately response mode. ```text User sees: [Toast message] when card is clicked ``` -------------------------------- ### Rate Limit Prevention Calculation Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/README.md Provides an example calculation for setting batch size and interval to avoid rate limits. This configuration ensures that the number of requests per minute does not exceed the limit. ```text 1000 items, 500 req/min limit: batchSize: 20 batchInterval: 100ms = 50 batches × 100ms = ~5 seconds ``` -------------------------------- ### Get All Blocks Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Retrieves all blocks within a specified document. ```APIDOC ## GET /open-apis/docs/v1/documents/{doc_id}/blocks ### Description Gets all blocks within a document. ### Method GET ### Endpoint /open-apis/docs/v1/documents/{doc_id}/blocks ### Parameters #### Path Parameters - **doc_id** (string) - Required - The ID of the document. ``` -------------------------------- ### Get Space Info Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Retrieves detailed information about a specific wiki space. ```APIDOC ## GET /open-apis/wiki/v2/spaces/{space_id} ### Description Retrieves detailed information about a specific wiki space. ### Method GET ### Endpoint /open-apis/wiki/v2/spaces/{space_id} ### Parameters #### Path Parameters - **space_id** (string) - Required - The ID of the space to retrieve information for. ``` -------------------------------- ### Get File Info Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Retrieves information about a specific file in Feishu. ```APIDOC ## GET /open-apis/aily/v1/files/{file_id} ### Description Retrieves information about a specific file using its ID. ### Method GET ### Endpoint /open-apis/aily/v1/files/{file_id} ### Parameters #### Path Parameters - **file_id** (string) - Required - The ID of the file to retrieve. ``` -------------------------------- ### Fetch All Messages in a Conversation (Feishu) Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/MESSAGE_MODULE.md Example demonstrating how to fetch all messages within a conversation using the message:list operation with automatic pagination enabled by 'return_all: true'. ```typescript // Fetches all messages in conversation with automatic pagination { resource: 'message', operation: 'message:list', container_id_type: 'chat', container_id: 'oc_xxxxx', return_all: true } ``` -------------------------------- ### ResourceOptions Type Definition and Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/TYPES_AND_INTERFACES.md Defines the structure for a resource module that appears in the Resource dropdown. Use this to group related operations under a single selectable resource. ```typescript type ResourceOptions = INodePropertyOptions & { order?: number; } ``` ```typescript const MessageResource: ResourceOptions = { name: 'Messages', value: 'message', description: 'Send and manage messages', order: 70 } ``` -------------------------------- ### Feishu File Upload Response Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/MESSAGE_MODULE.md This TypeScript snippet shows the expected response structure when uploading a file to Feishu. It includes the file_key which is essential for referencing the uploaded file in subsequent operations. ```typescript { file_key: string; // Key for use in file messages } ``` -------------------------------- ### Content Parameter Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/CONFIGURATION.md Defines a parameter for message content, which can be in JSON format or plain text. It is required and has a default empty value. ```typescript { displayName: 'Message Content', name: 'content', type: 'json', // or 'string' for text required: true, default: '', description: 'Message content in JSON format' } ``` -------------------------------- ### Selector Parameter Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/CONFIGURATION.md Defines an options-based parameter for selecting a message type. It is required and has a default value of 'text'. ```typescript { displayName: 'Message Type', name: 'msg_type', type: 'options', required: true, default: 'text', options: [ { name: 'Text', value: 'text' }, { name: 'Image', value: 'image' }, { name: 'Card', value: 'interactive' } ] } ``` -------------------------------- ### Feishu Application-Level Credentials Configuration Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/CONFIGURATION.md Example configuration for Feishu Application-Level credentials. This includes the API endpoint, App ID, App Secret, and a placeholder for the cached access token. ```typescript { url: 'https://open.feishu.cn', appid: 'cli_a0a1b2c3d4e5f6g7h8', appsecret: 'YOUR_SECRET_KEY', baseURL: 'https://open.feishu.cn', accessToken: 't-xxx_cached_token_xxx' // Auto-populated } ``` -------------------------------- ### Aily Module Key Parameters Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Details the key parameters required for specific Aily module operations like Upload File and Start Skill. Ensure these parameters are correctly formatted before making API calls. ```markdown **Upload File**: - `file` - Binary file data - `file_name` - Original filename **Start Skill**: - `skill_id` - AI skill identifier - `parameters` - Skill input parameters ``` -------------------------------- ### Bitable Module Operations Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/INDEX.txt Documentation for 26 table operations, including base management, table CRUD, field management, view operations, record CRUD, and batch operations. Provides complete query and filter examples. ```APIDOC ## Bitable Module Operations ### Description This module offers comprehensive functionality for managing Feishu Bitable bases and tables. It includes operations for base creation, copying, and metadata retrieval, as well as full CRUD (Create, Read, Update, Delete) capabilities for tables, fields, and records. Support for batch operations and advanced querying/filtering is also provided. ### Supported Operations - Base Management (Create, Copy, Metadata) - Table CRUD (Create, Read, Update, Delete) - Table List Operations - Field Management (Create, Update, Delete, List) - View Operations - Record CRUD (Create, Read, Update, Delete) - Record Batch Operations ### Parameters Complete query and filter examples are available for all operations. ``` -------------------------------- ### Dropdown and Basic Parameter Types Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/QUICK_REFERENCE.md Example of defining message types, recipient ID types, and container ID types for dropdown selections, alongside required string/number parameters like recipient ID and page size. ```typescript msg_type: 'text' // Options from list receive_id_type: 'open_id' container_id_type: 'chat' ``` ```typescript receive_id: 'ou_xxxxx' // Must provide value page_size: 50 ``` -------------------------------- ### Get View Configuration Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/BITABLE_MODULE.md Retrieves the configuration and metadata for a specific view in a Feishu BITABLE. Requires base ID, table ID, and view ID. ```typescript { view_id: string; name: string; type: string; filter: { ... }; // Filter definition if present sort: { ... }; // Sort definition if present } ``` -------------------------------- ### Delete Field Response Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/BITABLE_MODULE.md This is an example of the response structure when a field is successfully deleted using the `bitable:delete_field` operation. ```typescript { field_id: string; deleted: boolean; } ``` -------------------------------- ### High-Level Request Example (Success) Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/UTILITY_MODULES.md Use request for high-level HTTP requests that include response processing, error handling, and auto-retry. It extracts data from successful responses. ```typescript // Successful response: { code: 0, data: { message_id: '...' } } const result = await RequestUtils.request.call(context, { method: 'POST', url: '/open-apis/im/v1/messages', body: { /* ... */ } }); // Returns: { message_id: '...' } (data field extracted) ``` -------------------------------- ### Get View Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/BITABLE_MODULE.md Retrieves the configuration and metadata for a specific view within a Bitable table. This includes details like the view's ID, name, type, and any associated filters or sorting configurations. ```APIDOC ## Get View ### Description Retrieves view configuration and metadata. ### Method GET ### Endpoint /bitable/get_view ### Parameters #### Query Parameters - **base_id** (string) - Required - Base ID - **table_id** (string) - Required - Table ID - **view_id** (string) - Required - View ID ### Response #### Success Response (200) - **view_id** (string) - The ID of the view. - **name** (string) - The display name of the view. - **type** (string) - The type of the view (e.g., 'grid', 'kanban'). - **filter** (object) - Filter definition if present. - **sort** (object) - Sort definition if present. ``` -------------------------------- ### Example Invalid User/Chat ID Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/ERROR_HANDLING.md Illustrates an example of an invalid `receive_id` and `receive_id_type` combination leading to a 'User/Chat Not Found' error (code 1037001). ```text receive_id_type: 'open_id' receive_id: 'invalid_id_12345' → Error: User not found ``` -------------------------------- ### WSClient Constructor Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/UTILITY_MODULES.md Initializes a WebSocket client for real-time event streaming from Feishu. It requires application credentials and optional configuration for domain, logging, and reconnection. ```APIDOC ## WSClient Constructor ### Description Initializes a WebSocket client for real-time event streaming from Feishu. It requires application credentials and optional configuration for domain, logging, and reconnection. ### Parameters - **appId** (string) - Required - Feishu application ID - **appSecret** (string) - Required - Feishu application secret - **domain** (string | Domain) - Optional - API endpoint (e.g., 'https://open.feishu.cn') - **logger** (Logger) - Required - n8n logger instance - **helpers** (RequestHelperFunctions) - Required - HTTP utilities - **autoReconnect** (boolean) - Optional - Enable automatic reconnection (default true) - **agent** (any) - Optional - HTTP agent for proxy support ``` -------------------------------- ### Feishu Pagination Options Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/README.md Demonstrates how to handle pagination for operations returning large result sets. 'return_all' automatically fetches all pages. ```typescript return_all: true // Automatically fetch all pages ``` ```typescript page_size: 50 page_token: 'token_from_previous' ``` -------------------------------- ### Run Development Server Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/PROJECT_OVERVIEW.md Runs the n8n-node dev server for local testing. ```bash npm run dev ``` -------------------------------- ### Common Node Parameter Retrieval Patterns Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/UTILITY_MODULES.md Illustrates various ways to get node parameter values using direct n8n methods, including getting with defaults, typed values, and accessing nested fields. ```typescript // Get parameter value const value = this.getNodeParameter('paramName', index); // Get with default const value = this.getNodeParameter('paramName', index, defaultValue); // Get typed value const value = this.getNodeParameter('paramName', index) as string; // Get entire options collection const options = this.getNodeParameter('options', index, {}); // Access nested field const batchSize = (options as any)?.batching?.batch?.batchSize ?? 50; ``` -------------------------------- ### Build Project Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/PROJECT_OVERVIEW.md Compiles TypeScript, bundles operation modules, and copies protocol buffer definitions. ```bash npm run build ``` -------------------------------- ### WSClient Constructor Parameters Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/UTILITY_MODULES.md Defines the parameters required to initialize the WSClient for establishing a WebSocket connection to Feishu. Includes authentication, API endpoint, and optional reconnection settings. ```typescript constructor(params: IConstructorParams) { const {appId, appSecret, domain, logger, helpers, autoReconnect = true, agent} = params; // ... ``` -------------------------------- ### Get Document Content Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Retrieves the formatted content of a document. ```APIDOC ## GET /open-apis/docs/v1/documents/{doc_id}/content ### Description Gets the formatted content of a document. ### Method GET ### Endpoint /open-apis/docs/v1/documents/{doc_id}/content ### Parameters #### Path Parameters - **doc_id** (string) - Required - The ID of the document. ``` -------------------------------- ### Get Skill Info Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Retrieves information about a specific AI skill. ```APIDOC ## GET /open-apis/aily/v1/skills/{skill_id} ### Description Retrieves detailed information about a specific AI skill using its identifier. ### Method GET ### Endpoint /open-apis/aily/v1/skills/{skill_id} ### Parameters #### Path Parameters - **skill_id** (string) - Required - The identifier of the AI skill. ``` -------------------------------- ### IBatchConfig Interface Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/TYPES_AND_INTERFACES.md Configuration for batch execution, including whether it's enabled, the batch size, and the interval between batches. ```typescript interface IBatchConfig { enabled: boolean; batchSize: number; batchInterval: number; } ``` -------------------------------- ### List Views Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/BITABLE_MODULE.md Lists all available views (grid, Gantt, kanban, etc.) within a Bitable table, with support for pagination. ```APIDOC ## List Views ### Description Lists all views in a table (grid, Gantt, kanban, etc.). Supports All pagination. ### Method GET ### Endpoint /bitable/list_views ### Parameters #### Query Parameters - **base_id** (string) - Yes - Base ID - **table_id** (string) - Yes - Table ID - **page_size** (number) - No - Items per page (default: 50) - **page_token** (string) - No - Pagination token ### Response #### Success Response (200) - **items** (Array) - Description - **view_id** (string) - Description - **name** (string) - Description - **type** (string) - Description (grid, gantt, kanban, gallery, form) - **page_token** (string) - Optional - Pagination token ### Response Example ```json { "items": [ { "view_id": "string", "name": "string", "type": "grid" } ], "page_token": "string" } ``` ``` -------------------------------- ### Get Folder Meta Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Retrieves metadata for a specific folder in Feishu Drive. ```APIDOC ## GET /open-apis/drive/v1/files/{folder_token} ### Description Retrieves metadata for a specific folder in Feishu Drive. ### Method GET ### Endpoint /open-apis/drive/v1/files/{folder_token} ### Parameters #### Path Parameters - **folder_token** (string) - Required - The token of the folder ### Response #### Success Response (200) - **field1** (type) - Description ``` -------------------------------- ### Get File Statistics Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Retrieves statistics for a specific file in Feishu Drive. ```APIDOC ## GET /open-apis/drive/v1/files/{file_token}/statistics ### Description Retrieves statistics for a specific file in Feishu Drive. ### Method GET ### Endpoint /open-apis/drive/v1/files/{file_token}/statistics ### Parameters #### Path Parameters - **file_token** (string) - Required - The token of the file ### Response #### Success Response (200) - **field1** (type) - Description ``` -------------------------------- ### Parallel Execution Flow with Batching Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/README.md Demonstrates parallel execution using batching to improve throughput while respecting rate limits. Items are processed concurrently within batches, with configurable intervals between batches. ```text Items: [A, B, C, D, E] Batch Size: 2 ↓ Batch 1: [A, B] (concurrent) → [Output A, Output B] ↓ Wait 100ms ↓ Batch 2: [C, D] (concurrent) → [Output C, Output D] ↓ Wait 100ms ↓ Batch 3: [E] → [Output E] ``` -------------------------------- ### Get Block Content Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Fetches the content of a specific block using its ID. ```APIDOC ## GET /open-apis/docs/v1/blocks/{block_id}/content ### Description Gets the content of a specific block. ### Method GET ### Endpoint /open-apis/docs/v1/blocks/{block_id}/content ### Parameters #### Path Parameters - **block_id** (string) - Required - The ID of the block. ``` -------------------------------- ### Optional and JSON Content Parameters Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/QUICK_REFERENCE.md Demonstrates how to handle optional parameters by setting them to undefined or an empty string, and how to structure JSON content for parameters like 'content' and 'post_content'. ```typescript description: undefined // Can leave empty page_token: '' // Pagination only ``` ```typescript content: { // Parse as JSON "text": "Hello" } post_content: { "zh_cn": { "title": "...", "content": [...] } } ``` -------------------------------- ### Get File Access Records Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Retrieves access records for a file in Feishu Drive. ```APIDOC ## GET /open-apis/drive/v1/files/{file_token}/view_records ### Description Retrieves access records for a file in Feishu Drive. ### Method GET ### Endpoint /open-apis/drive/v1/files/{file_token}/view_records ### Parameters #### Path Parameters - **file_token** (string) - Required - The token of the file ### Response #### Success Response (200) - **field1** (type) - Description ``` -------------------------------- ### Feishu Node Project Build Output Structure Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/QUICK_REFERENCE.md Illustrates the directory structure of the compiled Feishu node project, showing the location of node files and credentials. ```text dist/ ├── nodes/ │ ├── FeishuNode/ │ │ ├── FeishuNode.node.js │ │ ├── FeishuNodeTrigger.node.js │ │ └── RespondToFeishu.node.js │ └── help/ └── credentials/ ├── FeishuNodeCredentialsApi.credentials.js └── FeishuNodeOauth2Api.credentials.js ``` -------------------------------- ### Get Document Info Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Retrieves basic information about a specific document using its ID. ```APIDOC ## GET /open-apis/docs/v1/documents/{doc_id} ### Description Gets information about a specific document. ### Method GET ### Endpoint /open-apis/docs/v1/documents/{doc_id} ### Parameters #### Path Parameters - **doc_id** (string) - Required - The ID of the document. ``` -------------------------------- ### Get Message Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/MESSAGE_MODULE.md Retrieves the full content and metadata of a specific message using its ID. ```APIDOC ## Get Message ### Description Retrieves full content and metadata of a specific message. ### Method GET ### Endpoint /open-apis/im/v1/messages/{message_id} ### Parameters #### Path Parameters - **message_id** (string) - Yes - Message ID to retrieve #### Query Parameters - **user_id_type** (string) - No - Format for user IDs in response: `open_id`, `union_id`, `user_id` - **timeout** (number) - No - Request timeout in milliseconds ### Response #### Success Response (200) - **message_id** (string) - **create_time** (string) - **update_time** (string) - **chat_id** (string) - **sender** (object) - **id** (string) - **id_type** (string) - **sender_type** (string) - user, bot, app - **msg_type** (string) - **content** (string) - JSON-encoded content - **mentions** (array) - **key** (string) - **id** (string) - **id_type** (string) - **name** (string) - **quote** (object) - **message_id** (string) - **thread_id** (string) - Optional - If in a thread ### Response Example ```json { "message_id": "string", "create_time": "string", "update_time": "string", "chat_id": "string", "sender": { "id": "string", "id_type": "string", "sender_type": "user" }, "msg_type": "string", "content": "string", "mentions": [ { "key": "string", "id": "string", "id_type": "string", "name": "string" } ], "quote": { "message_id": "string" }, "thread_id": "string" } ``` ``` -------------------------------- ### Configure Batching Options Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/QUICK_REFERENCE.md Enable batching to send concurrent requests with rate limit protection. Configure the 'Items per Batch' (10-50) and 'Batch Interval (ms)' (100-1000) in the node's Options section. ```text Batching option enabled: 1. Add "Options" section to node 2. Open "Batching" subsection 3. Set "Items per Batch": 10-50 4. Set "Batch Interval (ms)": 100-1000 Effect: Concurrent requests with rate limit protection ``` -------------------------------- ### Get Node Info Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Retrieves detailed information about a specific node within a wiki space. ```APIDOC ## GET /open-apis/wiki/v2/spaces/{space_id}/nodes/{node_id} ### Description Retrieves detailed information about a specific node within a wiki space. ### Method GET ### Endpoint /open-apis/wiki/v2/spaces/{space_id}/nodes/{node_id} ### Parameters #### Path Parameters - **space_id** (string) - Required - The ID of the space containing the node. - **node_id** (string) - Required - The ID of the node to retrieve information for. ``` -------------------------------- ### Compile and Bundle Feishu Node Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/QUICK_REFERENCE.md Compiles and bundles the Feishu node project for deployment. ```bash npm run build # Compile and bundle ``` -------------------------------- ### Get Root Folder Meta Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Retrieves metadata for the root folder of a Feishu Drive space. ```APIDOC ## GET /open-apis/drive/v1/spaces/get_space_root ### Description Retrieves metadata for the root folder of a Feishu Drive space. ### Method GET ### Endpoint /open-apis/drive/v1/spaces/get_space_root ### Response #### Success Response (200) - **field1** (type) - Description ``` -------------------------------- ### Lint Project Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/PROJECT_OVERVIEW.md Runs the linter to check code style and fix issues. ```bash npm run lint ``` ```bash npm run lintfix ``` -------------------------------- ### Get Document Content (Raw) Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Fetches the raw content of a document, useful for processing or exporting. ```APIDOC ## GET /open-apis/docs/v1/documents/{doc_id}/raw_content ### Description Gets the raw content of a document. ### Method GET ### Endpoint /open-apis/docs/v1/documents/{doc_id}/raw_content ### Parameters #### Path Parameters - **doc_id** (string) - Required - The ID of the document. ``` -------------------------------- ### Get Record by ID Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/BITABLE_MODULE.md Retrieves a specific record from a table using its unique record ID. ```APIDOC ## Get Record by ID ### Description Retrieves a specific record by its ID. ### Method GET (Assumed based on operation type) ### Endpoint /api/v1/bitable/records/{record_id} ### Parameters #### Path Parameters - **record_id** (string) - Required - Record ID #### Query Parameters - **base_id** (string) - Required - Base ID - **table_id** (string) - Required - Table ID - **user_id_type** (string) - Optional - User ID format ### Response #### Success Response (200) - **items** (Array) - Array containing a single record object (same structure as search_records item). - **page_token** (string) - Optional - Token for the next page of results (usually null for single record retrieval). - **has_more** (boolean) - Indicates if there are more results available (usually false for single record retrieval). ### Response Example ```json { "items": [ { "record_id": "rec123", "create_time": 1678886400, "update_time": 1678886400, "created_by": {"id": "user1", "name": "Alice"}, "updated_by": {"id": "user1", "name": "Alice"}, "fields": {"fldA": "valueA", "fldB": 123} } ], "page_token": null, "has_more": false } ``` ``` -------------------------------- ### Build and Development Scripts Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/CONFIGURATION.md Defines the npm scripts for building, developing, and linting the project, utilizing the n8n-node CLI for build tasks. ```json { "scripts": { "build": "n8n-node build && node scripts/copy-proto.js", "dev": "n8n-node dev", "lint": "n8n-node lint" } } ``` -------------------------------- ### Create Folder Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Creates a new folder within a specified location in Feishu Drive. ```APIDOC ## POST /open-apis/drive/v1/files ### Description Creates a new folder within a specified location in Feishu Drive. ### Method POST ### Endpoint /open-apis/drive/v1/files ### Parameters #### Request Body - **folder_token** (string) - Required - The token of the parent folder - **name** (string) - Required - The name of the new folder ### Response #### Success Response (200) - **field1** (type) - Description ``` -------------------------------- ### Get Message History Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/MESSAGE_MODULE.md Retrieves message history from a conversation or thread, with support for filtering and pagination. ```APIDOC ## Get Message History ### Description Retrieves message history from a conversation or thread. Supports filtering by time range and sorting. ### Method GET ### Endpoint /open-apis/im/v1/messages ### Parameters #### Query Parameters - **container_id_type** (string) - Yes - Container type: `chat` (group) or `thread` - **container_id** (string) - Yes - Chat ID or Thread ID - **start_time** (string) - No - Start time (Unix milliseconds) for filtering messages - **end_time** (string) - No - End time (Unix milliseconds) for filtering messages - **sort_type** (string) - Yes - Sort order: `ByCreateTimeAsc` or `ByCreateTimeDesc` (Default: `ByCreateTimeAsc`) - **page_size** (number) - No - Items per page (max 50) (Default: 50) - **page_token** (string) - No - Pagination token from previous response - **user_id_type** (string) - No - User ID format in response (Default: `open_id`) - **timeout** (number) - No - Request timeout in milliseconds ### Response #### Success Response (200) - **items** (array) - **message_id** (string) - **create_time** (string) - **msg_type** (string) - **content** (string) - **sender** (object) - **id** (string) - **id_type** (string) - **sender_type** (string) - **page_token** (string) - For pagination - **has_more** (boolean) ### Response Example ```json { "items": [ { "message_id": "string", "create_time": "string", "msg_type": "string", "content": "string", "sender": { "id": "string", "id_type": "string", "sender_type": "user" } } ], "page_token": "string", "has_more": true } ``` ### Example (with Return All) ```json { "resource": "message", "operation": "message:list", "container_id_type": "chat", "container_id": "oc_xxxxx", "return_all": true } ``` ``` -------------------------------- ### Import File Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Imports a file into Feishu Drive from a specified source file token and format. ```APIDOC ## POST /open-apis/drive/v1/import_tasks ### Description Imports a file into Feishu Drive from a specified source file token and format. ### Method POST ### Endpoint /open-apis/drive/v1/import_tasks ### Parameters #### Request Body - **file_token** (string) - Required - The token of the file to import from - **target_folder_token** (string) - Required - The destination folder token - **type** (string) - Required - Input format: `word`, `excel`, `csv`, `markdown`, `txt`, `html` ### Response #### Success Response (200) - **field1** (type) - Description ``` -------------------------------- ### Get Chat Info Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Retrieves information about a specific chat or group using its unique chat ID. ```APIDOC ## Get Chat Info ### Description Retrieves information about a specific chat or group using its unique chat ID. ### Method GET ### Endpoint /open-apis/im/v1/chats/{chat_id} ### Parameters #### Path Parameters - `chat_id` (string) - Required - The ID of the chat to retrieve information for. ``` -------------------------------- ### Project Dependencies Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/CONFIGURATION.md Lists the necessary npm dependencies for the project, including WebSocket support and Protocol Buffers, along with peer dependencies for the n8n framework. ```json { "dependencies": { "ws": "^8.18.0", "protobufjs": "^7.5.3" }, "peerDependencies": { "n8n-workflow": "*" } } ``` -------------------------------- ### Get Bitable Metadata Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/BITABLE_MODULE.md Retrieves complete metadata structure of a bitable including all tables, fields, and views. ```APIDOC ## Get Bitable Metadata ### Description Retrieves complete metadata structure of a bitable including all tables, fields, and views. ### Method GET ### Endpoint /bitable/get_metadata ### Parameters #### Query Parameters - **base_id** (string) - Required - Base ID ### Response #### Success Response (200) - **app_id** (string) - **name** (string) - **tables** (Array) - Array of table objects, each containing table_id, name, revision, fields, and views. - **fields** (Array) - Array of field objects, each containing field_id, name, type, ui_type, and property. - **views** (Array) - Array of view objects, each containing view_id, name, and type. ``` -------------------------------- ### Boolean Parameter Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/CONFIGURATION.md Defines a boolean parameter to control fetching all results, with auto-pagination enabled by default as false. ```typescript { displayName: 'Return All', name: 'return_all', type: 'boolean', default: false, description: 'Fetch all results (auto-pagination)' } ``` -------------------------------- ### IConstructorParams Interface (WSClient) Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/TYPES_AND_INTERFACES.md Configuration parameters for initializing the WebSocket client, including authentication details, domain, logger, and helper functions. ```typescript interface IConstructorParams { appId: string; appSecret: string; domain?: string | Domain; logger: Logger; helpers: RequestHelperFunctions; autoReconnect?: boolean; agent?: any; } ``` -------------------------------- ### Create Table Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/BITABLE_MODULE.md Creates a new table within a specified base with an optional set of initial fields. ```APIDOC ## Create Table ### Description Creates a new table within a base. ### Method POST ### Endpoint /bitable/add_table ### Parameters #### Query Parameters - **base_id** (string) - Required - Base ID #### Request Body - **name** (string) - Required - Table display name - **fields** (Array) - Optional - Initial field definitions ### Request Example ```json { "name": "string", "fields": [ { "field_id": "string", "name": "string", "type": 0 } ] } ``` ### Response #### Success Response (200) - **table_id** (string) - The ID of the newly created table. - **name** (string) - The name of the newly created table. - **fields** (Array) - Initial field definitions for the new table. #### Response Example ```json { "table_id": "string", "name": "string", "fields": [ { "field_id": "string", "name": "string", "type": 0 } ] } ``` ``` -------------------------------- ### ID/Identifier Parameter Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/CONFIGURATION.md Defines a string parameter for an ID, such as a chat ID. It is required and has a default empty value. ```typescript { displayName: 'Chat ID', name: 'chat_id', type: 'string', required: true, default: '', description: 'Target chat ID' } ``` -------------------------------- ### Create View Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/BITABLE_MODULE.md Creates a new view within a specified Bitable table. You can define the view's name and type, such as 'grid', 'gantt', 'kanban', 'gallery', or 'form'. ```APIDOC ## Create View ### Description Creates a new view in a table. ### Method POST ### Endpoint /bitable/add_view ### Parameters #### Query Parameters - **base_id** (string) - Required - Base ID - **table_id** (string) - Required - Table ID - **name** (string) - Required - View display name - **type** (string) - Required - View type: `grid`, `gantt`, `kanban`, `gallery`, `form` ### Response #### Success Response (200) - **view_id** (string) - The ID of the newly created view. - **name** (string) - The display name of the view. - **type** (string) - The type of the view. ``` -------------------------------- ### Sorting Records Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/BITABLE_MODULE.md Specify the sort order for records. This example sorts by 'Status' in descending order and then by 'Created' in ascending order. ```typescript { sort: [ { field_name: 'Status', desc: true }, { field_name: 'Created', desc: false } ] } ``` -------------------------------- ### Recall Message Response Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/MESSAGE_MODULE.md This TypeScript snippet shows the expected response structure when recalling a message. It confirms the message ID that was recalled. ```typescript { message_id: string; } ``` -------------------------------- ### Edit a Feishu Message Response Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/MESSAGE_MODULE.md This is an example of the response structure when editing a Feishu message. It includes the updated message ID and the timestamp of the update. ```typescript { message_id: string; update_time: string; // Updated timestamp } ``` -------------------------------- ### Example Valid Card Content for Feishu Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/ERROR_HANDLING.md A valid JSON structure for an interactive card message in Feishu, demonstrating required fields and tags. ```json { "elements": [ { "tag": "div", "text": { "content": "Card content", "tag": "plain_text" } } ], "header": { "title": { "content": "Card Title", "tag": "plain_text" } } } ``` -------------------------------- ### Module Discovery Structure Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Illustrates how n8n modules are discovered from the filesystem. Each resource file maps to a module directory, with operation files exporting resource operations. ```plaintext nodes/FeishuNode/resource/ ├── AilyResource.ts → aily/ ├── BitableResource.ts → bitable/ ├── CalendarResource.ts → calendar/ ├── ChatResource.ts → chat/ ├── DocResource.ts → doc/ ├── MessageResource.ts → message/ ├── SpaceResource.ts → space/ ├── TaskResource.ts → task/ ├── UserResource.ts → user/ └── WikiSpacesResource.ts → wiki_spaces/ ``` -------------------------------- ### Origin Request Example Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/UTILITY_MODULES.md Use originRequest for low-level HTTP requests with automatic credential injection and authentication. It handles base URL and authentication headers. ```typescript const response = await RequestUtils.originRequest.call(context, { method: 'POST', url: '/open-apis/im/v1/messages', body: { receive_id_type: 'open_id', receive_id: 'ou_xxxxx', msg_type: 'text', content: { text: 'Hello' } } }); // Raw API response, not processed ``` -------------------------------- ### Export Document Source: https://github.com/luka-n8n-nodes/n8n-nodes-feishu/blob/main/_autodocs/api-reference/ADDITIONAL_MODULES.md Initiates an export task for a document in Feishu Drive. ```APIDOC ## POST /open-apis/drive/v1/export_tasks ### Description Initiates an export task for a document in Feishu Drive. ### Method POST ### Endpoint /open-apis/drive/v1/export_tasks ### Parameters #### Request Body - **file_token** (string) - Required - The token of the file to export - **type** (string) - Required - The desired export format (e.g., `docx`, `pdf`) ### Response #### Success Response (200) - **field1** (type) - Description ```