DEV Community

MaKriRich
MaKriRich

Posted on

Automate sevDesk & Lexoffice with n8n -- A Complete Guide

If you run a business in Germany, Austria, or Switzerland, you probably use sevDesk for invoicing or Lexoffice for bookkeeping -- maybe both. They're good tools, but they don't talk to each other. And every manual sync between them is time you're not spending on actual work.

This guide shows you how to automate three common workflows using n8n and the BuchPilot community nodes.

Prerequisites

Step 1: Install BuchPilot Nodes

In n8n, go to Settings > Community Nodes > Install a community node and enter:

n8n-nodes-buchpilot
Enter fullscreen mode Exit fullscreen mode

Click Install. Done. You now have four new nodes:

  • sevDesk (actions)
  • sevDesk Trigger (polling)
  • Lexoffice (actions)
  • Lexoffice Trigger (webhook)

Step 2: Set Up Credentials

sevDesk

  1. In n8n: Credentials > New > "sevDesk API"
  2. Paste your API token
  3. Save

Lexoffice

  1. In n8n: Credentials > New > "Lexoffice API"
  2. Paste your API key
  3. Save

Workflow 1: Contact Sync (sevDesk to Lexoffice)

The problem: You create a new client in sevDesk, then have to manually re-enter them in Lexoffice.

The solution: A workflow that runs every minute and syncs new contacts automatically.

How to build it

  1. Add sevDesk Trigger node

    • Event: New Contact
    • Polling interval: Every 1 minute (default)
  2. Add a Set node (data mapping)

    • sevDesk uses surename for last name (yes, that's the actual field name)
    • Lexoffice uses lastName
    • Map: {{ $json.surename }} -> lastName
    • If name2 (company name) exists: set contactType to company, otherwise person
  3. Add Lexoffice node

    • Resource: Contact
    • Operation: Create
    • Role: Customer
  4. Activate the workflow

From now on, every new sevDesk contact appears in Lexoffice within a minute.

Handling duplicates

Lexoffice doesn't reject duplicates by default. Add an IF node before the Lexoffice node that checks if a contact with the same name/email already exists using Lexoffice > List Contacts with a filter.

Workflow 2: Invoice Booking (sevDesk to Lexoffice)

The problem: Every invoice you write in sevDesk needs to be manually booked as a voucher in Lexoffice.

The solution: Automatic booking whenever a new invoice appears.

How to build it

  1. Add sevDesk Trigger node

    • Event: New Invoice
  2. Add sevDesk node (fetch full details)

    • Resource: Invoice
    • Operation: Get
    • ID: {{ $json.id }}
  3. Add a Set node (mapping)

    • totalNet -> Lexoffice totalNetAmount
    • taxRate -> Lexoffice taxRatePercentage
    • totalGross -> Lexoffice totalGrossAmount
  4. Add Lexoffice node

    • Resource: Voucher
    • Operation: Create
    • Voucher Type: Purchase Invoice
  5. Activate

Important: Tax handling

sevDesk invoices can have multiple line items with different tax rates (19%, 7%, 0%). The simple mapping above works for single-rate invoices. For multi-rate invoices, you'd need a loop that creates one voucher line per tax rate.

Workflow 3: Weekly Overdue Invoice Report

The problem: You forget to follow up on unpaid invoices.

The solution: An automated email every Monday listing all open and overdue invoices.

How to build it

  1. Add Schedule Trigger node

    • Cron: 0 8 * * 1 (Monday 8:00 AM)
  2. Add sevDesk node

    • Resource: Invoice
    • Operation: Get Many
    • Filter: Status = Open (200)
  3. Add IF node

    • Condition: invoiceDate + timeToPay days < today
    • True branch = overdue, False branch = open but not yet due
  4. Add Set node (formatting)

    • Create a readable summary: invoice number, client name, amount, due date
  5. Add Send Email node

    • To: your email
    • Subject: "Weekly Invoice Report"
    • Body: the formatted summary
  6. Activate

You'll never miss an overdue invoice again.

Tips & Gotchas

Polling vs Webhook: The sevDesk Trigger uses polling (checks the API periodically). It works behind firewalls and NATs -- no public URL needed. The Lexoffice Trigger uses webhooks (Lexoffice sends events to your n8n). This needs a public URL.

Rate limits: Lexoffice allows max 2 requests per second. The BuchPilot nodes handle this with a built-in 500ms delay. You don't need to add Wait nodes.

Error handling: Add an Error Branch to each workflow. If a Lexoffice or sevDesk API call fails, catch the error and send yourself a notification instead of losing the data silently.

Next Steps

These three workflows cover the most common use cases. Once they're running, you can extend them:

  • Add Slack/Telegram notifications instead of email
  • Create credit notes automatically when invoices are cancelled
  • Sync payments between the two systems
  • Add XRechnung/ZUGFeRD e-invoice generation (using einvoice-mcp)

Links

  • BuchPilot Nodes (free): npm
  • Source code: GitHub

Top comments (0)