{
  "name": "Soke — Title Scoring",
  "nodes": [
    {
      "parameters": {},
      "id": "d1b2c3d4-0004-4000-8000-000000000001",
      "name": "When clicking 'Test workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [240, 300]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.usesoke.ai/api/v1/content/score",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"content\": \"{{ $json.title || '10 Developer Productivity Hacks That Actually Work' }}\",\n  \"platform\": \"youtube\",\n  \"targetKeywords\": {{ JSON.stringify($json.keywords || ['developer productivity']) }}\n}",
        "options": {}
      },
      "id": "d1b2c3d4-0004-4000-8000-000000000002",
      "name": "Score Title",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [480, 300],
      "credentials": {
        "httpHeaderAuth": {
          "id": "CREDENTIAL_ID",
          "name": "Soke API"
        }
      }
    },
    {
      "parameters": {
        "mode": "raw",
        "jsonOutput": "={\n  \"overallScore\": {{ $json.data.overallScore }},\n  \"breakdown\": {\n    \"keywordPlacement\": {{ $json.data.breakdown.keywordPlacement.value }},\n    \"lengthOptimization\": {{ $json.data.breakdown.lengthOptimization.value }},\n    \"emotionalPull\": {{ $json.data.breakdown.emotionalPull.value }},\n    \"curiosityGap\": {{ $json.data.breakdown.curiosityGap.value }},\n    \"hookStrength\": {{ $json.data.breakdown.hookStrength.value }}\n  },\n  \"suggestions\": {{ JSON.stringify(Object.entries($json.data.breakdown).filter(([k, v]) => v.suggestion).map(([k, v]) => k + ': ' + v.suggestion)) }}\n}",
        "options": {}
      },
      "id": "d1b2c3d4-0004-4000-8000-000000000003",
      "name": "Extract Score Details",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [720, 300]
    }
  ],
  "connections": {
    "When clicking 'Test workflow'": {
      "main": [
        [{ "node": "Score Title", "type": "main", "index": 0 }]
      ]
    },
    "Score Title": {
      "main": [
        [{ "node": "Extract Score Details", "type": "main", "index": 0 }]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false,
    "instanceId": "soke-template"
  },
  "tags": [
    { "name": "Soke", "id": "soke-tag-1" }
  ]
}
