Monitor attack surface changes with OpenAI, Postgres, Slack, and email
Needs changesWhat this workflow does
This AI workflow has 23 nodes and runs on a schedule (every 6 hours). Along the way it connects Postgres, OpenAI Chat Model and Slack.
How it runs
Trigger: On a schedule (every 6 hours).
- Set Configuration Parameters (Edit Fields (Set)): sets 10 fields: rootDomains, subdomainApiUrl, exposedServicesApiUrl…
- Fetch Subdomain Data (HTTP Request): calls an HTTP API
- Fetch Exposed Services Data (HTTP Request): calls an HTTP API
- Fetch Cloud Asset Inventory (HTTP Request): calls an HTTP API
- Merge: merges the data from its input branches
- Normalize and Deduplicate Assets (Code): runs custom JavaScript code
- Get Previous Baseline (Postgres): run a query
- Update Baseline with Inventory (Postgres): run a query
- Diff Current vs Baseline Inventory (Compare Datasets): uses Compare Datasets
- Tag New Assets (Edit Fields (Set)): sets 1 field: changeType
…plus 10 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in Generate Risk Triage Narrative (v1.6): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Generate Risk Triage Narrative (v1.6) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (14)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - Merge
n8n-nodes-base.merge - Code
n8n-nodes-base.code - Postgres
n8n-nodes-base.postgres - Compare Datasets
n8n-nodes-base.compareDatasets - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - AI Agent
@n8n/n8n-nodes-langchain.agent - If
n8n-nodes-base.if - Send Email
n8n-nodes-base.emailSend - Switch
n8n-nodes-base.switch - Slack
n8n-nodes-base.slack - No Operation, do nothing
n8n-nodes-base.noOp
From the author
Quick Overview This scheduled workflow inventories your external attack surface from three HTTP APIs, diffs it against a Postgres baseline, and uses OpenAI to generate concise risk notes before routing critical/high alerts to Slack and medium changes to…