$ cat node-template.py

L

Lark List Tasklists

// Lists all tasklists (boards) accessible in Lark Suite. Returns names, owners, and member counts. Connect the tasklist ID output to a Lark List Tasks node to retrieve tasks.

Input
Integration
template.py
1import os2import sys3import json4import traceback56try:7    import requests8except ImportError:9    import subprocess10    subprocess.check_call([sys.executable, "-m", "pip", "install", "requests"])11    import requests1213LARK_BASE_URL = "https://open.larksuite.com/open-apis"141516def get_lark_token():17    # Prefer user token (OAuth — sees user's resources)18    user_token = os.getenv("LARK_USER_TOKEN")19    if user_token:20        return user_token2122    # Fallback to tenant token (app-level — limited visibility)23    app_id = os.getenv("LARK_APP_ID")24    app_secret = os.getenv("LARK_APP_SECRET")25    if not app_id or not app_secret:26        raise ValueError(27            "Lark is not connected. Add LARK_APP_ID and LARK_APP_SECRET as workspace secrets, "28            "then connect via workspace settings to authorize user access."29        )30    resp = requests.post(31        f"{LARK_BASE_URL}/auth/v3/tenant_access_token/internal",32        json={"app_id": app_id, "app_secret": app_secret},33    )34    resp.raise_for_status()35    data = resp.json()36    if data.get("code") != 0:37        raise ValueError(f"Lark auth failed: {data.get('msg')}")38    return data["tenant_access_token"]394041def lark_request(method, path, **kwargs):42    token = get_lark_token()43    headers = {44        "Authorization": f"Bearer {token}",45        "Content-Type": "application/json; charset=utf-8",46    }47    resp = requests.request(48        method, f"{LARK_BASE_URL}{path}", headers=headers, **kwargs49    )50    resp.raise_for_status()51    data = resp.json()52    if data.get("code") != 0:53        raise ValueError(f"Lark API error ({data['code']}): {data.get('msg')}")54    return data555657def main():58    try:59        inputs = json.loads(sys.stdin.read()).get("inputs", {})6061        page_size = inputs.get("pageSize", 50)62        page_token = inputs.get("pageToken")6364        params = {"page_size": page_size}65        if page_token:66            params["page_token"] = page_token6768        result = lark_request("GET", "/task/v2/tasklists", params=params)6970        items = result.get("data", {}).get("items", [])71        has_more = result.get("data", {}).get("has_more", False)7273        output = {74            "tasklists": items,75            "total": len(items),76            "hasMore": has_more,77        }78        print(json.dumps(output, indent=2, ensure_ascii=False))7980    except Exception as e:81        error_output = {82            "error": str(e),83            "errorType": type(e).__name__,84            "traceback": traceback.format_exc(),85        }86        print(json.dumps(error_output), file=sys.stderr)87        sys.exit(1)888990if __name__ == "__main__":91    main()

$ git log --oneline

v1.0.1
HEAD
2026-05-07
v1.0.02026-04-09