{
  "id": "emSWwmKVuZ5u4kGh",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI-Powered Post-Event Report & Summary Generator",
  "tags": [],
  "nodes": [
    {
      "id": "40f721fb-9648-4923-a897-db0901ddd7b2",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -592,
        -80
      ],
      "parameters": {
        "path": "event-report",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 1
    },
    {
      "id": "69ee8fd6-b823-4bd9-b8a0-185feb4634d4",
      "name": "Get Attendees",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -368,
        -176
      ],
      "parameters": {
        "url": "https://oneclick.com/GetAttendees",
        "options": {}
      },
      "typeVersion": 4.1
    },
    {
      "id": "08cf380e-2ab1-49ab-806b-a677c8250a3c",
      "name": "Get Engagement Metrics",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -368,
        16
      ],
      "parameters": {
        "url": "https://oneclick.com/GetEngagement",
        "options": {}
      },
      "typeVersion": 4.1
    },
    {
      "id": "874ce067-4545-4d7a-9f05-f7d19e2706bf",
      "name": "Process Metrics",
      "type": "n8n-nodes-base.code",
      "position": [
        -144,
        -80
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "c61d0bca-ff64-46c5-a9e8-a74b6c11d38c",
      "name": "AI Generate Report",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        160,
        144
      ],
      "parameters": {
        "model": "=gpt-4o-mini",
        "options": {
          "maxTokens": 2000,
          "temperature": 0.7
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "43cfaa09-76a3-41f8-a907-dc55b893d266",
      "name": "Send Report Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        432,
        -176
      ],
      "parameters": {
        "options": {},
        "subject": "=Event Report: {{ $('Process Metrics').first().json.eventName }}",
        "toEmail": "user@example.com",
        "fromEmail": "user@example.com"
      },
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "6ec7c1e0-89ab-469b-9e7c-4c789f3858c2",
      "name": "Save to Database",
      "type": "n8n-nodes-base.postgres",
      "position": [
        432,
        16
      ],
      "parameters": {
        "table": {
          "__rl": true,
          "mode": "name",
          "value": "="
        },
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.4
    },
    {
      "id": "0013804f-9eb8-422b-8224-e7fac9b68423",
      "name": "Send Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        656,
        -80
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={{ { \n  success: true, \n  message: 'Report generated successfully',\n  eventId: $('Process Metrics').first().json.eventId,\n  reportSent: true\n} }}"
      },
      "typeVersion": 1
    },
    {
      "id": "e97cfa0a-3df5-4a64-88d6-ec9988b59271",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        80,
        -80
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "725e3338-5236-4013-8caf-bf0a287b9259",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -208
      ],
      "parameters": {
        "width": 160,
        "height": 288,
        "content": "Start via HTTP POST request"
      },
      "typeVersion": 1
    },
    {
      "id": "3c4fe130-d1e5-4327-9cde-d0bdafbdc856",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -304
      ],
      "parameters": {
        "width": 384,
        "height": 480,
        "content": "Fetches attendees & engagement metrics"
      },
      "typeVersion": 1
    },
    {
      "id": "d9c2e32b-e18d-4b1b-beec-4d25f4da5eb7",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -304
      ],
      "parameters": {
        "width": 448,
        "height": 464,
        "content": "Sends report to stakeholders\n\nSaves reports to PostgreSQL"
      },
      "typeVersion": 1
    },
    {
      "id": "68aac399-61b4-4e2b-b966-3a93a9121961",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        -208
      ],
      "parameters": {
        "width": 256,
        "height": 288,
        "content": "Uses GPT-4 to generate professional reports"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "58d015a9-dfd8-418b-92be-61f190f62e19",
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send Report Email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Save to Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Attendees": {
      "main": [
        [
          {
            "node": "Process Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Metrics": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Get Attendees",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Engagement Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save to Database": {
      "main": [
        [
          {
            "node": "Send Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Report Email": {
      "main": [
        [
          {
            "node": "Send Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Generate Report": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Engagement Metrics": {
      "main": [
        [
          {
            "node": "Process Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}