{
  "name": "#️⃣Nostr #damus AI Powered Reporting + Gmail + Telegram",
  "nodes": [
    {
      "id": "e9c4c7bf-0cce-456e-9b95-726669e4b260",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -500,
        -60
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b8f57e15-8a6e-4a29-a6e8-745bebbd1f44",
      "name": "Get HTML",
      "type": "n8n-nodes-base.markdown",
      "position": [
        880,
        -840
      ],
      "parameters": {
        "mode": "markdownToHtml",
        "options": {},
        "markdown": "={{ $json.text }}"
      },
      "typeVersion": 1
    },
    {
      "id": "8b212119-9b69-449c-8a3b-4fdc5b085f30",
      "name": "Gmail Themes",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1080,
        -840
      ],
      "parameters": {
        "sendTo": "REPLACE_WITH_SENDTO",
        "message": "={{ $json.data }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "#damus"
      },
      "typeVersion": 2.1
    },
    {
      "id": "b7fc214b-72cb-4caf-8563-7b2f13a1110d",
      "name": "Get HTML Report",
      "type": "n8n-nodes-base.markdown",
      "position": [
        880,
        80
      ],
      "parameters": {
        "mode": "markdownToHtml",
        "options": {},
        "markdown": "={{ $json.text }}"
      },
      "typeVersion": 1
    },
    {
      "id": "dd7580bc-f97c-4ad1-8556-2329f88bea75",
      "name": "#damus Themes List",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        500,
        -400
      ],
      "parameters": {
        "text": "=Extract a list of themes from this: {{ $json.text }}\n\nDo not include any preamble or further explanation.",
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "60a9d8fe-4ba0-4450-8073-4108b832981e",
      "name": "#damus Thread Themes",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        500,
        -840
      ],
      "parameters": {
        "text": "=Tell me the theme and highlight some common threads associated with these Nostr threads that are all #damus.  Specifically mention the main reason #damus is hashtagged.  These are the threads: {{ $json.content.toJsonString() }}",
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "72ab08a7-f729-46e3-8a4d-56005cabaf17",
      "name": "#damus Themes & Threads Report",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        500,
        80
      ],
      "parameters": {
        "text": "=**Task:** Analyze the attached file containing Nostr threads using the hashtag #damus. Provide a detailed report with examples thread based on the following themes.  Got deep and seek out the underlying motivation of the users who posted the threads: \n\n## Themes\n{{ $json.text }}\n\n1. **Overall Theme:** Summarize the central topic(s) discussed across the threads.\n2. **Common Threads:** Identify recurring topics or ideas that unify the posts.\n3. **Key Highlights:** Extract specific examples or quotes that illustrate prominent themes.\n4. **Insights and Observations:** Offer insights on how the #damus community engages with the app and its ecosystem.\n5. **Suggestions for Improvement:** If applicable, suggest ways to enhance user experience or community engagement based on the analysis.\n\n**Requirements:**\n- Expand on each theme with comprehensive details and analysis.\n- Use bullet points or numbered lists for clarity.\n- Include relevant quotes or examples from the text to support your analysis.\n- Ensure your response is detailed, well-structured, and easy to read.\n\n**Context:** The analysis should focus on understanding how users interact with Damus, their appreciation for its features, challenges they face, and how it fits into the broader Nostr ecosystem.\n\n## Nostr thread with hashtag #damus: \n{{ $json.content.toJsonString() }}\n\n",
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "55362e03-ca0b-4f5e-a7ff-02828522fc7d",
      "name": "gemini-2.0-flash-lite-preview",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        600,
        -680
      ],
      "parameters": {
        "options": {
          "temperature": 0.4
        },
        "modelName": "=models/gemini-2.0-flash-lite-preview"
      },
      "typeVersion": 1
    },
    {
      "id": "7f457b3f-d39b-4062-ada0-5e81f3768857",
      "name": "gemini-2.0-flash-lite-preview1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        600,
        -240
      ],
      "parameters": {
        "options": {
          "temperature": 0.4
        },
        "modelName": "models/gemini-2.0-flash-lite-preview"
      },
      "typeVersion": 1
    },
    {
      "id": "bd68e36a-2fa7-4b78-96d8-9c4f97388249",
      "name": "gemini-2.0-flash-lite-preview2",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        600,
        240
      ],
      "parameters": {
        "options": {
          "temperature": 0.4
        },
        "modelName": "models/gemini-2.0-flash-lite-preview"
      },
      "typeVersion": 1
    },
    {
      "id": "24f378ca-8a10-441f-886d-136314fa30de",
      "name": "Gmail Report",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1080,
        80
      ],
      "parameters": {
        "sendTo": "REPLACE_WITH_SENDTO",
        "message": "={{ $json.data }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "#damus"
      },
      "typeVersion": 2.1
    },
    {
      "id": "f4814872-577a-4243-ac1b-e152e147dca0",
      "name": "Aggregate #damus Content",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        120,
        -140
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "content"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d2079c9e-b743-4353-bda9-e269168f5461",
      "name": "Explain the collected threads",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        -940
      ],
      "parameters": {
        "color": 6,
        "width": 960,
        "height": 480,
        "content": "## Explain the collected threads\n\nThe aggregation node collects the incoming `content` fields into an array. The first LLM chain serializes that array into its prompt and asks for themes, shared topics, and why posts use #damus. Its generated `text` is sent to three branches: an email formatter, a theme-list extractor, and Telegram.\n\nThe model output is an interpretation of supplied posts. Check it against the original content before treating a claimed theme or motivation as evidence. The source does not include a citation checker or a human approval gate."
      },
      "typeVersion": 1
    },
    {
      "id": "5f69afb5-6e3c-4f65-84bb-8c1f4544b2c5",
      "name": "Extract a theme list",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        -480
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 480,
        "content": "## Extract a theme list\n\nThe second LLM chain receives the first chain's generated `text` and asks for a list of themes without a preamble. It therefore summarizes an earlier model response, rather than reading the original posts again at this step. Errors introduced upstream can carry into this list.\n\nThe list goes to input 0 of the Merge node. The aggregated source content goes to input 1. The Merge is configured to combine items by position; confirm the item counts and ordering before changing either branch."
      },
      "typeVersion": 1
    },
    {
      "id": "6de3d9d2-98be-4102-9ed5-cda48b37eee7",
      "name": "Build the detailed report",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        -20
      ],
      "parameters": {
        "color": 4,
        "width": 960,
        "height": 480,
        "content": "## Build the detailed report\n\nAfter the positional merge, the final LLM chain receives both the extracted themes and the aggregated post content. Its prompt requests an overall theme, recurring topics, examples, observations, and possible improvements. The resulting `text` branches to Gmail and Telegram.\n\nThe prompt also asks about user motivation. That is an inference, not an observed fact. Review quotations and examples against the supplied posts, and keep uncertain interpretations labeled. No automated factual-verification node is present in this export."
      },
      "typeVersion": 1
    },
    {
      "id": "42f333ce-bdd7-4950-9ef1-ae797a671f5d",
      "name": "Merge Themes and Content",
      "type": "n8n-nodes-base.merge",
      "position": [
        1000,
        -160
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3
    },
    {
      "id": "7ff77e60-03ed-4937-b923-74a7f588fd2a",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -500,
        -260
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d1939a96-1e68-4d90-a456-55852c941e28",
      "name": "Collect Nostr posts and configure the entry point",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        -580
      ],
      "parameters": {
        "color": 6,
        "width": 600,
        "height": 700,
        "content": "## Collect Nostr posts and configure the entry point\n\nThe scheduled entry point connects to the community Nostr reader, configured with strategy `hashtag`, hashtag `#damus`, and a `from` value of `180`. Confirm the meaning and units of that last setting in the installed community node; this export does not explain them. Install the compatible `n8n-nodes-nostrobots` package before testing.\n\nThe export also contains a manual trigger, but its connection-map key uses literal escaped quote characters that do not match the actual node name. Reconnect the manual trigger to the Nostr reader in your copy before relying on a manual run. Inspect the schedule interval as well; the exported interval contains no explicit values.\n\nCommunity node source: https://github.com/ocknamo/n8n-nodes-nostrobots"
      },
      "typeVersion": 1
    },
    {
      "id": "89905442-bf8d-40d2-a9b1-fb3cf3a2ac44",
      "name": "Send the theme summary to Telegram",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        -640
      ],
      "parameters": {
        "width": 600,
        "height": 480,
        "content": "## Send the theme summary to Telegram\n\nThis branch takes the first LLM chain's `text`, keeps only its first 4,000 characters, and sends it to the configured Telegram chat. Select your Telegram credentials and supply your own chat identifier; the export reads it from `TELEGRAM_CHAT_ID` in the environment.\n\nThe node requests HTML parsing while the LLM output is not constrained to valid Telegram HTML. Test formatting with a harmless destination. The character slice can omit part of a summary; it does not split a long message into multiple deliveries."
      },
      "typeVersion": 1
    },
    {
      "id": "aee0f3eb-7b0e-4df1-968d-5abe1c22e26a",
      "name": "Deliver the final report",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        280
      ],
      "parameters": {
        "width": 600,
        "height": 480,
        "content": "## Deliver the final report\n\nThe final report is delivered along two independent branches. One converts the model's Markdown into HTML and passes the resulting `data` field to Gmail. The other sends the first 4,000 characters of the report directly to Telegram with HTML parsing enabled.\n\nReplace the Gmail recipient placeholder, select your own account credentials, and configure the Telegram destination. Test both branches separately: successful email formatting does not verify Telegram markup or prove that the complete report fits in one message. These nodes send immediately; there is no approval step in the exported graph."
      },
      "typeVersion": 1
    },
    {
      "id": "f6b00109-74ef-4522-b568-6426b054bea3",
      "name": "Telegram Themes",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1040,
        -560
      ],
      "parameters": {
        "text": "={{ $json.text.slice(0, 4000) }}",
        "chatId": "={{ $env.TELEGRAM_CHAT_ID }}",
        "additionalFields": {
          "parse_mode": "HTML",
          "appendAttribution": false
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3e7e9c70-43c6-4074-be9a-2f5ed6c4fb0e",
      "name": "Telegram Themes & Threads",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1040,
        360
      ],
      "parameters": {
        "text": "={{ $json.text.slice(0, 4000) }}",
        "chatId": "={{ $env.TELEGRAM_CHAT_ID }}",
        "additionalFields": {
          "parse_mode": "HTML",
          "appendAttribution": false
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5bc52456-7bbc-445a-8ffd-f47403a4b978",
      "name": "Test with a small controlled sample",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -580,
        -340
      ],
      "parameters": {
        "color": 4,
        "width": 600,
        "height": 480,
        "content": "## Test with a small controlled sample\n\nImport the workflow inactive, repair the manual-trigger connection, and select a currently available model in each of the three Gemini model nodes. The export names a preview model; this review does not establish its present availability. Configure Gmail, Telegram, and Gemini credentials outside the shared JSON.\n\nUse a small synthetic or non-sensitive post sample and test destinations. Inspect the aggregated content, first summary, extracted list, merged item, and final report before enabling either delivery branch or the schedule. Include empty input and malformed-content cases. The current workflow has not been executed as part of this annotation review."
      },
      "typeVersion": 1
    },
    {
      "id": "3b61555e-4e20-41d2-8fb7-490a2488f5f2",
      "name": "Nostr Read #damus",
      "type": "n8n-nodes-nostrobots.nostrobotsread",
      "position": [
        -160,
        -140
      ],
      "parameters": {
        "from": 180,
        "hashtag": "#damus",
        "strategy": "hashtag"
      },
      "typeVersion": 1
    },
    {
      "id": "fc9d94f9-7386-5542-a73a-5e3fc10fdbb9",
      "name": "Publication · Overview and setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1380,
        -940
      ],
      "parameters": {
        "content": "# #️⃣Nostr #damus AI Powered Reporting + Gmail + Telegram\n\n## Purpose and structure\nThis folder contains the **#️⃣Nostr #damus AI Powered Reporting + Gmail + Telegram** workflow. Its executable nodes use `aggregate`, `chainLlm`, `gmail`, `lmChatGoogleGemini`, `manualTrigger`, `markdown`, `merge`, `nostrobotsread`, `scheduleTrigger`, `telegram`. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.\n\n## Setup\nImport inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.\n\n## Entry points\nWhen clicking ‘Test workflow’, Schedule Trigger\n\n## Verification\nSanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.\n\n## Attribution\nhttps://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Telegram/0001_Telegram_Schedule_Automation_Scheduled.json\nMIT; preserve source notices.",
        "width": 700,
        "height": 800,
        "color": 1
      }
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "Get HTML": {
      "main": [
        [
          {
            "node": "Gmail Themes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get HTML Report": {
      "main": [
        [
          {
            "node": "Gmail Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Nostr Read #damus",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Nostr Read #damus": {
      "main": [
        [
          {
            "node": "Aggregate #damus Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "#damus Themes List": {
      "main": [
        [
          {
            "node": "Merge Themes and Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "#damus Thread Themes": {
      "main": [
        [
          {
            "node": "Get HTML",
            "type": "main",
            "index": 0
          },
          {
            "node": "#damus Themes List",
            "type": "main",
            "index": 0
          },
          {
            "node": "Telegram Themes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate #damus Content": {
      "main": [
        [
          {
            "node": "#damus Thread Themes",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Themes and Content",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge Themes and Content": {
      "main": [
        [
          {
            "node": "#damus Themes & Threads Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "gemini-2.0-flash-lite-preview": {
      "ai_languageModel": [
        [
          {
            "node": "#damus Thread Themes",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "#damus Themes & Threads Report": {
      "main": [
        [
          {
            "node": "Get HTML Report",
            "type": "main",
            "index": 0
          },
          {
            "node": "Telegram Themes & Threads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "gemini-2.0-flash-lite-preview1": {
      "ai_languageModel": [
        [
          {
            "node": "#damus Themes List",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "gemini-2.0-flash-lite-preview2": {
      "ai_languageModel": [
        [
          {
            "node": "#damus Themes & Threads Report",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Nostr Read #damus",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
