{
  "name": "Google Doc to Published Summary",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [{ "field": "hours", "hoursInterval": 24 }]
        }
      },
      "id": "gdps0001-0001-4000-8000-000000000001",
      "name": "Daily Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [240, 300]
    },
    {
      "parameters": {
        "operation": "get",
        "documentURL": "={{ $env.GDOC_SOURCE_ID }}",
        "options": {}
      },
      "id": "gdps0001-0002-4000-8000-000000000002",
      "name": "Fetch Google Doc",
      "type": "n8n-nodes-base.googleDocs",
      "typeVersion": 2,
      "position": [460, 300]
    },
    {
      "parameters": {
        "resource": "text",
        "operation": "message",
        "modelId": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list"
        },
        "messages": {
          "values": [
            {
              "content": "Read the following document and produce a publish-ready summary suitable for a blog or newsletter. Include: a compelling title (H1), a 3-sentence introduction, 3-5 key takeaways as a numbered list, and a closing call-to-action paragraph. Write in a clear, professional tone.\n\nDocument content:\n{{ $json.content }}"
            }
          ]
        },
        "options": {
          "temperature": 0.5,
          "maxTokens": 1500
        }
      },
      "id": "gdps0001-0003-4000-8000-000000000003",
      "name": "Generate Summary",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1,
      "position": [680, 300]
    },
    {
      "parameters": {
        "operation": "create",
        "title": "=Published Summary - {{ $now.format('yyyy-MM-dd') }}",
        "content": "={{ $json.message.content }}",
        "options": {}
      },
      "id": "gdps0001-0004-4000-8000-000000000004",
      "name": "Create Summary Doc",
      "type": "n8n-nodes-base.googleDocs",
      "typeVersion": 2,
      "position": [900, 300]
    },
    {
      "parameters": {
        "operation": "upload",
        "name": "=Summary {{ $now.format('yyyy-MM-dd') }}.txt",
        "driveId": {
          "__rl": true,
          "value": "My Drive",
          "mode": "list"
        },
        "folderId": {
          "__rl": true,
          "value": "={{ $env.GDRIVE_SUMMARIES_FOLDER }}",
          "mode": "id"
        },
        "options": {}
      },
      "id": "gdps0001-0005-4000-8000-000000000005",
      "name": "Save to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [1120, 300]
    }
  ],
  "connections": {
    "Daily Schedule Trigger": {
      "main": [[{ "node": "Fetch Google Doc", "type": "main", "index": 0 }]]
    },
    "Fetch Google Doc": {
      "main": [[{ "node": "Generate Summary", "type": "main", "index": 0 }]]
    },
    "Generate Summary": {
      "main": [[{ "node": "Create Summary Doc", "type": "main", "index": 0 }]]
    },
    "Create Summary Doc": {
      "main": [[{ "node": "Save to Google Drive", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "meta": {},
  "pinData": {}
}
