This workflow efficiently monitors your domains for certificate expiry.
Scheduled Check (Cron Node): This is the workflow's trigger. It's configured to run on a regular schedule, such as every Monday morning, ensuring certificate checks are automated and consistent.
List Domains to Monitor (Code Node): This node acts as a static database, storing a list of all the domains you need to track.
Check Certificate Expiry (HTTP Request Node): For each domain in your list, this node makes a request to a certificate checking API. The API returns details about the certificate, including its expiry date.
Is Certificate Expiring? (If Node): This is the core logic. It compares the expiry date from the API response with the current date. If the certificate is set to expire within a critical timeframe (e.g., less than 30 days), the workflow proceeds to the next step.
Send Alert (Slack Node): If the If
node determines a certificate is expiring, this node sends a high-priority alert to your team's Slack channel. The message includes the domain name and the exact expiry date, providing all the necessary information for a quick response.
Here's a step-by-step guide to get this workflow running in your n8n instance.
Prepare Your Credentials & API:
#security-alerts
).Import the Workflow JSON:
Configure the Nodes:
domainsToMonitor
array in the code and add all the domains you want to check.30
in the expression new Date(Date.now() + 30 * 24 * 60 * 60 * 1000)
to change the warning period.Test and Activate: