{
  "id": "EmfkoUHC2bSeoWb4",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Real-Time Attendee Engagement & Feedback Analyzer",
  "tags": [],
  "nodes": [
    {
      "id": "d1d5d86f-4051-4a37-a530-6eb74cba5ef4",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        -160
      ],
      "parameters": {
        "color": 4,
        "width": 368,
        "height": 392,
        "content": "## \ud83d\udcca DATA COLLECTION\nCollects feedback through:\n- Webhook submissions\n- Live poll responses\n- Session ratings\n- Attendee comments"
      },
      "typeVersion": 1
    },
    {
      "id": "dfc65343-c894-422a-a4f4-52635e612947",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        -160
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "height": 392,
        "content": "## \ud83d\udd0d ANALYSIS ENGINE\nProcesses feedback data:\n- Sentiment analysis\n- Rating aggregation\n- Keyword extraction\n- Trend identification"
      },
      "typeVersion": 1
    },
    {
      "id": "e37ce7a7-09c8-4b4f-aeef-088e5cc27b22",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -832,
        -384
      ],
      "parameters": {
        "width": 720,
        "height": 904,
        "content": "## \ud83d\udcc8 INSIGHTS & DELIVERY\nGenerates and distributes:\n- Real-time dashboards\n- Organizer notifications\n- Summary reports\n- Action recommendations"
      },
      "typeVersion": 1
    },
    {
      "id": "856e30ac-16a2-40b2-a058-19be10325285",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1488,
        64
      ],
      "parameters": {
        "path": "feedback-submission",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 1
    },
    {
      "id": "3cc30aeb-a803-43cd-9588-e2510693787d",
      "name": "Extract Feedback Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -1264,
        64
      ],
      "parameters": {
        "mode": "jsonData",
        "options": {}
      },
      "typeVersion": 3.3
    },
    {
      "id": "89b8c673-faab-405f-84e9-8626bf9508a3",
      "name": "Analyze Sentiment",
      "type": "n8n-nodes-base.set",
      "position": [
        -1040,
        64
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "sentiment",
              "name": "sentiment",
              "type": "string",
              "value": "={{ $json.feedback_text.toLowerCase().includes('great') || $json.feedback_text.toLowerCase().includes('excellent') || $json.feedback_text.toLowerCase().includes('amazing') ? 'positive' : ($json.feedback_text.toLowerCase().includes('bad') || $json.feedback_text.toLowerCase().includes('poor') || $json.feedback_text.toLowerCase().includes('terrible') ? 'negative' : 'neutral') }}"
            },
            {
              "id": "sentiment_score",
              "name": "sentiment_score",
              "type": "number",
              "value": "={{ $json.feedback_text.toLowerCase().includes('great') || $json.feedback_text.toLowerCase().includes('excellent') || $json.feedback_text.toLowerCase().includes('amazing') ? 1 : ($json.feedback_text.toLowerCase().includes('bad') || $json.feedback_text.toLowerCase().includes('poor') || $json.feedback_text.toLowerCase().includes('terrible') ? -1 : 0) }}"
            },
            {
              "id": "keywords",
              "name": "keywords",
              "type": "string",
              "value": "={{ $json.feedback_text.toLowerCase().split(' ').filter(word => word.length > 5).slice(0, 5).join(', ') }}"
            },
            {
              "id": "overall_score",
              "name": "overall_score",
              "type": "number",
              "value": "={{ ($json.rating * 20 + $json.engagement_score * 10) / 2 }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "6098e99d-2e3d-438a-be82-aff6f5a20ffd",
      "name": "Check Urgency",
      "type": "n8n-nodes-base.if",
      "position": [
        -816,
        -128
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": false
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "urgent",
              "operator": {
                "type": "number",
                "operation": "lte"
              },
              "leftValue": "={{ $json.rating }}",
              "rightValue": "2"
            },
            {
              "id": "negative_sentiment",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.sentiment }}",
              "rightValue": "negative"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "16349786-ae4a-4332-b52e-c253598ca974",
      "name": "Log to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -592,
        -32
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "1234567890abcdef"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "ce54e9d6-f662-4b18-9652-80a461f2db0c",
      "name": "Aggregate Feedback",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -816,
        256
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "8a190d49-5dd9-40f8-a71f-f7a40fd48355",
      "name": "Calculate Insights",
      "type": "n8n-nodes-base.set",
      "position": [
        -592,
        256
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "total_responses",
              "name": "total_responses",
              "type": "number",
              "value": "={{ $json.data.length }}"
            },
            {
              "id": "avg_rating",
              "name": "avg_rating",
              "type": "number",
              "value": "={{ $json.data.reduce((sum, item) => sum + item.rating, 0) / $json.data.length }}"
            },
            {
              "id": "positive_feedback",
              "name": "positive_feedback",
              "type": "number",
              "value": "={{ $json.data.filter(item => item.sentiment === 'positive').length }}"
            },
            {
              "id": "negative_feedback",
              "name": "negative_feedback",
              "type": "number",
              "value": "={{ $json.data.filter(item => item.sentiment === 'negative').length }}"
            },
            {
              "id": "neutral_feedback",
              "name": "neutral_feedback",
              "type": "number",
              "value": "={{ $json.data.filter(item => item.sentiment === 'neutral').length }}"
            },
            {
              "id": "avg_overall_score",
              "name": "avg_overall_score",
              "type": "number",
              "value": "={{ $json.data.reduce((sum, item) => sum + item.overall_score, 0) / $json.data.length }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "b6298b5f-f124-4bab-a3c0-6129871253e2",
      "name": "Urgent Slack Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        -592,
        -224
      ],
      "parameters": {
        "text": "=\ud83d\udea8 **URGENT FEEDBACK ALERT**\n\n**Session:** {{ $json.session_name }}\n**Attendee:** {{ $json.attendee_name }}\n**Rating:** {{ $json.rating }}/5 \u2b50\n**Sentiment:** {{ $json.sentiment }}\n\n**Feedback:**\n> {{ $json.feedback_text }}\n\n**Action Required:** Please review and respond immediately.",
        "user": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "select": "user",
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "88e5aa40-65fd-4fcb-a14b-eb69a8ce9981",
      "name": "Summary to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        -368,
        160
      ],
      "parameters": {
        "text": "=\ud83d\udcca **Real-Time Feedback Summary**\n\n**Total Responses:** {{ $json.total_responses }}\n**Average Rating:** {{ $json.avg_rating.toFixed(2) }}/5 \u2b50\n**Overall Score:** {{ $json.avg_overall_score.toFixed(1) }}%\n\n**Sentiment Breakdown:**\n\u2705 Positive: {{ $json.positive_feedback }} ({{ ($json.positive_feedback / $json.total_responses * 100).toFixed(1) }}%)\n\u274c Negative: {{ $json.negative_feedback }} ({{ ($json.negative_feedback / $json.total_responses * 100).toFixed(1) }}%)\n\u2796 Neutral: {{ $json.neutral_feedback }} ({{ ($json.neutral_feedback / $json.total_responses * 100).toFixed(1) }}%)\n\n_Dashboard updated in real-time_",
        "user": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "select": "user",
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "9268ae4b-be35-473e-b251-abca65efc6d7",
      "name": "Email Report to Organizers",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -368,
        352
      ],
      "parameters": {
        "options": {},
        "subject": "=Event Feedback Report - {{ $now.format('MMMM dd, yyyy') }}",
        "toEmail": "user@example.com",
        "fromEmail": "user@example.com"
      },
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "238f1d34-04d8-49ba-aba0-a0118ec51c4a",
      "name": "Webhook Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -368,
        -32
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={\n  \"status\": \"success\",\n  \"message\": \"Feedback received and analyzed\",\n  \"feedback_id\": \"{{ $json.feedback_id }}\",\n  \"sentiment\": \"{{ $json.sentiment }}\",\n  \"overall_score\": {{ $json.overall_score }},\n  \"thank_you\": \"Thank you for your valuable feedback!\"\n}"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6a92962e-45cd-4329-9425-dfb4bcc34b6c",
  "connections": {
    "Check Urgency": {
      "main": [
        [
          {
            "node": "Urgent Slack Alert",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Extract Feedback Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Sentiment": {
      "main": [
        [
          {
            "node": "Check Urgency",
            "type": "main",
            "index": 0
          },
          {
            "node": "Aggregate Feedback",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Feedback": {
      "main": [
        [
          {
            "node": "Calculate Insights",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Insights": {
      "main": [
        [
          {
            "node": "Summary to Slack",
            "type": "main",
            "index": 0
          },
          {
            "node": "Email Report to Organizers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to Google Sheets": {
      "main": [
        [
          {
            "node": "Webhook Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Feedback Data": {
      "main": [
        [
          {
            "node": "Analyze Sentiment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}