{
  "id": "zFDkmVr786IIiboZ",
  "name": "Feedspace Testimonial \u2192 Telegram Notification",
  "tags": [],
  "nodes": [
    {
      "id": "65764b4b-90dc-40d3-9a31-2490ac9d4f15",
      "name": "Receive Feedspace Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        656,
        656
      ],
      "parameters": {
        "path": "feedspace-testimonial",
        "options": {
          "rawBody": true
        },
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "07bea215-7cd0-4d67-b6b8-edcf2097cb6e",
      "name": "Send Telegram Notification",
      "type": "n8n-nodes-base.telegram",
      "onError": "continueRegularOutput",
      "position": [
        880,
        656
      ],
      "parameters": {
        "text": "=\ud83c\udf89 *New Testimonial Received!*\n\n{{ $json.body?.data?.response?.Name ? '\ud83d\udc64 *From:* ' + $json.body.data.response.Name + '\\n\\n' : '' }}Click below to review and share it.{{ $json.body?.data?.feed_url ? '\\n\\n\ud83d\udd17 ' + $json.body.data.feed_url : '' }}",
        "chatId": "={{ $vars.TELEGRAM_CHAT_ID }}",
        "additionalFields": {
          "parse_mode": "Markdown",
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2,
      "continueOnFail": true
    },
    {
      "id": "585f1ac1-8d31-4722-97f3-e9ab81763872",
      "name": "Has Error?",
      "type": "n8n-nodes-base.if",
      "position": [
        1152,
        656
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "error-check",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.error }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "43100bbb-c148-4ee9-8897-e7306d9bba0f",
      "name": "Success Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1568,
        512
      ],
      "parameters": {
        "options": {
          "responseCode": 200
        },
        "respondWith": "json",
        "responseBody": "={{ { \"status\": \"success\", \"message\": \"Notification sent successfully\", \"timestamp\": $now.toISO() } }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "478fb22a-72b5-4d8e-9c94-7efddebfb2d8",
      "name": "Format Error Details",
      "type": "n8n-nodes-base.code",
      "position": [
        1456,
        848
      ],
      "parameters": {
        "jsCode": "// Extract error details from the failed node\nconst inputData = $input.first().json;\n\nconst errorMessage = inputData.error?.message || 'Unknown error occurred';\nconst errorCode = inputData.error?.code || 'UNKNOWN';\n\nreturn {\n  json: {\n    status: 'error',\n    code: errorCode,\n    message: errorMessage,\n    timestamp: new Date().toISOString()\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "29d019dc-3246-4834-8211-02b19edb1305",
      "name": "Error Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1680,
        848
      ],
      "parameters": {
        "options": {
          "responseCode": 500
        },
        "respondWith": "json",
        "responseBody": "={{ $json }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "e080eecf-8b93-41da-a042-153e28000e1b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        352
      ],
      "parameters": {
        "width": 372,
        "height": 776,
        "content": "## \ud83d\udd14 Feedspace \u2192 Telegram Notifications\n\n@[youtube](AkjdEv5t50A)\n**Who is this for?**\nBusinesses using [Feedspace](https://feedspace.io) to collect testimonials who want instant Telegram notifications.\n## How it works\n1. Webhook receives testimonial data from Feedspace\n2. Telegram sends formatted notification\n3. IF node checks for errors\n4 Returns appropriate HTTP response (200 or 500)\n## Setup steps\n1. **Create Telegram Bot** - Message [@BotFather](https://t.me/BotFather), send `/newbot`, copy API token\n2. **Get Chat ID** - Message [@userinfobot](https://t.me/userinfobot), copy numeric Chat ID\n3. **Configure n8n** - Add Telegram credentials, create variable `TELEGRAM_CHAT_ID`\n4. **Connect Feedspace** - Activate workflow, copy Production webhook URL, paste in Feedspace \u2192 Automations \u2192 Webhook"
      },
      "typeVersion": 1
    },
    {
      "id": "5e25d69a-01ef-4f87-9adf-9c91bb14ea82",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        592,
        528
      ],
      "parameters": {
        "color": 7,
        "width": 428,
        "height": 392,
        "content": "## Webhook & Notification\nReceives Feedspace webhook and sends Telegram notification"
      },
      "typeVersion": 1
    },
    {
      "id": "40f8fd3b-f920-4039-b5fe-b51cc6f1d81a",
      "name": "Response Handling Group",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1088,
        416
      ],
      "parameters": {
        "color": 7,
        "width": 832,
        "height": 608,
        "content": "## Response Handling\nChecks for errors and returns appropriate HTTP response"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8a788bcc-7ab7-4c69-9778-75ef67e58c83",
  "connections": {
    "Has Error?": {
      "main": [
        [
          {
            "node": "Success Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format Error Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Error Details": {
      "main": [
        [
          {
            "node": "Error Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Feedspace Webhook": {
      "main": [
        [
          {
            "node": "Send Telegram Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Telegram Notification": {
      "main": [
        [
          {
            "node": "Has Error?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}