Description
Overview
This email with embedded image automation workflow enables sending HTML emails containing inline images using a no-code integration pipeline. Designed for users who need to embed images directly within email bodies, this automation workflow leverages an HTTP trigger combined with OAuth2 authentication to deliver MIME-formatted messages through the Gmail API.
Key Benefits
- Automates inline image embedding in emails with multipart MIME formatting.
- Uses OAuth2-secured API calls for authenticated email dispatch via Gmail.
- Supports dynamic image retrieval and base64 encoding for seamless integration.
- Manual trigger allows controlled execution and testing within the orchestration pipeline.
Product Overview
This email with embedded image automation workflow begins with a manual trigger node that initiates the process upon user interaction. The workflow sets email parameters including sender, recipient, subject line, and HTML body content containing a reference to the embedded image via a Content-ID. It retrieves a remote image from a specified URL using an HTTP request node, then converts the binary image data into a base64-encoded string with an extract-from-file node. The core logic composes a raw MIME email message structured as multipart/related, combining the HTML body and the inline image with proper headers and encoding. Finally, the composed message is sent through the Gmail API using an HTTP request node authenticated via OAuth2 credentials. The workflow operates synchronously in a linear sequence without explicit error retries, relying on n8n’s default error handling. No persistent storage of email or image data occurs within the workflow, ensuring transient processing of sensitive contents.
Features and Outcomes
Core Automation
The orchestration pipeline processes inputs including sender details, recipient address, subject, and HTML content referencing an embedded image. Decision criteria are minimal, focusing on assembling the email with multipart MIME boundaries and correctly encoding the image for inline display.
- Single-pass evaluation converts image binary to base64 for embedding.
- Deterministic MIME message construction with multipart/related format.
- Manual trigger provides controlled workflow execution on demand.
Integrations and Intake
The automation workflow integrates with external HTTP endpoints for image retrieval and Gmail API for email delivery. Authentication for Gmail is handled via OAuth2, ensuring secure credential management. The expected input payload includes sender/recipient email addresses, subject text, and HTML body referencing the embedded image.
- HTTP Request node downloads image from configurable URL.
- OAuth2-secured Gmail API endpoint used for email sending.
- Set node defines email message parameters and HTML content structure.
Outputs and Consumption
The output is a raw MIME email message encapsulated within a JSON object for the Gmail API. The delivery is synchronous, with the email dispatched immediately upon workflow execution. Key fields include base64-encoded raw message and multipart MIME boundaries ensuring inline image rendering.
- Base64-encoded raw MIME message formatted for Gmail API consumption.
- Multipart/related content type ensures embedded image inline display.
- Synchronous HTTP POST triggers immediate email dispatch.
Workflow — End-to-End Execution
Step 1: Trigger
The workflow is initiated manually through the “Test workflow” button within the n8n interface. This manual trigger node starts the process without needing external events or webhooks.
Step 2: Processing
Email parameters including sender, recipient, subject, and HTML body are defined using a Set node. The HTML body includes an image referenced by a content ID, preparing the message for inline image embedding. The workflow performs basic presence checks for these fields without additional schema validation.
Step 3: Analysis
The workflow downloads an image file via an HTTP Request node, then converts this binary data to a base64-encoded string with an Extract From File node. There are no conditional branches or thresholds; the image is always converted and embedded inline.
Step 4: Delivery
The composed MIME email message is sent via an HTTP Request node targeting the Gmail API’s send message endpoint. The request includes OAuth2 credentials for authentication. The delivery is synchronous, and the workflow expects a confirmation response from the Gmail API.
Use Cases
Scenario 1
Marketing teams requiring embedded product images in campaign emails can automate message creation and delivery. This workflow downloads product images, converts them inline, and sends HTML emails, ensuring recipients view images without external links or attachments.
Scenario 2
Customer support can send visually rich responses with inline screenshots or graphics embedded directly in emails. The automation workflow eliminates manual encoding and MIME formatting, returning structured email content in one execution cycle.
Scenario 3
Developers automating notification systems can embed status diagrams or charts in alert emails. By integrating image retrieval and base64 encoding, the workflow delivers inline images reliably through Gmail, reducing reliance on external image hosting.
How to use
To utilize this email with embedded image automation workflow, import it into n8n and update the “Message settings” node with valid sender and recipient email addresses. Replace the image URL in the “Get image” HTTP Request node if needed. Ensure OAuth2 credentials for Gmail API are configured in the “Send message” node. After setup, trigger the workflow manually via the “Test workflow” button. The workflow executes sequentially, retrieving the image, encoding it, composing a MIME email, and sending it through Gmail. Expect the recipient to receive an HTML email with the image displayed inline.
Comparison — Manual Process vs. Automation Workflow
| Attribute | Manual/Alternative | This Workflow |
|---|---|---|
| Steps required | Multiple manual steps: image encoding, MIME formatting, API calls. | One automated sequence combining all steps programmatically. |
| Consistency | Variable; depends on manual encoding and formatting accuracy. | Deterministic MIME construction ensures consistent inline image embedding. |
| Scalability | Limited; manual effort increases with volume. | Scales with n8n execution capabilities and API limits. |
| Maintenance | High; manual updates needed for each email customization. | Low; parameter changes handled in configuration nodes without code. |
Technical Specifications
| Environment | n8n automation platform |
|---|---|
| Tools / APIs | HTTP Request nodes, Set nodes, Extract From File node, Gmail API (OAuth2) |
| Execution Model | Manual trigger with synchronous sequential flow |
| Input Formats | Email parameters as JSON strings, HTTP image response as binary |
| Output Formats | Raw MIME message base64-encoded JSON for Gmail API |
| Data Handling | Transient in-memory processing; no persistence |
| Known Constraints | Requires valid OAuth2 Gmail credentials; image must be accessible over HTTP |
| Credentials | OAuth2 for Gmail API authentication |
Implementation Requirements
- Configured OAuth2 credentials with Gmail API access for sending emails.
- Accessible image URL returning binary data compatible with the HTTP Request node.
- n8n environment with capability to import and run workflows with HTTP and Set nodes.
Configuration & Validation
- Verify the “Message settings” node contains valid email addresses and HTML body referencing the embedded image.
- Confirm the “Get image” node URL returns a valid image accessible via HTTP.
- Ensure OAuth2 credentials are properly configured and authorized in the “Send message” node.
Data Provenance
- Trigger node: manualTrigger activates workflow on user command.
- Set nodes: “Message settings” and “Compose message” define email headers and body.
- HTTP Request nodes retrieve image and send email via Gmail API using OAuth2.
FAQ
How is the email with embedded image automation workflow triggered?
The workflow uses a manual trigger node that executes when the user clicks “Test workflow” within n8n, allowing controlled activation.
Which tools or models does the orchestration pipeline use?
The pipeline uses HTTP Request nodes for image retrieval and Gmail API integration, Set nodes for message composition, and an Extract From File node for base64 encoding.
What does the response look like for client consumption?
The workflow sends a raw MIME email message base64-encoded within a JSON object, compatible with Gmail API’s expectations for inline image display.
Is any data persisted by the workflow?
No persistent storage occurs; all data including images and email content is processed transiently in memory during execution.
How are errors handled in this integration flow?
Errors rely on n8n’s default handling; the workflow contains no custom retry or backoff logic for failed HTTP requests or API calls.
Conclusion
This email with embedded image automation workflow delivers a reliable method to programmatically send HTML emails containing inline images using multipart MIME formatting. It combines image retrieval, base64 encoding, and Gmail API integration within a synchronous orchestration pipeline triggered manually. The workflow’s deterministic construction ensures consistent email rendering with embedded images. A key constraint is the dependency on valid OAuth2 credentials and accessible image URLs. This approach minimizes manual MIME assembly and encoding steps, providing a repeatable solution for embedding images inline in emails using n8n.








Reviews
There are no reviews yet.