Automate Phishing Email Detection with n8n, Gmail & Jira

This workflow automates the detection and reporting of phishing emails using Gmail, AI-powered analysis via ChatGPT, and Jira ticket creation. It reduces security response times by automatically analyzing email content and creating detailed Jira tasks for both suspicious and safe emails.
gmailTrigger
httpRequest
openAi
+6
Workflow Identifier: 1064
NODES in Use: Gmail Trigger, Microsoft Outlook Trigger, Set, HTTP Request, Code, Convert To File, If, Jira, ChatGPT

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Automation Does

This workflow checks new Gmail emails to find possible phishing attacks fast.
It grabs email details, makes a picture of the email, and uses ChatGPT-4 to say if it might be phishing.
Then it opens a Jira ticket with all the info and the picture for the security team.
This helps teams spot bad emails quickly and keep track of threats without missing anything.


Tools and Services Used

  • Gmail: Monitors inbox for new emails using OAuth2.
  • hcti.io API: Converts the email’s HTML content into a screenshot image.
  • OpenAI ChatGPT-4: Analyzes email content and headers to check for phishing signs.
  • Jira Software Cloud: Creates tickets and uploads screenshots as attachments automatically.
  • n8n automation platform: Runs and connects all nodes in a workflow for seamless processing.

Inputs, Processing Steps, and Output

Inputs

  • New email data from Gmail, including subject, recipient, HTML, and headers.

Processing Steps

  • Extract email details for easier access.
  • Send the email HTML to hcti.io to get a screenshot URL.
  • Download the screenshot image from the URL.
  • Rename the image file for Jira compatibility.
  • Ask ChatGPT-4, using email data and image info, to check if email is phishing.
  • Create a detailed Jira ticket with email content and AI analysis.
  • Attach the renamed screenshot image to the Jira ticket.

Output

  • Jira ticket containing email info, AI phishing report, and screenshot attachment.

Beginner Step-by-Step: How to Use This Workflow in n8n

Import and Setup

  1. Download the workflow file using the Download button on this page.
  2. Inside the n8n editor, click on “Import from File” and select the downloaded workflow.
  3. Add or update all necessary credentials: Gmail OAuth2, hcti.io API key and password, OpenAI API key, Jira API token and project details.

Configuration

  1. Check any hardcoded IDs, emails, channels, or project keys in the workflow nodes and update them to match your company’s settings.
  2. If the ChatGPT node has a prompt or code, copy or customize the prompt provided in this guide if needed.
  3. Test the workflow by sending a test email to your monitored Gmail and watch the workflow run in the execution pane.

Activation

  1. Once testing is successful, activate the Gmail Trigger node to start listening for new emails live.
  2. Deploy the workflow to run continuously, making sure your n8n instance has internet access.
  3. If self hosting n8n, verify your server and networking setup as per self-host n8n recommendations.

Customization Ideas

  • Enable Outlook support by turning on the disabled Outlook trigger and settings in the workflow.
  • Replace hcti.io with a local HTML to image tool to keep email content fully private when hosting n8n yourself.
  • Change the ChatGPT prompt to add more security checks or output format for other ticket systems.
  • Use extra code nodes to extract URLs and test them for phishing links more deeply.

Troubleshooting

  • Problem: Gmail Trigger does not activate.
    Cause: Wrong or expired OAuth2 token.
    Fix: Reconnect Gmail OAuth2 with proper scopes in n8n.
  • Problem: Screenshot HTML HTTP Request fails.
    Cause: Bad hcti.io credentials or wrong form data.
    Fix: Check Basic Auth and confirm the htmlBody is a clean HTML string.
  • Problem: Jira ticket not created.
    Cause: Faulty Jira API token or wrong project key.
    Fix: Verify Jira credentials and project IDs exactly.

Pre-Deployment Checklist

  • Make sure Gmail, hcti.io, OpenAI, Jira credentials are valid and active.
  • Send test emails and confirm new Gmail messages show in the workflow.
  • Check that HTTP calls to hcti.io succeed and generate image URLs.
  • Confirm ChatGPT node returns a good analysis without errors.
  • Manually create a Jira ticket using the workflow nodes to make sure Jira permissions are correct.

Summary of Benefits and Results

✓ Detect suspicious Gmail emails automatically.
✓ Create visual screenshots of emails for easier review.
✓ Use AI help (ChatGPT-4) to analyze phishing risks.
✓ Automatically raise Jira tickets with all details.
✓ Save time and reduce errors in phishing email response.
✓ Keep proper audit trail and notifications for security team.


Frequently Asked Questions

The ChatGPT node analyzes email content and headers to check if the email might be a phishing attempt, providing an AI-generated report.
Required credentials include Gmail OAuth2, hcti.io API credentials, OpenAI API key, and Jira API token with project access.
Yes, the workflow has a disabled Microsoft Outlook Trigger node that can be enabled to monitor Outlook inboxes as well.
Helpful resources for self hosting n8n on a server are available at https://buldrr.com/hosting/.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free