Back to Integrations
integrationGmail node
integrationNextcloud node

Gmail and Nextcloud integration

Save yourself the work of writing custom integrations for Gmail and Nextcloud and use n8n instead. Build adaptable and scalable Communication, HITL, and Data & Storage workflows that work with your technology stack. All within a building experience you will love.

How to connect Gmail and Nextcloud

  • Step 1: Create a new workflow
  • Step 2: Add and configure nodes
  • Step 3: Connect
  • Step 4: Customize and extend your integration
  • Step 5: Test and activate your workflow

Step 1: Create a new workflow and add the first step

In n8n, click the "Add workflow" button in the Workflows tab to create a new workflow. Add the starting point – a trigger on when your workflow should run: an app event, a schedule, a webhook call, another workflow, an AI chat, or a manual trigger. Sometimes, the HTTP Request node might already serve as your starting point.

Gmail and Nextcloud integration: Create a new workflow and add the first step

Step 2: Add and configure Gmail and Nextcloud nodes

You can find Gmail and Nextcloud in the nodes panel. Drag them onto your workflow canvas, selecting their actions. Click each node, choose a credential, and authenticate to grant n8n access. Configure Gmail and Nextcloud nodes one by one: input data on the left, parameters in the middle, and output data on the right.

Gmail and Nextcloud integration: Add and configure Gmail and Nextcloud nodes

Step 3: Connect Gmail and Nextcloud

A connection establishes a link between Gmail and Nextcloud (or vice versa) to route data through the workflow. Data flows from the output of one node to the input of another. You can have single or multiple connections for each node.

Gmail and Nextcloud integration: Connect Gmail and Nextcloud

Step 4: Customize and extend your Gmail and Nextcloud integration

Use n8n's core nodes such as If, Split Out, Merge, and others to transform and manipulate data. Write custom JavaScript or Python in the Code node and run it as a step in your workflow. Connect Gmail and Nextcloud with any of n8n’s 1000+ integrations, and incorporate advanced AI logic into your workflows.

Gmail and Nextcloud integration: Customize and extend your Gmail and Nextcloud integration

Step 5: Test and activate your Gmail and Nextcloud workflow

Save and run the workflow to see if everything works as expected. Based on your configuration, data should flow from Gmail to Nextcloud or vice versa. Easily debug your workflow: you can check past executions to isolate and fix the mistake. Once you've tested everything, make sure to save your workflow and activate it.

Gmail and Nextcloud integration: Test and activate your Gmail and Nextcloud workflow

Generate Interior Moodboards with Claude/Gemini Agents, Hugging Face Image Generation, and PDF Export

🎨 Template Overview

This comprehensive n8n workflow automates the complete process of generating professional interior design moodboards from concept to client delivery. Users submit a design brief through a form, and the system automatically generates 12 AI-powered images, compiles them into a beautifully formatted two-page PDF moodboard, and emails the final deliverable.

Key Features:
Form-based design brief submission
AI-powered image prompt generation (12 detailed prompts per project)
Automated image generation via Hugging Face API
Nextcloud cloud storage with public URL sharing
Professional two-page HTML/PDF moodboard creation
Automated email delivery with PDF attachment

Technologies Used: Claude Sonnet 4 (OpenRouter), Google Gemini 2.5 Pro, Hugging Face FLUX.1-schnell, Nextcloud, Gotenberg PDF Service, Gmail

⚙️ Self-Hosted Requirements

This template requires the following self-hosted or third-party services:

Nextcloud Instance** - For cloud file storage and public URL generation
Gotenberg PDF Service** - For HTML to PDF conversion (can be self-hosted via Docker)
OpenRouter API Access** - For Claude Sonnet 4 AI agent
Google Gemini API Access** - For secondary AI processing
Hugging Face API Access** - For FLUX.1-schnell image generation
Gmail Account** - For email delivery (or any SMTP service)

📋 Setup Instructions

Step 1: Configure API Credentials

OpenRouter (Claude Sonnet 4)
Sign up at openrouter.ai
Generate an API key
Add credentials to the "OpenRouter Chat Model" node

