{
  "name": "My workflow 4",
  "nodes": [
    {
      "id": "9ae28c07-bb44-4e64-b38c-a74a9de81b2e",
      "name": "Receive Feedback",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -440,
        540
      ],
      "parameters": {
        "path": "client-feedback",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "id": "770bc041-1846-4ac1-b8dc-61756686f906",
      "name": "Prepare AI Prompt",
      "type": "n8n-nodes-base.function",
      "position": [
        -240,
        540
      ],
      "parameters": {
        "functionCode": "\nconst feedback = $json.feedback || \"No feedback provided.\";\nreturn [{\n  json: {\n    prompt: `Analyze this client feedback: \"${feedback}\"\\n\\n1. Summarize the positive points.\\n2. Suggest improvements.\\n3. Generate a short social media post based on the positive elements.`\n  }\n}];\n"
      },
      "typeVersion": 1
    },
    {
      "id": "0b3a469a-f6f4-4140-9c6f-fd7ba7689c5e",
      "name": "Analyze with AI",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -40,
        540
      ],
      "parameters": {
        "url": "https://api.deepseek.com/generate",
        "options": {},
        "authentication": "predefinedCredentialType",
        "jsonParameters": true
      },
      "typeVersion": 2
    },
    {
      "id": "bdbf3a85-e68f-4fe3-b0b4-d44578d11c31",
      "name": "Format AI Output",
      "type": "n8n-nodes-base.function",
      "position": [
        160,
        540
      ],
      "parameters": {
        "functionCode": "\nconst output = $json.response || $json.choices?.[0]?.text || \"No AI output.\";\nconst splitIndex = output.indexOf(\"3.\");\nlet summary = output;\nlet post = \"No post generated.\";\n\nif (splitIndex !== -1) {\n  summary = output.substring(0, splitIndex).trim();\n  post = output.substring(splitIndex).replace(/^3\\./, \"\").trim();\n}\n\nreturn [{\n  json: {\n    report: summary,\n    post: post\n  }\n}];\n"
      },
      "typeVersion": 1
    },
    {
      "id": "47093d4d-645b-4dc8-a5a4-1b35a649ac97",
      "name": "Send Feedback Report",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        380,
        500
      ],
      "parameters": {
        "text": "={{ $json[\"report\"] }}",
        "options": {},
        "subject": "Client Feedback Summary",
        "toEmail": "REPLACE_WITH_TOEMAIL",
        "fromEmail": "REPLACE_WITH_FROMEMAIL"
      },
      "typeVersion": 1
    },
    {
      "id": "e49a4898-00d9-4413-ac6d-87aafdfe6ff9",
      "name": "Send Social Draft",
      "type": "n8n-nodes-base.telegram",
      "position": [
        380,
        660
      ],
      "parameters": {
        "text": "={{ $json[\"post\"] }}",
        "chatId": "REPLACE_WITH_CHATID",
        "additionalFields": {}
      },
      "typeVersion": 1
    },
    {
      "id": "f0246ef9-4470-503e-9454-f832ff6f4a85",
      "name": "Publication · Overview and setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1240,
        0
      ],
      "parameters": {
        "content": "# My workflow 4\n\n## Purpose and structure\nThis folder contains the **My workflow 4** workflow. Its executable nodes use `emailSend`, `function`, `httpRequest`, `telegram`, `webhook`. 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\nReceive Feedback\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/Http/1920_HTTP_Telegram_Automate_Webhook.json\nMIT; preserve source notices.",
        "width": 700,
        "height": 800,
        "color": 1
      }
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "Analyze with AI": {
      "main": [
        [
          {
            "node": "Format AI Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format AI Output": {
      "main": [
        [
          {
            "node": "Send Feedback Report",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Social Draft",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Feedback": {
      "main": [
        [
          {
            "node": "Prepare AI Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare AI Prompt": {
      "main": [
        [
          {
            "node": "Analyze with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
