librus-synergia

Librus Synergia nodes for n8n (unofficial, using librus-api)

Package Information

Released: 10/1/2025
Downloads: 10 weekly / 42 monthly
Latest Version: 0.2.11
Author: Marcin K. / ChatGPT

Documentation

n8n-nodes-librus-synergia

Unofficial. Uses the community librus-api (scrapes Synergia). Use according to your school/Librus ToS.

Build

npm ci
npm run build

This produces dist/ with compiled JS.

Install into n8n (Docker)

Bind-mount the folder into n8n user data and let n8n auto-load custom nodes.

Example docker-compose.override.yml next to your n8n service:

services:
  n8n:
    volumes:
      - ./n8n-nodes-librus-synergia/dist:/home/node/.n8n/custom/n8n-nodes-librus-synergia
    environment:
      - N8N_ENABLE_OPENAI_TOOLBOX=false

Restart n8n. In the Editor, search for the Librus node. Create two credentials of type Librus API (e.g., "Librus – Parent A", "Librus – Parent B"). Pick the credential per node.

Usage tips

  • To fetch for two users: duplicate the Librus node, select the other credential, and merge results.
  • Add Error Trigger or IF node to handle login errors (e.g. password change).
  • For daily digests: Cron → Librus (Grades + Messages) → Function (group by date) → OpenAI → Email/Telegram.

Operations overview

The node now provides a full facade of the librus-api package. Pick a Resource and Operation, then fill in fields shown.

  • Messages

    • List Inbox → inbox.listInbox(folderId, page?)
    • Get Message → inbox.getMessage(folderId, messageId)
    • Send Message → inbox.sendMessage(userId, title, content)
    • Delete Message → inbox.removeMessage(messageId)
    • List Receivers → inbox.listReceivers(group)
    • List Announcements → inbox.listAnnouncements()
    • Get Attachment → inbox.getFile(path)
      • Binary output property configurable via "Binary Property" (default: data)
  • Homework

    • List Subjects → homework.listSubjects()
    • List Homework → homework.listHomework(subjectId, from, to)
    • Get Homework → homework.getHomework(homeworkId)
  • Absence

    • Get Absences → absence.getAbsences()
    • Get Absence → absence.getAbsence(absenceId)
  • Calendar

    • Get Timetable → calendar.getTimetable(from, to)
    • Get Calendar → calendar.getCalendar(month, year)
    • Get Event → calendar.getEvent(eventId, isAbsence)
  • Info

    • Get Grades → info.getGrades()
    • Get Grade → info.getGrade(gradeId)
    • Get Point Grade → info.getPointGrade(gradeId)
    • Get Notifications → info.getNotifications()
    • Get Lucky Number → info.getLuckyNumber()
    • Get Account Info → info.getAccountInfo()

Binary attachments

For Messages → Get Attachment, set the exact "Attachment Path" from a message’s files list. The node outputs base64 binary under item.binary[Binary Property]. You can change "Binary Property" to match downstream expectations.

Example flows

  • Latest inbox items this week

    • Resource: Messages → List Inbox
    • Folder ID: 5 (inbox)
    • From/To: set week range
  • Download attachment from a message

    • Step 1: Messages → Get Message (folder 5, message id)
    • Step 2: Item Lists split on json.files[]
    • Step 3: Messages → Get Attachment (Attachment Path: {{$json.path}}), Binary Property: file
    • Step 4: Move Binary Data or Write Binary File

JSON Schemas

Minimal JSON schemas for outputs live in src/types/schemas.ts for documentation and future validation needs.

Data normalization (since 0.2.6)

  • Absences: Over-nested structures like [ { "0": [ { date, table, info }, ... ] } ] are converted to a single object keyed by date:
    { "2025-09-29 (pon.)": { table: [...], info: [...] }, ... } with null table slots removed.
  • Calendar (Get Calendar): If the API returns grouped nested arrays of events, they are flattened into a simple list (one output item per event) automatically.
    This removes the need for an extra Function/Code node doing items.flatMap(...).

If you need the raw shape in future, open an issue—feature flags can be added.

Discussion