Public Beta — reserve early accessJoin Waitlist
ThumbAPI logoThumbAPI

ThumbAPI + n8n: Self-Hosted Thumbnail Automation

Connect ThumbAPI to n8n and generate thumbnails automatically inside self-hosted automation workflows. Use n8n's HTTP Request node to call the ThumbAPI endpoint, process responses with code nodes, and route generated images to any destination.

What You Can Build With ThumbAPI + n8n

n8n is a source-available workflow automation platform you can self-host or use via n8n Cloud. It gives you full control over your data and workflows. By adding ThumbAPI as an HTTP Request node, you create an n8n thumbnail automation pipeline that runs entirely on your own infrastructure.

Unlike cloud-only automation tools, n8n lets you inspect every request, store credentials locally, and add custom JavaScript logic between nodes. This makes it ideal for teams with specific security or processing requirements.

  • Generate thumbnails on a schedule from content calendars
  • Process webhook events from your CMS and generate featured images
  • Batch-generate thumbnails from spreadsheets using the Split In Batches node
  • Pre-process titles with JavaScript Function nodes before generation
  • Route thumbnails to different destinations based on format or content type
  • Keep all data on your own servers — no third-party cloud dependency

Step-by-Step Setup: Connect ThumbAPI to n8n

This guide works for both self-hosted n8n and n8n Cloud. The setup takes about five minutes using n8n's built-in HTTP Request node.

Step 1: Get Your ThumbAPI Key

Sign up at ThumbAPI and grab your API key from the dashboard. The free plan includes 3 generations per month, which is enough to build and test your workflows.

  • Go to your ThumbAPI dashboard
  • Copy your Bearer token from the API Keys section
  • You will store this as a credential in n8n in the next step

Step 2: Create a Header Auth Credential in n8n

Before building your workflow, store your API key as a reusable credential. Go to Settings > Credentialsin n8n and create a new “Header Auth” credential:

Credential Type: Header Auth

Name: ThumbAPI
Header Name: Authorization
Header Value: Bearer YOUR_API_KEY

Storing credentials in n8n's credential manager keeps your API key encrypted and separate from workflow definitions. This is especially important for self-hosted instances where workflows may be exported or shared.

Step 3: Create a New Workflow and Add a Trigger

Open n8n and click “New Workflow.” Add a trigger node to start your automation. Common trigger options include:

  • Webhook— Receive HTTP requests from your CMS or other services
  • Schedule Trigger— Run on a cron schedule (hourly, daily, weekly)
  • RSS Feed Read— Monitor RSS feeds for new items
  • WordPress Trigger— React to new posts or page updates
  • Google Sheets— Watch for new or updated rows

Connect the trigger to your data source and test it to confirm n8n can pull in sample data. The output should include a title field that you will send to ThumbAPI.

Step 4: Add the HTTP Request Node

Click the “+” button after your trigger and add an “HTTP Request” node. Configure it to call the ThumbAPI endpoint:

{
  "node": "HTTP Request",
  "method": "POST",
  "url": "https://api.thumbapi.dev/v1/generate",
  "authentication": "Generic Credential Type",
  "genericAuthType": "httpHeaderAuth",
  "headerAuth": {
    "name": "Authorization",
    "value": "Bearer YOUR_API_KEY"
  },
  "sendHeaders": true,
  "headerParameters": {
    "Content-Type": "application/json"
  },
  "sendBody": true,
  "bodyContentType": "json",
  "jsonBody": {
    "title": "={{ $json.title }}",
    "format": "youtube",
    "imageStyle": "faceless"
  }
}

Select the “ThumbAPI” credential you created in Step 2 for the authentication field. n8n automatically adds the Authorization header to every request.

Step 5: Configure the Request Body

Set the body content type to JSON and configure the parameters. Use n8n expressions (the ={{ }} syntax) to map dynamic values from your trigger:

{
  "title": "={{ $json.title }}",
  "format": "youtube",
  "imageStyle": "faceless"
}

The format parameter accepts youtube, instagram, x, or blogpost. Each produces thumbnails with platform-specific dimensions.

The imageStyle parameter controls the visual approach: faceless for text-driven layouts, with-image to include relevant imagery, or with-logo for branded thumbnails.

Step 6: Test the HTTP Request Node

Click “Execute Node” to send a test request. n8n shows the full response in the output panel:

