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
Automate email phishing detection with n8n and Gmail

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

Learn how to Build this Workflow with AI:

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.


Automate email phishing detection with n8n and Gmail

Visit through Desktop to Interact with the Workflow.

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 Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.