{
  "name": "Content Summarizer",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "summarize",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "cs0001-0001-4000-8000-000000000001",
      "name": "Receive Content Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [240, 300]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "name": "content",
              "value": "={{ $json.body.content }}",
              "type": "string"
            },
            {
              "name": "maxLength",
              "value": "={{ $json.body.maxLength || 200 }}",
              "type": "number"
            }
          ]
        }
      },
      "id": "cs0001-0002-4000-8000-000000000002",
      "name": "Extract Input",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [460, 300]
    },
    {
      "parameters": {
        "resource": "text",
        "operation": "message",
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list"
        },
        "messages": {
          "values": [
            {
              "content": "You are a concise content summarizer. Summarize the following content in {{ $json.maxLength }} words or fewer, preserving the key points.\n\nContent:\n{{ $json.content }}"
            }
          ]
        },
        "options": {
          "temperature": 0.3
        }
      },
      "id": "cs0001-0003-4000-8000-000000000003",
      "name": "Summarize with OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1,
      "position": [680, 300]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "name": "summary",
              "value": "={{ $json.message.content }}",
              "type": "string"
            },
            {
              "name": "originalLength",
              "value": "={{ $('Extract Input').item.json.content.length }}",
              "type": "number"
            }
          ]
        }
      },
      "id": "cs0001-0004-4000-8000-000000000004",
      "name": "Format Response",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [900, 300]
    }
  ],
  "connections": {
    "Receive Content Webhook": {
      "main": [[{ "node": "Extract Input", "type": "main", "index": 0 }]]
    },
    "Extract Input": {
      "main": [[{ "node": "Summarize with OpenAI", "type": "main", "index": 0 }]]
    },
    "Summarize with OpenAI": {
      "main": [[{ "node": "Format Response", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "meta": {},
  "pinData": {}
}
