outlook-groups

n8n node to interact with Outlook Groups and receive messages with attachments

Documentation

@pokash/n8n-nodes-outlook-groups

🔐 OAuth2-ready węzły n8n do pracy z grupami Microsoft Outlook - pobieranie wiadomości, triggery i webhook management.

🎯 Zawarte węzły

1. Outlook Groups (Regular Node)

  • 📧 Pobieranie wiadomości z grup na żądanie
  • 📎 Pobieranie załączników
  • 🔍 Filtrowanie i paginacja

2. Outlook Groups Trigger (Trigger Node)

  • Automatyczne reagowanie na nowe wiadomości
  • 🔄 Polling - sprawdzanie co X sekund
  • 🔔 Webhook support - natychmiastowe powiadomienia

3. Outlook Groups Subscription (Management Node)

  • 🛠️ Zarządzanie webhook'ami Microsoft Graph
  • ➕ Tworzenie subscriptions
  • 🔄 Aktualizacja i przedłużanie

🔐 Autoryzacja (2 opcje)

🚀 OAuth2 Authorization Code (ZALECANE)

  • User-friendly - użytkownik loguje się swoim kontem
  • Bezpieczne - brak udostępnianych sekretów
  • MFA support - działa z dwuskładnikową autoryzacją
  • Auto refresh - automatyczne odnawianie tokenów

🔧 Client Credentials (dla aplikacji serwisowych)

  • Automatyzacja - bez interakcji użytkownika
  • Service apps - idealne dla zautomatyzowanych workflow
  • Admin consent wymagany
  • Mniej bezpieczne - wymaga Client Secret

🚀 Instalacja

npm install @pokash/n8n-nodes-outlook-groups@1.1.0

🔧 Konfiguracja Azure AD

OAuth2 Setup (ZALECANE)

  1. Azure Portal → App registrations → Twoja aplikacja
  2. Authentication → Add platform → Web
  3. Redirect URIs → Dodaj n8n OAuth callback URL:
    https://your-n8n-instance.com/rest/oauth2-credential/callback
    
  4. API permissions → Microsoft Graph → Delegated permissions:
    • Group.Read.All
    • Mail.Read
    • Files.Read.All
  5. Grant admin consent (opcjonalne, ale zalecane)

Client Credentials Setup

  1. API permissions → Microsoft Graph → Application permissions:
    • Group.Read.All
    • Mail.Read
    • Files.Read.All
  2. Grant admin consent (WYMAGANE)
  3. Certificates & secrets → New client secret

🎛️ Konfiguracja w n8n

OAuth2 Flow:

  1. CredentialsOutlook Groups API
  2. Grant TypeOAuth2 Authorization Code
  3. Wprowadź:
    • Client ID (z Azure AD)
    • Tenant ID (Directory ID z Azure AD)
  4. Connect my account → zaloguj się przez Microsoft
  5. Autoryzacja automatyczna

Client Credentials:

  1. Grant TypeClient Credentials
  2. Wprowadź:
    • Client ID
    • Client Secret
    • Tenant ID
  3. Test connection → sprawdzi automatycznie

📋 Przykładowe workflow

OAuth2 + Trigger:

Outlook Groups Trigger (OAuth2)
    ↓ nowa wiadomość z załącznikiem
Function (sprawdź czy to ważny dokument)
    ↓ jeśli ważny
Gmail (wyślij powiadomienie do zespołu)
    ↓
Google Drive (zapisz załącznik)

Client Credentials + Polling:

Schedule Trigger (codziennie 9:00)
    ↓
Outlook Groups (pobierz wiadomości Client Credentials)
    ↓
Filter (tylko z ostatnich 24h)
    ↓
Slack (wyślij raport zespołowi)

🔗 Struktura danych (bez zmian)

{
  "id": "message-id",
  "conversationId": "conversation-id", 
  "topic": "Temat konwersacji",
  "subject": "Temat wiadomości",
  "body": { "contentType": "html", "content": "..." },
  "from": { "emailAddress": { "name": "Jan Kowalski", "address": "jan@example.com" }},
  "receivedDateTime": "2024-03-15T10:30:00Z",
  "hasAttachments": true,
  "attachments": [
    {
      "id": "attachment-id",
      "name": "dokument.pdf",
      "contentType": "application/pdf", 
      "contentBytes": "<Buffer...>"
    }
  ]
}

🆚 Porównanie metod autoryzacji

Funkcja OAuth2 Client Credentials
Setup Średni Łatwy
Security ⭐⭐⭐⭐⭐ ⭐⭐⭐
User Experience ⭐⭐⭐⭐⭐ ⭐⭐
MFA Support
Auto Refresh ❌ (manual)
Admin Consent Opcjonalny Wymagany
Personal Accounts
Automation ✅⭐

🛠️ Migration z 1.0.x

Jeśli używałeś poprzedniej wersji:

  1. Aktualizuj pakiet: npm install @pokash/n8n-nodes-outlook-groups@1.1.0
  2. Opcjonalnie: Zmień credentials na OAuth2 dla lepszej security
  3. Stare Client Credentials nadal działają bez zmian

💡 Best Practices

OAuth2:

  • Używaj dla workflow z interakcją użytkownika
  • Idealny dla personal/team workflows
  • Lepszy dla long-running processes

Client Credentials:

  • Używaj dla pełnej automatyzacji
  • Idealny dla service accounts
  • Lepszy dla scheduled/batch operations

🔧 Troubleshooting

OAuth2 nie działa:

  • Sprawdź Redirect URI w Azure AD
  • Upewnij się że używasz Delegated permissions
  • Sprawdź czy tenant allows OAuth2

Client Credentials fails:

  • Sprawdź czy Admin Consent został przyznany
  • Użyj Application permissions (nie Delegated)
  • Sprawdź Client Secret (VALUE, nie ID)

🎉 Ready to use!

Po instalacji znajdziesz 3 węzły w n8n:

  • Outlook Groups (Communication)
  • Outlook Groups Trigger (Trigger) ⚡
  • Outlook Groups Subscription (Communication) 🛠️

Happy OAuth2 automating! 🚀🔐

Discussion