Hugging Face
The Hugging Face block runs machine-learning tasks through the Hugging Face Inference API — classify or summarize text, translate, answer questions, extract entities, caption images, and detect objects, straight from your workflow.
AI Building Blocks: Each task uses a curated default model, so it works out of the box. Power users can override the model with any compatible model ID from the Hugging Face Hub — including their own fine-tuned models.
Key Features
- Seven Ready-Made Tasks: Text and vision tasks with sensible default models
- Model Override: Optionally point a task at any model ID from the Hugging Face Hub
- Variable Support: Feed text, questions, and image URLs from earlier blocks
- Response Mapping: Save the result (or a specific part of it) into workflow variables
- Automatic Retries: If a model is still loading, the block waits and retries before failing
Task Types
| Task | Setting label | Input fields | What you get back |
|---|---|---|---|
text-classification | Classify text | Text | Labels with confidence scores (e.g. positive / negative) |
summarization | Summarize text | Text | A short summary |
translation | Translate text | Text, Target Language | The translated text |
question-answering | Answer questions | Question, Context | The answer found in the context |
token-classification | Extract named entities | Text | Named entities (people, places, organizations) |
image-to-text | Caption image | Image URL | A caption describing the image |
object-detection | Detect objects | Image URL | Detected objects with labels and positions |
Available target languages for translation: French, Spanish, German, Chinese, Hindi, Arabic, Portuguese, Italian, Russian, and Japanese.
Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
| Hugging Face account | Credential | Yes | Your API token connection |
| Task Type | Select | Yes | One of the seven tasks above |
| Model | Text | No | Optional model ID from the Hugging Face Hub to override the task's default |
| Text | Text | Text tasks | The input text; supports {{variables}} |
| Question / Context | Text | Question answering | The question, and the paragraph to search for the answer |
| Target Language | Select | Translation | The language to translate into |
| Image URL | Text | Vision tasks | Public URL of the image to analyze |
| Execution Result | Variable mapping | No | Save the result into workflow variables |
Setting up the credential
- Sign in at huggingface.co (opens in a new tab) and open Settings → Access Tokens.
- Create a token (a Read token is enough for inference) and copy it.
- In the block settings, click to add a Hugging Face account.
- Enter a label and paste the API Token, then save.
Example: multilingual review triage
- A Webhook Trigger receives a product review.
- A Hugging Face block with Translate text (target: English) translates
{{review_text}}. - A second Hugging Face block with Classify text scores the sentiment of the translation.
- A Condition block routes negative reviews to a Slack alert for the support team.
Output
The block returns the model's result for the selected task — for example, an array of { label, score } pairs for classification, { summary_text } for summarization, the translated string for translation, and { answer, score } for question answering. Use the Execution Result mapping to store the result in a variable; you can also map a specific path inside the response body to extract just the part you need.
Models on the free Inference API may take a moment to load on first use. The block retries automatically, but if you see a "model is still loading" error, wait about 30 seconds and run again.