← All N8N workflows
AI & researchCodeConvert To FileGmail TriggerHTTP RequestIf

Email Body Screenshot Creation

Configured with Convert To File, Gmail Trigger, HTTP Request, Jira, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
TriggerGmail TriggerGmail TriggerTriggerMicrosoft OutlookTriggerMicrosoft Outlook TriggerWeb / APIScreenshot HTMLHTTP RequestWeb / APIRetrieve ScreenshotHTTP RequestTransformSet Outlook VariablesEdit FieldsTransformSet Gmail VariablesEdit FieldsWeb / APIRetrieve Headers ofEmailHTTP RequestCodeFormat HeadersCodeAI & modelsAnalyze Email withChatGPTOpen AiIntegrationCreate PotentiallyMalicious TicketJiraIntegrationCreate PotentiallyBenign TicketJiraCodeRename ScreenshotCodeTransformSet Jira IDEdit FieldsIntegrationUpload Screenshot ofEmail to JiraJiraIntegrationUpload Email Body toJiraJiraTransformConvert Email Body toFileConvert To FileTransformSet Email VariablesEdit FieldsCodeRename Email BodyScreenshotCodeRoutingCheck if MaliciousIf

Node categories in this workflow

  • Trigger
  • Web / API
  • Transform
  • Code
  • AI & models
  • Integration
  • Routing

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Gmail TriggerTriggerGmail TriggerSee node parameters
Microsoft Outlook TriggerTriggerMicrosoft Outlook TriggerSee node parameters
Screenshot HTMLWeb / APIHTTP RequestPOST
Retrieve ScreenshotWeb / APIHTTP RequestSee node parameters
Set Outlook VariablesTransformEdit FieldsSee node parameters
Set Gmail VariablesTransformEdit FieldsSee node parameters
Retrieve Headers of EmailWeb / APIHTTP RequestSee node parameters
Format HeadersCodeCodeSee node parameters
Analyze Email with ChatGPTAI & modelsOpen AiSee node parameters
Create Potentially Malicious TicketIntegrationJiraSee node parameters
Create Potentially Benign TicketIntegrationJiraSee node parameters
Rename ScreenshotCodeCodeSee node parameters
Set Jira IDTransformEdit FieldsSee node parameters
Upload Screenshot of Email to JiraIntegrationJiraissueAttachment
Upload Email Body to JiraIntegrationJiraissueAttachment
Convert Email Body to FileTransformConvert To FiletoText
Set Email VariablesTransformEdit FieldsSee node parameters
Rename Email Body ScreenshotCodeCodeSee node parameters
Check if MaliciousRoutingIfSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • gmailOAuth2
  • httpBasicAuth
  • jiraSoftwareCloudApi
  • microsoftOutlookOAuth2Api
  • openAiApi

Workflow notes

Email Body Screenshot Creation

Email Body Screenshot Creation

The Screenshot HTML node sends the email's HTML body to the hcti.io API, generating a screenshot that visually represents the email's layout. The Retrieve Screenshot node then fetches this image, making it available for attachment or review in subsequent steps. This dual-format processing ensures both clarity and flexibility in email analysis workflows.

Gmail Integration and Data Extraction

Gmail Integration and Data Extraction

This section of the workflow connects to a Gmail account using the Gmail Trigger node, capturing incoming emails in real-time, with checks performed every minute. Once an email is detected, its key components—such as the subject, recipient, body, and headers—are extracted and assigned to variables using the Set Gmail Variables node. These variables are structured for subsequent analysis and processing in later steps.

Microsoft Outlook Integration and Email Header Processing

Microsoft Outlook Integration and Email Header Processing

This section enables the integration of Microsoft Outlook to monitor and capture incoming emails. The Microsoft Outlook Trigger node checks for new messages every minute. Once an email is detected, the Retrieve Headers of Email node fetches detailed header and body content via the Microsoft Graph API. The Format Headers node organizes the email headers into a structured format using a JavaScript function, ensuring clarity and readiness for further processing. Finally, the Set Outlook Variables node extracts and assigns key details—such as the email subject, recipient, body, and formatted headers—to variables for use in subsequent workflow steps. This section is essential for processing Outlook emails and preparing them for analysis and reporting.

AI-Powered Email Analysis and Threat Detection

AI-Powered Email Analysis and Threat Detection

This section leverages ChatGPT for advanced email content and header analysis to determine potential phishing threats. The Analyze Email with ChatGPT node processes the email's HTML body and headers, generating a detailed JSON response that categorizes the email as malicious or benign. The response includes a verbose explanation, formatted for Jira, outlining the reasons for the classification. The Check if Malicious node evaluates the AI output to determine the next steps based on the email's threat status. If flagged as malicious, subsequent actions like reporting and ticket creation are triggered. This section ensures precise, AI-driven analysis to enhance email security workflows.

Automated Jira Ticket Creation and Email Attachment

Automated Jira Ticket Creation and Email Attachment

This section streamlines the process of logging phishing email reports in Jira, complete with detailed analysis and attachments. The workflow creates two distinct Jira tickets depending on the AI classification of the email:

  1. Potentially Malicious: The Create Potentially Malicious Ticket node generates a ticket if the email is flagged as a phishing attempt, including a summary of ChatGPT's analysis and the email’s details.
  2. Potentially Benign: If the email is classified as safe, the Create Potentially Benign Ticket node logs a ticket with similar details but under a non-malicious category.

The Set Jira ID node ensures the generated ticket's ID is tracked for subsequent operations. Attachments are handled efficiently:

  • Rename Screenshot prepares the email screenshot for upload.
  • Upload Screenshot of Email to Jira adds the screenshot to the Jira ticket for visual context.
  • Rename Email Body Screenshot and Upload Email Body to Jira manage the attachment of the email's text body as a .txt file.

This section enhances reporting by automating ticket creation, ensuring all relevant email data is readily available for review by security teams.

Email Body Conversion

Email Body Conversion

This section processes the email body into both text and visual formats for detailed analysis and reporting. The Set Email Variables node organizes the email's data, including its HTML body and text content, to prepare it for further steps. The Convert Email Body to File node creates a .txt file containing the plain text version of the email body, useful for documentation or further analysis.

Email Body Screenshot Creation

Email Body Screenshot Creation

Purpose and structure

This folder contains the Email Body Screenshot Creation workflow. Its executable nodes use code, convertToFile, gmailTrigger, httpRequest, if, jira, microsoftOutlookTrigger, openAi, set. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

Gmail Trigger, Microsoft Outlook Trigger

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/1307_Code_Converttofile_Send_Webhook.json MIT; preserve source notices.

More in AI & research