{"id":29258228,"url":"https://github.com/ijazrushad/n8n","last_synced_at":"2026-05-05T14:32:03.380Z","repository":{"id":302604225,"uuid":"1012996197","full_name":"ijazrushad/n8n","owner":"ijazrushad","description":"Self Hosted n8n Automation","archived":false,"fork":false,"pushed_at":"2025-07-03T08:15:00.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-03T09:23:11.588Z","etag":null,"topics":["automation","config","docker-compose","email","email-sender","json","n8n","n8n-workflow","nginx","yaml"],"latest_commit_sha":null,"homepage":"https://n8n.adplay-mobile.com/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ijazrushad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-03T07:48:34.000Z","updated_at":"2025-07-03T08:23:55.000Z","dependencies_parsed_at":"2025-07-03T09:33:22.563Z","dependency_job_id":null,"html_url":"https://github.com/ijazrushad/n8n","commit_stats":null,"previous_names":["ijazrushad/n8n"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ijazrushad/n8n","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijazrushad%2Fn8n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijazrushad%2Fn8n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijazrushad%2Fn8n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijazrushad%2Fn8n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ijazrushad","download_url":"https://codeload.github.com/ijazrushad/n8n/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijazrushad%2Fn8n/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32653498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","config","docker-compose","email","email-sender","json","n8n","n8n-workflow","nginx","yaml"],"created_at":"2025-07-04T06:00:41.535Z","updated_at":"2026-05-05T14:32:03.363Z","avatar_url":"https://github.com/ijazrushad.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n```markdown\n# ✨ AI-Powered Outlook Email Automation with n8n\n\nThis repository provides a complete automation stack using **n8n**, Microsoft Outlook, Microsoft Teams, and **Google Gemini** (or another LLM). It reads incoming Outlook emails, generates a professional AI-powered draft, sends it to Teams for approval, and sends the email after one-click confirmation.\n\n---\n\n## 🚀 Features\n\n- **Automated AI Drafts**: Auto-generates email replies using LLM when a new Outlook email arrives.\n- **Intelligent Replies**: Context-aware, business-grade replies using Gemini or OpenAI.\n- **Microsoft Teams Integration**: Sends an interactive adaptive card with the draft email.\n- **One-Click Approval**: Instantly send or edit the draft via Teams.\n- **Secure \u0026 Self-Hosted**: Dockerized deployment with Cloudflare SSL \u0026 reverse proxy.\n- **Conversation Memory**: Retains context for threaded conversations.\n\n---\n\n## ✅ Prerequisites\n\nMake sure you have the following:\n\n- A server (VPS or dedicated) with **Docker** \u0026 **Docker Compose**\n- A registered **domain name**\n- A **Cloudflare** account for DNS and SSL\n- A **Microsoft 365** account with admin access\n- An **API Key** for Google Gemini or OpenAI\n\n---\n\n## 🛠️ Setup and Configuration\n\n### Step 1: Server \u0026 Domain\n\n- Create an A record (e.g. `n8n.yourdomain.com`) → Point to your server IP.\n- On Cloudflare, set **SSL/TLS** to **Full** or **Full (Strict)**.\n\n### Step 2: Deploy n8n with Docker\n\n```bash\nmkdir n8n-automation \u0026\u0026 cd n8n-automation\n# Paste docker-compose.yml content here\ndocker-compose up -d\n```\n\n### Step 3: Setup Nginx Reverse Proxy\n\n```bash\nsudo nano /etc/nginx/sites-available/n8n.conf\n# Paste nginx config here, update domain\nsudo ln -s /etc/nginx/sites-available/n8n.conf /etc/nginx/sites-enabled/\nsudo nginx -t \u0026\u0026 sudo systemctl restart nginx\n```\n\nYou can now access n8n at: `https://n8n.yourdomain.com`\n\n---\n\n### Step 4: Azure App Registration\n\n1. Go to [Azure Portal](https://portal.azure.com)\n2. Register a new App under **Microsoft Entra ID** → **App registrations**\n3. Redirect URI: `https://n8n.yourdomain.com/rest/oauth2-credential/callback`\n4. Get **Client ID** and **Client Secret**\n5. Add these **Microsoft Graph API** permissions:\n   - `Mail.ReadWrite`\n   - `Mail.Send`\n   - `User.Read`\n   - `offline_access`\n6. Grant Admin Consent.\n\n---\n\n### Step 5: Configure n8n Workflows\n\n- Import the two workflows:\n  - `Outlook_Email_Draft_Teams_Alert.json`\n  - `Outlook_Email_Create_Send.json`\n\n- Set up credentials for:\n  - Microsoft Outlook (OAuth2)\n  - Microsoft Teams\n  - Google Gemini / OpenAI\n\n- Connect the webhook URL from `Send Approved Email` workflow into the Teams card in `AI Draft \u0026 Teams Alert`.\n\n- **Activate both workflows** – You're live!\n\n---\n\n## 🔄 Workflows\n\n### 1. **Outlook Email Draft + Teams Alert**\n\n- Triggers on new unread Outlook email.\n- Retrieves body and context.\n- Uses Gemini/OpenAI to generate a reply.\n- Creates a draft via Microsoft Graph API.\n- Sends Adaptive Card to Microsoft Teams with buttons:\n  - ✅ **Accept \u0026 Send**\n  - ✏️ **Edit in Outlook**\n\n### 2. **Teams Action → Send Email**\n\n- Triggered when the user clicks ✅ in Teams.\n- Sends the previously created draft via Microsoft Graph API.\n\n---\n\n## ⚙️ Configuration Files\n\n### docker-compose.yml\n\n```yaml\nservices:\n  n8n:\n    image: n8nio/n8n\n    restart: unless-stopped\n    ports:\n      - \"127.0.0.1:5678:5678\"\n    environment:\n      - N8N_HOST=n8n.yourdomain.com\n      - N8N_PROTOCOL=https\n      - WEBHOOK_URL=https://n8n.yourdomain.com/\n      - GENERIC_TIMEZONE=Asia/Dhaka\n      - NODE_OPTIONS=--max-old-space-size=4096\n      - N8N_RUNNERS_ENABLED=true\n      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true\n      - N8N_PUSH_BACKEND=websocket\n    volumes:\n      - n8n_data:/home/node/.n8n\n\nvolumes:\n  n8n_data:\n```\n\n---\n\n### nginx.conf\n\n```nginx\nserver {\n    listen 80;\n    server_name n8n.yourdomain.com;\n\n    location / {\n        proxy_pass http://localhost:5678;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_http_version 1.1;\n        proxy_set_header Upgrade $http_upgrade;\n        proxy_set_header Connection \"upgrade\";\n        proxy_read_timeout 86400;\n    }\n}\n```\n\n---\n\n## 🧠 Example Prompt to Gemini / OpenAI\n\n```text\nYou are a professional and helpful business assistant. Please read the following email and write a clear, concise, and polite reply. Format the response in HTML with proper \u003cp\u003e tags.\n\nSubject: {{ $node[\"Microsoft Outlook Trigger\"].json.subject }}\nFrom: {{ $node[\"Microsoft Outlook Trigger\"].json.from.emailAddress.address }}\n\nContent:\n{{ $node[\"Get Email Body\"].json.body.content }}\n```\n\n---\n\n## 📬 Adaptive Card Preview (Microsoft Teams)\n\n| Action | Description |\n|-------|-------------|\n| ✅ Accept \u0026 Send | Instantly sends draft reply |\n| ✏️ Edit in Outlook | Opens the draft in Outlook for manual review |\n\n\u003e The card also shows original sender, subject, time received, and AI-generated content.\n\n---\n\n## ✅ Final Notes\n\n- All communication happens securely via HTTPS and OAuth2.\n- All workflows are fully modular – adapt or expand as needed.\n- You can enhance this further by storing conversation history or connecting to a CRM.\n\n---\n\n\n---\n\n\u003e Made with 💙 using [n8n.io](https://n8n.io) and the power of AI.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fijazrushad%2Fn8n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fijazrushad%2Fn8n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fijazrushad%2Fn8n/lists"}