{
  "image": "data:image/webp;base64,UklGR...",
  "format": "youtube",
  "dimensions": {
    "width": 1280,
    "height": 720
  }
}

The image field contains the base64-encoded WebP thumbnail. n8n automatically parses the JSON response, so you can reference individual fields in downstream nodes using expressions like ={{ $json.image }}.

Step 7: Add Downstream Nodes

After the HTTP Request node, add nodes that consume the generated thumbnail. Common destinations include Google Drive, WordPress, S3, Slack, or any service with an n8n integration.

Map the image field from the HTTP response to the file content input of your destination node. For file upload nodes, you may need to use a Function node to convert the base64 string to a Buffer first.

Example n8n Workflows With ThumbAPI

These workflows are ready to import into your n8n instance. Each demonstrates a different trigger type and use case for n8n image generation.

Workflow 1: YouTube RSS to Auto Thumbnail to Google Drive

Monitor your YouTube channel's RSS feed for new uploads. When a video publishes, ThumbAPI generates a matching thumbnail and saves it to Google Drive. A Slack notification lets your team know the thumbnail is ready.

[Trigger] RSS Feed Read
  URL: https://www.youtube.com/feeds/videos.xml?channel_id=YOUR_CHANNEL
  Poll interval: 15 minutes
  ↓
[HTTP Request] POST to ThumbAPI
  Body: { title: "={{ $json.title }}", format: "youtube", imageStyle: "faceless" }
  ↓
[Google Drive] Upload File
  File name: thumbnail-{{ $json.videoId }}.webp
  File content: {{ $json.image }}
  Folder: YouTube Thumbnails
  ↓
[Slack] Send Message
  Channel: #thumbnails
  Text: "Generated thumbnail for: {{ $json.title }}"

YouTube exposes RSS feeds for every channel at youtube.com/feeds/videos.xml?channel_id=YOUR_ID. The RSS Feed Read node polls this feed on your configured interval and passes the video title to ThumbAPI.

Workflow 2: WordPress Post to Featured Image

Automatically generate and attach a featured image every time a new WordPress post is published. The workflow uses the WordPress Trigger node to detect new posts and updates the post with the generated thumbnail.

[Trigger] WordPress Trigger
  Event: Post Published
  ↓
[HTTP Request] POST to ThumbAPI
  Body: { title: "={{ $json.title }}", format: "blogpost", imageStyle: "with-logo" }
  ↓
[WordPress] Update Post
  Post ID: {{ $json.id }}
  Featured Image: {{ $json.image }}

Use the blogpost format for images optimized for article headers and Open Graph social previews. The 1200x630 dimensions work across all major platforms.

Workflow 3: Weekly Batch Processing From Content Calendar

Every Monday morning, read your content calendar from Google Sheets, generate thumbnails for each piece of scheduled content, and update the spreadsheet with the file locations. This is ideal for content teams that plan ahead.

[Trigger] Schedule Trigger
  Cron: 0 9 * * 1  (Every Monday at 9 AM)
  ↓
[Google Sheets] Read Rows
  Spreadsheet: Content Calendar
  Sheet: This Week
  ↓
[Split In Batches] Process each row
  Batch Size: 1
  ↓
[HTTP Request] POST to ThumbAPI
  Body: {
    title: "={{ $json.title }}",
    format: "={{ $json.platform }}",
    imageStyle: "={{ $json.style }}"
  }
  ↓
[Google Drive] Upload File
  Folder: Weekly Thumbnails
  File: {{ $json.title }}.webp
  ↓
[Google Sheets] Update Row
  Column "Thumbnail": "Generated"
  Column "File URL": {{ $json.fileUrl }}

The Split In Batches node processes one row at a time, preventing rate limit issues. Each row can specify its own format and style, letting you generate YouTube, Instagram, and blog thumbnails from a single spreadsheet.

Workflow 4: Webhook-Triggered Thumbnail Service

Turn n8n into a thumbnail microservice. Expose a webhook endpoint that accepts title, format, and style parameters, generates a thumbnail via ThumbAPI, and routes the result based on format.

[Trigger] Webhook
  Method: POST
  Path: /generate-thumbnail
  ↓
