{
  "id": "qDuGzbzSIxRn2kXc",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Automated Event Marketing Content Generator",
  "tags": [],
  "nodes": [
    {
      "id": "578f8ee9-2919-4983-a478-3d585b817b60",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -944,
        16
      ],
      "parameters": {
        "path": "create-event-content",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "id": "54e2d7e7-57d3-4c94-93f8-81ec16a0779e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        -224
      ],
      "parameters": {
        "color": 5,
        "width": 196,
        "height": 404,
        "content": "\ud83d\ude80 **WEBHOOK TRIGGER**\nReceives event details:\n- Event name\n- Date & time\n- Location\n- Target audience"
      },
      "typeVersion": 1
    },
    {
      "id": "c0491f96-c43c-4107-bcbc-de033b215ca1",
      "name": "Extract Event Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -720,
        16
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "2b330412-8516-4434-985a-32285891725e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -784,
        -224
      ],
      "parameters": {
        "width": 192,
        "height": 400,
        "content": "\ud83d\udccb **EXTRACT DATA**\nParses incoming event info\nPrepares for content generation"
      },
      "typeVersion": 1
    },
    {
      "id": "cf6f8699-3112-45cf-8199-b0d8489c6f25",
      "name": "Generate Email Content",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -480,
        -384
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/chat/completions",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-4"
            },
            {
              "name": "messages",
              "value": "=[{\"role\": \"system\", \"content\": \"You are an expert email marketer. Create compelling email content.\"}, {\"role\": \"user\", \"content\": \"Create email campaign for Event: {{ $json.event_name }}, Date: {{ $json.event_date }}, Location: {{ $json.event_location }}, Audience: {{ $json.target_audience }}, Features: {{ $json.key_features }}. Generate: 1) Subject line (under 60 chars) 2) Email body (150-200 words) 3) CTA button text 4) PS line. Format as JSON with keys: subject, body, cta, ps\"}]"
            },
            {
              "name": "temperature",
              "value": "0.7"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "670cbbd2-5b1f-459c-b2ae-71915dab55af",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -560
      ],
      "parameters": {
        "color": 3,
        "height": 336,
        "content": "\ud83d\udce7 **EMAIL GENERATOR**\nCreates personalized email:\n- Subject line\n- Body copy\n- CTA button\n- PS urgency line"
      },
      "typeVersion": 1
    },
    {
      "id": "13e5dc17-837e-4626-bdd6-93387d49e15d",
      "name": "Generate Social Posts",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -480,
        0
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/chat/completions",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-4"
            },
            {
              "name": "messages",
              "value": "=[{\"role\": \"system\", \"content\": \"You are a social media expert. Create engaging platform-optimized content.\"}, {\"role\": \"user\", \"content\": \"Create social posts for Event: {{ $json.event_name }}, Date: {{ $json.event_date }}, Location: {{ $json.event_location }}, Audience: {{ $json.target_audience }}, Features: {{ $json.key_features }}. Generate for: 1) LinkedIn (150 words) 2) Twitter (280 chars) 3) Instagram (with emojis) 4) Facebook (100 words). Format as JSON with keys: linkedin, twitter, instagram, facebook\"}]"
            },
            {
              "name": "temperature",
              "value": "0.8"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "7e2d8a74-2aa0-4c67-8e49-4d7fa789d1c5",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        -160
      ],
      "parameters": {
        "color": 3,
        "height": 288,
        "content": "\ud83d\udcf1 **SOCIAL MEDIA POSTS**\nGenerates for 4 platforms:\n- LinkedIn\n- Twitter/X\n- Instagram\n- Facebook"
      },
      "typeVersion": 1
    },
    {
      "id": "74732679-24d0-4eee-b03c-c3759801dd87",
      "name": "Generate Ad Copy",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -480,
        336
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/chat/completions",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-4"
            },
            {
              "name": "messages",
              "value": "=[{\"role\": \"system\", \"content\": \"You are an advertising copywriter. Create high-converting ad copy.\"}, {\"role\": \"user\", \"content\": \"Create ad campaigns for Event: {{ $json.event_name }}, Date: {{ $json.event_date }}, Location: {{ $json.event_location }}, Audience: {{ $json.target_audience }}, Features: {{ $json.key_features }}. Generate: 1) Google Search Ad (30 char headline, 90 char description) 2) Facebook Ad (125 char text, 40 char headline) 3) LinkedIn Sponsored (150 char intro, 70 char headline). Format as JSON with keys: google_search, facebook_ad, linkedin_ad\"}]"
            },
            {
              "name": "temperature",
              "value": "0.7"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "337bd89f-7d18-4db5-9e5c-c313efd29573",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        192
      ],
      "parameters": {
        "color": 3,
        "height": 272,
        "content": "\ud83d\udcb0 **AD COPY GENERATOR**\nCreates paid ad content:\n- Google Search\n- Facebook Ads\n- LinkedIn Sponsored"
      },
      "typeVersion": 1
    },
    {
      "id": "5c754765-d544-4d93-bf80-a3885c7fdb4a",
      "name": "Parse Email Response",
      "type": "n8n-nodes-base.code",
      "position": [
        -240,
        -384
      ],
      "parameters": {
        "jsCode": "const email = JSON.parse($input.first().json.choices[0].message.content);\nreturn { email_content: email };"
      },
      "typeVersion": 2
    },
    {
      "id": "7a72d83b-4ef1-468d-a795-63c0531b3017",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -560
      ],
      "parameters": {
        "color": 4,
        "height": 336,
        "content": "\ud83d\udd04 **PARSE EMAIL**\nExtracts JSON from API\nCleans up response"
      },
      "typeVersion": 1
    },
    {
      "id": "98b921e9-1e7b-4ad9-98d5-d3bc5011755d",
      "name": "Parse Social Response",
      "type": "n8n-nodes-base.code",
      "position": [
        -240,
        0
      ],
      "parameters": {
        "jsCode": "const social = JSON.parse($input.first().json.choices[0].message.content);\nreturn { social_media: social };"
      },
      "typeVersion": 2
    },
    {
      "id": "990f0a6d-f816-4fe6-9a8f-692a3b0791ee",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        -160
      ],
      "parameters": {
        "color": 4,
        "height": 288,
        "content": "\ud83d\udd04 **PARSE SOCIAL**\nExtracts JSON from API\nCleans up response"
      },
      "typeVersion": 1
    },
    {
      "id": "6babf8b0-a753-4e55-96f5-215839776512",
      "name": "Parse Ad Response",
      "type": "n8n-nodes-base.code",
      "position": [
        -240,
        336
      ],
      "parameters": {
        "jsCode": "const ads = JSON.parse($input.first().json.choices[0].message.content);\nreturn { ad_content: ads };"
      },
      "typeVersion": 2
    },
    {
      "id": "b8636a5e-b437-4fbf-8296-ec3330d1ea66",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        192
      ],
      "parameters": {
        "color": 4,
        "height": 288,
        "content": "\ud83d\udd04 **PARSE ADS**\nExtracts JSON from API\nCleans up response"
      },
      "typeVersion": 1
    },
    {
      "id": "5bb618d9-3862-4bb7-a5d2-692843effd3a",
      "name": "Merge All Content",
      "type": "n8n-nodes-base.merge",
      "position": [
        32,
        -80
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combinationMode": "mergeByPosition"
      },
      "typeVersion": 2.1
    },
    {
      "id": "6f23e238-2e67-4ba3-b1dc-925732ad0d23",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -240
      ],
      "parameters": {
        "color": 5,
        "height": 336,
        "content": "\ud83d\udd00 **MERGE CONTENT**\nCombines all generated:\n- Email content\n- Social posts\n- Ad copy"
      },
      "typeVersion": 1
    },
    {
      "id": "c94fc96d-603b-4c25-89cd-e2ef1deeea19",
      "name": "Log to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        320,
        -80
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappings": [
            {
              "value": "={{ $now.toISO() }}",
              "column": "Timestamp"
            },
            {
              "value": "={{ $json.event_name }}",
              "column": "Event_Name"
            },
            {
              "value": "={{ $json.event_date }}",
              "column": "Event_Date"
            },
            {
              "value": "={{ $json.event_location }}",
              "column": "Location"
            },
            {
              "value": "={{ $json.email_content.subject }}",
              "column": "Email_Subject"
            },
            {
              "value": "Generated",
              "column": "Status"
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": "Marketing_Campaigns",
        "documentId": "5x4w3v2u1t0s9r8q",
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4
    },
    {
      "id": "d30e9189-b6e6-4e3a-b3ec-63bc615a0cbe",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -272
      ],
      "parameters": {
        "color": 2,
        "height": 368,
        "content": "\ud83d\udcbe **SAVE TO SHEETS**\nSheet: Marketing_Campaigns\nTracks all campaigns\nDoc: 5x4w3v2u1t0s9r8q"
      },
      "typeVersion": 1
    },
    {
      "id": "d83a374f-9fe9-4413-b528-6f36459c334f",
      "name": "Email Content Package",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        784,
        -384
      ],
      "parameters": {
        "options": {
          "ccEmail": "user@example.com"
        },
        "subject": "\u2728 Event Marketing Content Ready - {{ $json.event_name }}",
        "toEmail": "user@example.com",
        "fromEmail": "user@example.com"
      },
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "f8c8fb29-f990-4f4a-bfd9-644f72df6a46",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        -544
      ],
      "parameters": {
        "color": 6,
        "height": 336,
        "content": "\ud83d\udce7 **EMAIL DELIVERY**\nTo: events@company.com\nCC: marketing-team@company.com\nAll content in email body"
      },
      "typeVersion": 1
    },
    {
      "id": "bfc9fd06-2a82-49e4-ba81-241bbc053597",
      "name": "Notify Team on Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        816,
        64
      ],
      "parameters": {
        "text": "=\ud83c\udf89 *New Event Marketing Content Generated!*\n\n*Event:* {{ $json.event_name }}\n*Date:* {{ $json.event_date }}\n*Location:* {{ $json.event_location }}\n\n\u2705 Email campaign ready\n\u2705 Social media posts created\n\u2705 Ad copy generated\n\n\ud83d\udce7 Full package sent to events team!",
        "user": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "select": "user",
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "11cb7cc9-42d5-4331-9477-760d4b844605",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        -112
      ],
      "parameters": {
        "height": 320,
        "content": "\ud83d\udcac **SLACK NOTIFICATION**\nChannel: #marketing-updates\nChannel ID: C11223MARKETING\nTeam alert with summary"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "de94feee-93f7-4195-8538-f7a155144756",
  "connections": {
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Extract Event Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Ad Copy": {
      "main": [
        [
          {
            "node": "Parse Ad Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge All Content": {
      "main": [
        [
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Event Data": {
      "main": [
        [
          {
            "node": "Generate Email Content",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Social Posts",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Ad Copy",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to Google Sheets": {
      "main": [
        [
          {
            "node": "Email Content Package",
            "type": "main",
            "index": 0
          },
          {
            "node": "Notify Team on Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Email Response": {
      "main": [
        [
          {
            "node": "Merge All Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Social Posts": {
      "main": [
        [
          {
            "node": "Parse Social Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Social Response": {
      "main": [
        [
          {
            "node": "Merge All Content",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Generate Email Content": {
      "main": [
        [
          {
            "node": "Parse Email Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}