Skip to main content

Run Hugging Face open-source AI models via webhook in n8n

Workflow preview

Workflow preview
100%
Run Hugging Face open-source AI models via webhook in n8n preview
Open on n8n.io

1. Workflow Overview

This workflow connects n8n to the Hugging Face Inference API, letting you run powerful open source AI models for text generation, summarization, sentiment analysis, translation, and image generatio...

Best for

  • Content Creation automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.webhook, n8n-nodes-base.set, n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.respondtowebhook

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Oneclick AI Squad.

Original n8n.io source

1.1 Workflow description

Title
Run Hugging Face open-source AI models via webhook in n8n
Workflow name
Run Hugging Face open-source AI models via webhook in n8n

This workflow connects n8n to the Hugging Face Inference API, letting you run powerful open-source AI models for text generation, summarization, sentiment analysis, translation, and image generation — all fully automated, no GPU setup required. Simply POST a request and get AI-powered results back in seconds.


What's the Goal?

To give developers, agencies, and businesses a plug-and-play automation for running any Hugging Face model without managing infrastructure. Replace expensive proprietary APIs with open-source alternatives that you control.

Tasks this workflow handles out of the box:

  • Text generation (GPT-style content writing)
  • Summarization (condense long documents)
  • Sentiment analysis (classify tone of any text)
  • Translation (multilingual content)
  • Image generation (text-to-image via Stable Diffusion)

Why Does It Matter?

Hugging Face hosts over 400,000 open-source models — many matching or exceeding the quality of paid APIs at a fraction of the cost. This workflow:

  • Saves money: free tier available, paid plans start at $9/mo
  • Gives full control: swap any model by changing one field
  • Scales instantly: no GPU provisioning or DevOps needed
  • Works in automation: connects to any n8n trigger or pipeline
  • Produces billable output: agencies can resell AI services built on this

How It Works

Step 1 — Webhook receives the task request with input text and task type Step 2 — Set node stores your Hugging Face API key and normalizes all inputs Step 3 — Code node selects the right model and builds the correct API payload for the task Step 4 — HTTP Request calls the Hugging Face Inference API with the built payload Step 5 — Code node parses and formats the raw API response into clean structured output Step 6 — Respond node returns the final result as JSON to the caller


Configuration Requirements

  • HUGGING_FACE_API_KEY — Get free at huggingface.co/settings/tokens
  • No other credentials needed for basic usage
  • Optional: Google Sheets credential for logging (node already included)

Setup Guide

Step 1: Import this workflow into your n8n instance Step 2: Open the Set API Config node and replace YOUR_HF_API_KEY with your token Step 3: Activate the workflow Step 4: POST to /webhook/hf-runner with your task payload Step 5: Swap models anytime by changing the model field in your request


Sample Webhook Payload

{ "task": "summarization", "input": "Your long text goes here...", "model": "", "parameters": {} }

Supported Task Values

  • text_generation
  • summarization
  • sentiment_analysis
  • translation
  • image_generation

Default Models Used

  • text_generation → mistralai/Mistral-7B-Instruct-v0.2
  • summarization → facebook/bart-large-cnn
  • sentiment_analysis → distilbert-base-uncased-finetuned-sst-2-english
  • translation → Helsinki-NLP/opus-mt-en-fr
  • image_generation → stabilityai/stable-diffusion-xl-base-1.0

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Main Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Flow Guide

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Receive Task Request

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 4 - Set API Config

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - Build Model Payload

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Call Hugging Face API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 7 - Parse and Format Response

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Return Result

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

Block 9 - Flow Guide1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Run Hugging Face open-source AI models via webhook in n8n
Complexity intermediate
Nodes 9
Categories Content Creation, AI Summarization
Author Oneclick AI Squad
Published 02 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13809/13809.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Run Hugging Face open-source AI models via webhook in n8n do?

This workflow connects n8n to the Hugging Face Inference API, letting you run powerful open source AI models for text generation, summarization, sentiment analysis, translation, and image generatio...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, AI Summarization use case.