[HTTP Request] POST to ThumbAPI
  Body: {
    title: "={{ $json.body.title }}",
    format: "={{ $json.body.format }}",
    imageStyle: "={{ $json.body.imageStyle }}"
  }
  ↓
[IF] Check format
  ├── youtube → [Google Drive] Upload to YouTube folder
  ├── instagram → [Google Drive] Upload to Instagram folder
  └── blogpost → [WordPress] Set Featured Image

This pattern is useful when you want other services in your infrastructure to request thumbnails on demand. Your CMS, build pipeline, or internal tools can POST to the n8n webhook and receive thumbnails without direct ThumbAPI integration.

Advanced: Pre-Processing Titles With Function Nodes

n8n's Function node lets you run custom JavaScript between nodes. Use it to clean titles, extract keywords, or transform data before sending it to ThumbAPI. This is one of n8n's key advantages over cloud-only automation tools.

// Clean and format the title before sending to ThumbAPI
const title = $input.first().json.title;

// Remove HTML entities
const cleanTitle = title
  .replace(/&/g, '&')
  .replace(/&lt;/g, '<')
  .replace(/&gt;/g, '>')
  .replace(/&#39;/g, "'")
  .replace(/&quot;/g, '"');

// Truncate to 100 characters for optimal thumbnail text
const truncatedTitle = cleanTitle.length > 100
  ? cleanTitle.substring(0, 97) + '...'
  : cleanTitle;

return [{
  json: {
    title: truncatedTitle,
    originalTitle: title,
    format: $input.first().json.format || 'youtube',
    imageStyle: $input.first().json.imageStyle || 'faceless'
  }
}];

Insert this Function node between your trigger and the HTTP Request node. It strips HTML entities and truncates long titles to ensure clean, readable text on the generated thumbnail.

Why Use n8n for Thumbnail Automation

n8n offers advantages over cloud-only automation platforms, especially for teams that value data control and customization. The n8n API workflow approach to thumbnail generation is ideal for these reasons:

  • Self-hosted option. Run n8n on your own servers. Your API keys, content titles, and generated thumbnails never leave your infrastructure.
  • Custom code execution. Function nodes let you run JavaScript to clean titles, transform data, or add conditional logic that visual-only tools cannot handle.
  • No per-execution fees. Self-hosted n8n has no per-task pricing. Generate as many thumbnails as your ThumbAPI plan allows without additional automation costs.
  • Full debugging. Inspect every input and output at every node. See the exact request sent to ThumbAPI and the exact response returned.
  • Version control. Export workflows as JSON and store them in Git. Track changes, roll back, and share workflows across team members.
  • Community nodes. Access hundreds of community-built nodes for niche integrations that cloud platforms do not support.

Tips for Production n8n Workflows

  • Always use credentials.Store your ThumbAPI key in n8n's credential manager rather than hardcoding it in the HTTP Request node. Credentials are encrypted at rest.
  • Enable “Continue On Fail” on the HTTP Request node for batch workflows. If one thumbnail fails, the remaining items still process.
  • Set retry on fail. Configure the HTTP Request node to retry once or twice on failure. Transient network errors will resolve automatically.
  • Use the Wait nodebetween batch items to avoid hitting rate limits. A 1–2 second delay between requests keeps your workflow reliable.
  • Export workflows to JSON.Back up your workflows regularly. n8n's JSON export format is version-control friendly and easy to share.

Common Questions

Does ThumbAPI have a native n8n node?

Not yet. You use n8n's built-in HTTP Request node, which provides full control over the request configuration. A community node may be available in the future.

Does this work with self-hosted n8n?

Yes. The HTTP Request node works identically on self-hosted n8n and n8n Cloud. Your n8n instance just needs outbound HTTPS access to reach the ThumbAPI endpoint at api.thumbapi.dev.

How do I handle large base64 images in n8n?

ThumbAPI returns WebP images, which are compact. A typical thumbnail is 50–150 KB in base64. n8n handles this without issues. For file uploads, use a Function node to convert the base64 string to a Buffer using Buffer.from(base64String, 'base64').

What is the response time for thumbnail generation?

ThumbAPI returns generated thumbnails in 3–8 seconds. n8n's HTTP Request node has a configurable timeout (default 300 seconds), so there are no timeout concerns.

Start Automating Thumbnails With n8n

Get your ThumbAPI key and build your first n8n workflow in minutes. 3 free generations per month.