{
  "name": "Hubris · Контент-генератор статей",
  "nodes": [
    {
      "parameters": {
        "content": "## Контент-генератор статей\n\nЧтобы запустить:\n1. Добавьте credential типа **OpenAI API**:\n   - API Key: `sk-gw-...` (ваш ключ Hubris)\n   - Base URL: `https://api.hubris.pw/v1`\n2. В узле «Generate Article» выберите этот credential и нужную модель.\n3. Активируйте workflow и отправьте POST-запрос на `/webhook/content-generator` с телом:\n   ```json\n   { \"topic\": \"тема статьи\", \"keywords\": \"ключевые слова\" }\n   ```",
        "height": 280,
        "width": 500
      },
      "id": "sticky-note-1",
      "name": "Инструкция",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [0, 0]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "content-generator",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-1",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [560, 160],
      "webhookId": "content-generator"
    },
    {
      "parameters": {
        "authentication": "apiKey",
        "resource": "chat",
        "operation": "complete",
        "model": "anthropic/claude-sonnet-4-5",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "Ты — профессиональный SEO-копирайтер. Пиши статьи на русском языке с чёткой структурой: заголовок H1, вводный абзац, 3–5 разделов с подзаголовками H2, заключение. Используй ключевые слова органично. Объём — 800–1200 слов."
            },
            {
              "role": "user",
              "content": "Напиши SEO-структурированную статью на тему: {{ $json.body.topic }}.\nКлючевые слова для включения: {{ $json.body.keywords }}."
            }
          ]
        },
        "options": {}
      },
      "id": "openai-1",
      "name": "Generate Article",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [780, 160],
      "credentials": {
        "openAiApi": {
          "id": "YOUR_CREDENTIAL_ID",
          "name": "Hubris OpenAI"
        }
      }
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={\n  \"article\": {{ JSON.stringify($json.message.content) }}\n}",
        "options": {}
      },
      "id": "respond-1",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [1000, 160]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Generate Article",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Article": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": true
  }
}
