{
  "name": "Run Hugging Face open-source AI models via webhook in n8n",
  "nodes": [
    {
      "id": "e5af3623-cb11-41bd-8823-c00d4578c342",
      "name": "Main Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -272
      ],
      "parameters": {
        "width": 1408,
        "height": 1468,
        "content": "# n8n Hugging Face Workflow\n## Run Open-Source AI Models Automatically\n\n---\n\n### Description\nThis workflow connects n8n to the Hugging Face Inference API, letting you run powerful open-source AI model"
      }
    },
    {
      "id": "1a48bd5c-8f54-497b-a17a-92ec92a2e66e",
      "name": "Flow Guide",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        16
      ],
      "parameters": {
        "width": 608,
        "height": 536,
        "content": "### 1. Request and builds the correct API\n\nWebhook receives the task request with input text and task type and stores your Hugging Face API key and normalizes all inputs then selects the right model a"
      }
    },
    {
      "id": "e3956749-268d-4d66-bf66-75ef24ec1e46",
      "name": "Receive Task Request",
      "type": "n8n-nodes-base.webhook",
      "position": [
        1264,
        352
      ]
    },
    {
      "id": "8ee44072-1067-4fb5-ad3a-e28886a402e8",
      "name": "Set API Config",
      "type": "n8n-nodes-base.set",
      "position": [
        1472,
        352
      ]
    },
    {
      "id": "e767998b-63c4-4d9e-bff5-fe9d51c7da74",
      "name": "Build Model Payload",
      "type": "n8n-nodes-base.code",
      "position": [
        1696,
        352
      ]
    },
    {
      "id": "87092f41-6704-462c-8a87-8ad047ca809c",
      "name": "Call Hugging Face API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1920,
        352
      ]
    },
    {
      "id": "6a285588-0068-4623-99ec-b46141d0e6c2",
      "name": "Parse and Format Response",
      "type": "n8n-nodes-base.code",
      "position": [
        2144,
        352
      ]
    },
    {
      "id": "d582c9bf-69aa-42ea-80d4-91188fd2c160",
      "name": "Return Result",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        2352,
        352
      ]
    },
    {
      "id": "6e67090c-d7f7-4a04-aad5-f5412e00d42e",
      "name": "Flow Guide1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1872,
        16
      ],
      "parameters": {
        "width": 608,
        "height": 536,
        "content": "### 2. API response\n\nHTTP Request calls the Hugging Face Inference API with the built payload then parses and formats the raw API response into clean structured output and returns the final result as "
      }
    }
  ],
  "connections": {
    "Set API Config": {
      "main": [
        [
          {
            "node": "Build Model Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Model Payload": {
      "main": [
        [
          {
            "node": "Call Hugging Face API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Task Request": {
      "main": [
        [
          {
            "node": "Set API Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Hugging Face API": {
      "main": [
        [
          {
            "node": "Parse and Format Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse and Format Response": {
      "main": [
        [
          {
            "node": "Return Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}