Find Microsoft 365 SMTP AUTH senders with Microsoft Graph, OpenAI and Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 20 nodes and runs on a schedule (every week at 08:00) (plus 1 other trigger). Along the way it connects OpenAI Chat Model, Telegram and Google Sheets.
How it runs
Trigger: On a schedule (every week at 08:00) (plus 1 other trigger).
- Set Configuration Settings (Edit Fields (Set)): sets 3 fields: sign_in_days, usage_period, alert_only_changes
- If: checks a condition and branches into true / false
- Generate Sample Data (Code): runs custom JavaScript code
- Fetch SMTP App Usage (HTTP Request): calls an HTTP API
- Fetch SMTP Sign-Ins (HTTP Request): calls an HTTP API
- Parse App Usage Data (Code): runs custom JavaScript code
- Group Sign-Ins by User (Code): runs custom JavaScript code
- Merge: merges the data from its input branches
- Compile User Inventory (Code): runs custom JavaScript code
- If: checks a condition and branches into true / false
…plus 6 more steps. See the full node list below.
Services it uses
Other OpenAI + Google Sheets templates (2,011) · Other Telegram + OpenAI templates (807) · Other Telegram + Google Sheets templates (674)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (12)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Manual Trigger
n8n-nodes-base.manualTrigger - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - Merge
n8n-nodes-base.merge - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Telegram
n8n-nodes-base.telegram - Google Sheets
n8n-nodes-base.googleSheets
From the author
Quick overview This workflow runs weekly to identify Microsoft 365 accounts sending via SMTP AUTH (Basic auth) using Microsoft Graph reports and sign-in logs, generates an OpenAI-based remediation plan for risky accounts, writes the inventory to Google…