Google Gemini API
Visit Google AI Studio
Create an API key
Add credentials to the "Google Gemini Chat Model1" node

Hugging Face API
Register at huggingface.co
Generate an access token from Settings → Access Tokens
Add credentials to the "Image Generator" node using HTTP Header Auth
Header name: Authorization, Value: Bearer YOUR_TOKEN

Nextcloud
Set up a Nextcloud instance or use a hosted provider
Generate an app password from Settings → Security
Configure credentials in all Nextcloud nodes:
"Create a folder"
"Upload Image"
"Share a file"

Gotenberg PDF Service
Self-host using Docker: docker run --rm -p 3000:3000 gotenberg/gotenberg:8
Or use a hosted instance
Update the URL in the "PDF creator" node
Configure HTTP Basic Auth credentials if required

Gmail
Enable 2-Factor Authentication on your Google account
Generate an App Password from Google Account settings
Add OAuth2 credentials to the "Send PDF" node

Step 2: Customize Workflow Settings

Email Extractor Node
Review the stripPlus variable (default: true)
This removes "+tag" portions from email addresses for folder naming

Nextcloud Folder Structure
Default path: /moodboard/{username}/
Modify in "Create a folder" node if needed

Image Generator Settings
Model: FLUX.1-schnell (fast generation, good quality)
Adjust model in "Image Generator" node if needed
Alternative models: FLUX.1-dev, Stable Diffusion XL

PDF Generation Settings
Default timeout: 360 seconds
Page size: A4 (210mm × 297mm)
Adjust in "PDF creator" node headers if needed

Step 3: Test the Workflow

Activate the Form
Open the "Moodboard Form" node
Copy the webhook URL
Access the form in your browser

Submit a Test Request
Fill in the form fields:
Title: Short, descriptive name (e.g., "Modern Minimalist Bedroom")
Description: Detailed design brief with colors, materials, mood, lighting
Email: Your test email address
Submit and monitor workflow execution

Verify Each Stage
Check Nextcloud folder creation
Monitor image generation progress (12 images)
Review HTML moodboard generation
Confirm PDF creation
Check email delivery

Step 4: Configure Form Embedding (Optional)

Embed the form on your website:

<iframe
src="YOUR_N8N_FORM_WEBHOOK_URL"
width="100%"
height="800"
frameborder="0">
</iframe>

🔄 Workflow Structure

  1. Form Input & Data Extraction
    Moodboard Form** - Collects project title, description, and user email
    Email Extractor** - Extracts username from email for folder organization

  2. Storage Setup
    Create a Folder** - Creates personalized Nextcloud directory using email username

  3. AI Concept Generation
    Conceptualization Agent** (Claude Sonnet 4) - Analyzes design brief and generates 12 detailed image prompts (300-500 words each)
    Images 1-11: Individual design elements (furniture, materials, details, styling)
    Image 12: Comprehensive 3D rendered view integrating all elements

  4. Image Processing Loop
    Concept Splitter** - Separates 12 prompts into individual items
    Loop Over Items** - Processes each prompt sequentially:
    Image Generator - Sends prompt to Hugging Face FLUX.1-schnell API
    Upload Image - Stores generated image in Nextcloud folder
    Share a File - Creates public shareable URL
    Set Image Title and URL - Formats data for aggregation

  5. URL Collection
    URL Aggregate** - Combines all 12 public image URLs
    Clean URLs** - Extracts and formats URLs into a structured list

  6. Moodboard Compilation
    Moodboard Generator Agent** (Google Gemini 2.5 Pro) - Creates professional two-page HTML document:
    Page 1: Visual moodboard with all 12 images (Image #12 prominently featured 2-3x larger)
    Page 2: Administrative summary with design overview, color palette, materials, and project details

  7. PDF Generation & Delivery
    Binary Converter** - Transforms HTML to base64-encoded binary format
    PDF Creator** - Converts HTML to print-ready PDF via Gotenberg service
    Send PDF** - Emails final moodboard PDF to user

🎯 Node Descriptions

Moodboard Form
Collects moodboard generation requests for any design topic. Users input a title, detailed description (colors, materials, patterns, textures, lighting), and email address for delivery.

Email Extractor
Extracts the username portion from email addresses, optionally stripping "+tags" for clean folder naming and user identification.

Create a Folder
Creates a dedicated Nextcloud folder using the extracted email username, organizing moodboard outputs by user.

Conceptualization Agent
AI agent that analyzes design briefs to generate 12 detailed image prompts (300-500 words each). Performs conceptual analysis of styles, colors, materials, and spatial requirements, outputting structured JSON.

Concept Splitter
Splits the 12 generated image prompts into individual items for parallel processing through the image generation pipeline.

Loop Over Items
Processes each prompt sequentially, generating images, uploading to Nextcloud, and creating public URLs.

Image Generator
Sends detailed prompts to Hugging Face FLUX.1-schnell API for AI-powered image generation, transforming written design concepts into high-quality visuals.

Upload Image
Uploads each generated moodboard image to the user's Nextcloud folder with appropriate naming conventions.

Share a File
Creates publicly shareable Nextcloud links for each uploaded image, enabling external viewing without authentication.

Set Image Title and URL
Formats image metadata (title and URL) for downstream aggregation.

URL Aggregate
Combines all 12 image URLs into a single consolidated output for moodboard compilation.

Clean URLs
Extracts and formats URLs from the aggregated data into a clean, structured list with count.

Moodboard Generator Agent
Transforms design concepts into professional two-page HTML moodboards. Analyzes project details and 12 image URLs, selecting appropriate visual styles. Creates artistic Page 1 with Image #12 as hero element, and comprehensive Page 2 with design documentation.

Binary Converter
Prepares HTML for PDF conversion by transforming it into binary format with proper encoding and filename ("index.html") for Gotenberg compatibility.

PDF Creator
Converts HTML moodboard into print-ready PDF with proper A4 dimensions, page breaks, and high-quality image resolution.

Send PDF
Emails the finalized PDF moodboard to the user's submitted email address with project details and PDF attachment.

🎨 Customization Options

Design Styles
The Moodboard Generator Agent automatically selects from 10 layout styles:
Modern Sectional Grid
Material Board Collage
Editorial Magazine
Clean Minimalist
Split-Screen Dramatic
Asymmetric Feature
Centered Showcase
Modular Block System
Organic Flow
Layered Depth

Image Generation Models
Replace FLUX.1-schnell with alternatives in the "Image Generator" node:
black-forest-labs/FLUX.1-dev - Higher quality, slower
stabilityai/stable-diffusion-xl-base-1.0 - Classic SD XL

Email Templates
Customize the email message in the "Send PDF" node to include:
Brand messaging
Next steps
Support contact information
Pricing information

🐛 Troubleshooting

Images Not Generating
Verify Hugging Face API token is valid
Check API rate limits and quotas
Increase timeout in "Image Generator" node (default: unlimited)

PDF Generation Fails
Ensure Gotenberg service is accessible
Verify HTML output contains all 12 image URLs
Check timeout settings (default: 360s)
Review Gotenberg logs for specific errors

Nextcloud Upload Errors
Confirm folder creation succeeded
Verify Nextcloud credentials and permissions
Check available storage space
Ensure WebDAV is enabled

Email Not Received
Verify Gmail OAuth2 credentials
Check spam/junk folders
Confirm email address is valid
Review Gmail API quotas

📊 Performance Notes

Average execution time**: 5-8 minutes (depends on image generation)
Image generation**: ~20-30 seconds per image (12 images = 4-6 minutes)
PDF generation**: ~30-60 seconds
Total data processed**: ~15-25 MB per workflow execution

🔐 Security Considerations

Store all API keys in n8n credentials (never hardcode)
Use environment variables for sensitive configuration
Implement rate limiting on the form webhook
Consider adding CAPTCHA to prevent abuse
Regularly rotate API keys and passwords
Use HTTPS for all external communications

📝 License & Attribution

This template is provided as-is for the n8n community. Feel free to modify and adapt to your needs.

AI Models Used:
Claude Sonnet 4 (Anthropic via OpenRouter)
Google Gemini 2.5 Pro (Google)
FLUX.1-schnell (Black Forest Labs via Hugging Face)

🤝 Support & Contributions

For questions or improvements, please reach out through the n8n community forum or submit issues/PRs to enhance this template.

Created by: Jameson Kanakulya
Template Version: 1.0
Last Updated: November 2025

Nodes used in this workflow

Popular Gmail and Nextcloud workflows

+5

Generate Interior Moodboards with Claude/Gemini Agents, Hugging Face Image Generation, and PDF Export

🎨 Template Overview This comprehensive n8n workflow automates the complete process of generating professional interior design moodboards from concept to client delivery. Users submit a design brief through a form, and the system automatically generates 12 AI-powered images, compiles them into a beautifully formatted two-page PDF moodboard, and emails the final deliverable. Key Features: Form-based design brief submission AI-powered image prompt generation (12 detailed prompts per project) Automated image generation via Hugging Face API Nextcloud cloud storage with public URL sharing Professional two-page HTML/PDF moodboard creation Automated email delivery with PDF attachment Technologies Used: Claude Sonnet 4 (OpenRouter), Google Gemini 2.5 Pro, Hugging Face FLUX.1-schnell, Nextcloud, Gotenberg PDF Service, Gmail ⚙️ Self-Hosted Requirements This template requires the following self-hosted or third-party services: Nextcloud Instance** - For cloud file storage and public URL generation Gotenberg PDF Service** - For HTML to PDF conversion (can be self-hosted via Docker) OpenRouter API Access** - For Claude Sonnet 4 AI agent Google Gemini API Access** - For secondary AI processing Hugging Face API Access** - For FLUX.1-schnell image generation Gmail Account** - For email delivery (or any SMTP service) 📋 Setup Instructions Step 1: Configure API Credentials OpenRouter (Claude Sonnet 4) Sign up at openrouter.ai Generate an API key Add credentials to the "OpenRouter Chat Model" node Google Gemini API Visit Google AI Studio Create an API key Add credentials to the "Google Gemini Chat Model1" node Hugging Face API Register at huggingface.co Generate an access token from Settings → Access Tokens Add credentials to the "Image Generator" node using HTTP Header Auth Header name: Authorization, Value: Bearer YOUR_TOKEN Nextcloud Set up a Nextcloud instance or use a hosted provider Generate an app password from Settings → Security Configure credentials in all Nextcloud nodes: "Create a folder" "Upload Image" "Share a file" Gotenberg PDF Service Self-host using Docker: docker run --rm -p 3000:3000 gotenberg/gotenberg:8 Or use a hosted instance Update the URL in the "PDF creator" node Configure HTTP Basic Auth credentials if required Gmail Enable 2-Factor Authentication on your Google account Generate an App Password from Google Account settings Add OAuth2 credentials to the "Send PDF" node Step 2: Customize Workflow Settings Email Extractor Node Review the stripPlus variable (default: true) This removes "+tag" portions from email addresses for folder naming Nextcloud Folder Structure Default path: /moodboard/{username}/ Modify in "Create a folder" node if needed Image Generator Settings Model: FLUX.1-schnell (fast generation, good quality) Adjust model in "Image Generator" node if needed Alternative models: FLUX.1-dev, Stable Diffusion XL PDF Generation Settings Default timeout: 360 seconds Page size: A4 (210mm × 297mm) Adjust in "PDF creator" node headers if needed Step 3: Test the Workflow Activate the Form Open the "Moodboard Form" node Copy the webhook URL Access the form in your browser Submit a Test Request Fill in the form fields: Title: Short, descriptive name (e.g., "Modern Minimalist Bedroom") Description: Detailed design brief with colors, materials, mood, lighting Email: Your test email address Submit and monitor workflow execution Verify Each Stage Check Nextcloud folder creation Monitor image generation progress (12 images) Review HTML moodboard generation Confirm PDF creation Check email delivery Step 4: Configure Form Embedding (Optional) Embed the form on your website: <iframe src="YOUR_N8N_FORM_WEBHOOK_URL" width="100%" height="800" frameborder="0"> </iframe> 🔄 Workflow Structure Form Input & Data Extraction Moodboard Form** - Collects project title, description, and user email Email Extractor** - Extracts username from email for folder organization Storage Setup Create a Folder** - Creates personalized Nextcloud directory using email username AI Concept Generation Conceptualization Agent** (Claude Sonnet 4) - Analyzes design brief and generates 12 detailed image prompts (300-500 words each) Images 1-11: Individual design elements (furniture, materials, details, styling) Image 12: Comprehensive 3D rendered view integrating all elements Image Processing Loop Concept Splitter** - Separates 12 prompts into individual items Loop Over Items** - Processes each prompt sequentially: Image Generator - Sends prompt to Hugging Face FLUX.1-schnell API Upload Image - Stores generated image in Nextcloud folder Share a File - Creates public shareable URL Set Image Title and URL - Formats data for aggregation URL Collection URL Aggregate** - Combines all 12 public image URLs Clean URLs** - Extracts and formats URLs into a structured list Moodboard Compilation Moodboard Generator Agent** (Google Gemini 2.5 Pro) - Creates professional two-page HTML document: Page 1: Visual moodboard with all 12 images (Image #12 prominently featured 2-3x larger) Page 2: Administrative summary with design overview, color palette, materials, and project details PDF Generation & Delivery Binary Converter** - Transforms HTML to base64-encoded binary format PDF Creator** - Converts HTML to print-ready PDF via Gotenberg service Send PDF** - Emails final moodboard PDF to user 🎯 Node Descriptions Moodboard Form Collects moodboard generation requests for any design topic. Users input a title, detailed description (colors, materials, patterns, textures, lighting), and email address for delivery. Email Extractor Extracts the username portion from email addresses, optionally stripping "+tags" for clean folder naming and user identification. Create a Folder Creates a dedicated Nextcloud folder using the extracted email username, organizing moodboard outputs by user. Conceptualization Agent AI agent that analyzes design briefs to generate 12 detailed image prompts (300-500 words each). Performs conceptual analysis of styles, colors, materials, and spatial requirements, outputting structured JSON. Concept Splitter Splits the 12 generated image prompts into individual items for parallel processing through the image generation pipeline. Loop Over Items Processes each prompt sequentially, generating images, uploading to Nextcloud, and creating public URLs. Image Generator Sends detailed prompts to Hugging Face FLUX.1-schnell API for AI-powered image generation, transforming written design concepts into high-quality visuals. Upload Image Uploads each generated moodboard image to the user's Nextcloud folder with appropriate naming conventions. Share a File Creates publicly shareable Nextcloud links for each uploaded image, enabling external viewing without authentication. Set Image Title and URL Formats image metadata (title and URL) for downstream aggregation. URL Aggregate Combines all 12 image URLs into a single consolidated output for moodboard compilation. Clean URLs Extracts and formats URLs from the aggregated data into a clean, structured list with count. Moodboard Generator Agent Transforms design concepts into professional two-page HTML moodboards. Analyzes project details and 12 image URLs, selecting appropriate visual styles. Creates artistic Page 1 with Image #12 as hero element, and comprehensive Page 2 with design documentation. Binary Converter Prepares HTML for PDF conversion by transforming it into binary format with proper encoding and filename ("index.html") for Gotenberg compatibility. PDF Creator Converts HTML moodboard into print-ready PDF with proper A4 dimensions, page breaks, and high-quality image resolution. Send PDF Emails the finalized PDF moodboard to the user's submitted email address with project details and PDF attachment. 🎨 Customization Options Design Styles The Moodboard Generator Agent automatically selects from 10 layout styles: Modern Sectional Grid Material Board Collage Editorial Magazine Clean Minimalist Split-Screen Dramatic Asymmetric Feature Centered Showcase Modular Block System Organic Flow Layered Depth Image Generation Models Replace FLUX.1-schnell with alternatives in the "Image Generator" node: black-forest-labs/FLUX.1-dev - Higher quality, slower stabilityai/stable-diffusion-xl-base-1.0 - Classic SD XL Email Templates Customize the email message in the "Send PDF" node to include: Brand messaging Next steps Support contact information Pricing information 🐛 Troubleshooting Images Not Generating Verify Hugging Face API token is valid Check API rate limits and quotas Increase timeout in "Image Generator" node (default: unlimited) PDF Generation Fails Ensure Gotenberg service is accessible Verify HTML output contains all 12 image URLs Check timeout settings (default: 360s) Review Gotenberg logs for specific errors Nextcloud Upload Errors Confirm folder creation succeeded Verify Nextcloud credentials and permissions Check available storage space Ensure WebDAV is enabled Email Not Received Verify Gmail OAuth2 credentials Check spam/junk folders Confirm email address is valid Review Gmail API quotas 📊 Performance Notes Average execution time**: 5-8 minutes (depends on image generation) Image generation**: ~20-30 seconds per image (12 images = 4-6 minutes) PDF generation**: ~30-60 seconds Total data processed**: ~15-25 MB per workflow execution 🔐 Security Considerations Store all API keys in n8n credentials (never hardcode) Use environment variables for sensitive configuration Implement rate limiting on the form webhook Consider adding CAPTCHA to prevent abuse Regularly rotate API keys and passwords Use HTTPS for all external communications 📝 License & Attribution This template is provided as-is for the n8n community. Feel free to modify and adapt to your needs. AI Models Used: Claude Sonnet 4 (Anthropic via OpenRouter) Google Gemini 2.5 Pro (Google) FLUX.1-schnell (Black Forest Labs via Hugging Face) 🤝 Support & Contributions For questions or improvements, please reach out through the n8n community forum or submit issues/PRs to enhance this template. Created by: Jameson Kanakulya Template Version: 1.0 Last Updated: November 2025

Build your own Gmail and Nextcloud integration

Create custom Gmail and Nextcloud workflows by choosing triggers and actions. Nodes come with global operations and settings, as well as app-specific parameters that can be configured. You can also use the HTTP Request node to query data from any app or service with a REST API.

Gmail supported actions

Add Label
Delete
Get
Get Many
Mark as Read
Mark as Unread
Remove Label
Reply
Send
Send and Wait for Response
Create
Delete
Get
Get Many
Create
Delete
Get
Get Many
Add Label
Delete
Get
Get Many
Remove Label
Reply
Trash
Untrash

Nextcloud supported actions

Copy
Copy a file
Delete
Delete a file
Download
Download a file
Move
Move a file
Share
Share a file
Upload
Upload a file
Copy
Copy a folder
Create
Create a folder
Delete
Delete a folder
List
Return the contents of a given folder
Move
Move a folder
Share
Share a folder
Create
Invite a user to a NextCloud organization
Delete
Delete a user
Get
Retrieve information about a single user
Get Many
Retrieve a list of users
Update
Edit attributes related to a user

FAQs

  • Can Gmail connect with Nextcloud?

  • Can I use Gmail’s API with n8n?

  • Can I use Nextcloud’s API with n8n?

  • Is n8n secure for integrating Gmail and Nextcloud?

  • How to get started with Gmail and Nextcloud integration in n8n.io?

Need help setting up your Gmail and Nextcloud integration?

Discover our latest community's recommendations and join the discussions about Gmail and Nextcloud integration.
jake chard
Jan Koch
Mark L.
Paul Kennard

Looking to integrate Gmail and Nextcloud in your company?

Over 3000 companies switch to n8n every single week

Why use n8n to integrate Gmail with Nextcloud

Build complex workflows, really fast

Build complex workflows, really fast

Handle branching, merging and iteration easily.
Pause your workflow to wait for external events.

Code when you need it, UI when you don't

Simple debugging

Your data is displayed alongside your settings, making edge cases easy to track down.

Use templates to get started fast

Use 1000+ workflow templates available from our core team and our community.

Reuse your work

Copy and paste, easily import and export workflows.

Implement complex processes faster with n8n

red iconyellow iconred iconyellow icon