{
  "name": "Bilingual newsletters with GPT-4o, AI images & videos for HubSpot & SP",
  "nodes": [
    {
      "id": "6ed4d301-86cb-4361-99d6-38e9d3dbf9fa",
      "name": "Build Newsletter",
      "type": "n8n-nodes-base.code",
      "position": [
        3564,
        650
      ]
    },
    {
      "id": "1fc3146e-600b-4d86-8ef7-9b319af09994",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2748,
        650
      ]
    },
    {
      "id": "0b7429c4-58c7-4b8f-a9df-36c02c65581f",
      "name": "Get Newsletter Template",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        3124,
        650
      ]
    },
    {
      "id": "c5732faf-550a-43f6-bbc5-6fd5738a6452",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        680,
        160
      ]
    },
    {
      "id": "37581dd4-faba-4072-a309-0f9eb1007f25",
      "name": "Get Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1640,
        -40
      ]
    },
    {
      "id": "8fa5043a-8cad-4ba3-9743-ff4bdbda4828",
      "name": "Create FAL Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1180,
        -40
      ]
    },
    {
      "id": "8a24dec5-39b7-4cbc-8158-29db35319700",
      "name": "Create Audio",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2080,
        -20
      ]
    },
    {
      "id": "346b2213-7cd1-4373-bc5c-a81a1bcc2f80",
      "name": "Get Audio",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2520,
        -20
      ]
    },
    {
      "id": "6bf8b37e-3ba5-4b5d-8e56-ff4cc44cb956",
      "name": "Create Merge Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3000,
        0
      ]
    },
    {
      "id": "da586535-799c-4263-beb8-a053fae68131",
      "name": "Wait for Merge",
      "type": "n8n-nodes-base.wait",
      "position": [
        3200,
        0
      ]
    },
    {
      "id": "e501013d-1ad6-4399-ba46-b6382c868895",
      "name": "Get Merged Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3400,
        0
      ]
    },
    {
      "id": "a5bda77c-13b6-4201-9c45-6df4df522962",
      "name": "Configuration Settings",
      "type": "n8n-nodes-base.set",
      "position": [
        -1620,
        700
      ]
    },
    {
      "id": "ee208f0f-dec1-4291-b8d9-e52bb9f937f3",
      "name": "Generate Video and Audio Prompt",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1340,
        440
      ]
    },
    {
      "id": "71b500eb-f7b0-44e2-980c-35903b61824f",
      "name": "Determine Intent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -2220,
        700
      ]
    },
    {
      "id": "c191afa3-9e32-4be9-ad18-eb6934f26856",
      "name": "Parse Fields",
      "type": "n8n-nodes-base.code",
      "position": [
        -940,
        440
      ]
    },
    {
      "id": "7ad045e9-7200-49fa-ab06-8eac27286a8c",
      "name": "Parse Intent Fields",
      "type": "n8n-nodes-base.code",
      "position": [
        -1860,
        700
      ]
    },
    {
      "id": "6653e5da-9fe2-4c94-aefc-eab62cae217c",
      "name": "HTML to Binary",
      "type": "n8n-nodes-base.code",
      "position": [
        4780,
        40
      ]
    },
    {
      "id": "3dfb0441-a990-4fea-8e70-fec8941fe402",
      "name": "TXT to Binary",
      "type": "n8n-nodes-base.code",
      "position": [
        5840,
        40
      ]
    },
    {
      "id": "ab62a875-ea54-4651-bdd5-cd8441a8eced",
      "name": "JPG to Binary",
      "type": "n8n-nodes-base.code",
      "position": [
        5180,
        40
      ]
    },
    {
      "id": "f70b3fde-0aeb-4d8c-ad6c-094011530a97",
      "name": "Save Video URL if exists",
      "type": "n8n-nodes-base.if",
      "position": [
        5620,
        40
      ]
    },
    {
      "id": "10b5c038-5a10-46fb-8ced-610555db5e60",
      "name": "Upload HTML",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        4960,
        40
      ]
    },
    {
      "id": "5cd95de7-c889-494e-8fc6-ee3904d03076",
      "name": "Upload JPG",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        5400,
        40
      ]
    },
    {
      "id": "21fec674-16ff-4abe-8fbd-8d9dc7a72c24",
      "name": "Upload Video URL",
      "type": "n8n-nodes-base.microsoftSharePoint",
      "position": [
        6060,
        40
      ]
    },
    {
      "id": "1fd08314-fdc1-4b4f-9dfc-eb42e29dcc19",
      "name": "HubSpot",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        4800,
        600
      ]
    },
    {
      "id": "2dfa50ed-8999-4baa-86de-3a72ca7b9806",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        5020,
        600
      ]
    },
    {
      "id": "28a24ebf-c322-490c-8c0c-4286403d8b04",
      "name": "WF Result",
      "type": "n8n-nodes-base.switch",
      "position": [
        4460,
        320
      ]
    },
    {
      "id": "ccd903d5-2059-4e5a-b2e5-71d31ddbf171",
      "name": "Send a message",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        5240,
        600
      ]
    },
    {
      "id": "b7b4707c-a913-4e2e-9287-795bc4af01f3",
      "name": "Set Base64 Field",
      "type": "n8n-nodes-base.set",
      "position": [
        -340,
        420
      ]
    },
    {
      "id": "665669f0-f304-40a2-8cbd-32e1938f002f",
      "name": "Convert Base64 to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -60,
        420
      ]
    },
    {
      "id": "f3ea111a-2be1-487c-ab04-272082a0ed7a",
      "name": "Send message and wait for response",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3980,
        360
      ]
    },
    {
      "id": "2dea2ea9-bd02-4456-b05c-c021991cb8ec",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2940,
        -420
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "f85216f0-03f0-42fb-9ae9-3ddeffa4b3b2",
      "name": "Receive Request",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -2440,
        700
      ]
    },
    {
      "id": "9b5e979b-57d3-4e21-9795-1db31ec8b884",
      "name": "chatgpt-4o",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -2220,
        900
      ]
    },
    {
      "id": "0442a834-828b-4dc6-9f79-2684911bbd54",
      "name": "chatgpt-4o-2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1340,
        620
      ]
    },
    {
      "id": "6d8796b5-b141-4603-bc61-c42928fca0ff",
      "name": "gpt-4o-mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2740,
        840
      ]
    },
    {
      "id": "2a6d05fe-eaa3-4ec7-91ed-9923475b17f6",
      "name": "Wait For Video",
      "type": "n8n-nodes-base.wait",
      "position": [
        1420,
        -40
      ]
    },
    {
      "id": "b6ed5147-98ae-44ab-856b-f2d8394decc7",
      "name": "Wait For Audio",
      "type": "n8n-nodes-base.wait",
      "position": [
        2300,
        -20
      ]
    },
    {
      "id": "9d88f7f4-7b2a-4371-b6cd-22c546d92d4e",
      "name": "Video Still Processing",
      "type": "n8n-nodes-base.if",
      "position": [
        1860,
        -40
      ]
    },
    {
      "id": "c79189a7-7c86-4969-874f-b54593547b37",
      "name": "Audio Still Processing",
      "type": "n8n-nodes-base.if",
      "position": [
        2740,
        -20
      ]
    },
    {
      "id": "a72db0a9-eaec-4ec9-bb23-dc236ed245fd",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        3784,
        308
      ]
    },
    {
      "id": "2d38028e-f88a-4354-b178-d0dd2c957349",
      "name": "Newsletter Approved",
      "type": "n8n-nodes-base.if",
      "position": [
        4200,
        360
      ]
    },
    {
      "id": "93954adb-beca-4f70-8b31-497f122eaae8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1500,
        -480
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "557baae9-9e08-47c0-856a-fa7005849510",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4920,
        -440
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "086b25d4-138b-4e43-ad37-b18c379780f8",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4900,
        860
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "0bda54cb-f6ee-48f6-a0c0-07a63c2204c6",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1060,
        -100
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "d68aef91-73e7-40b8-be5b-8eb684b8f88c",
      "name": "Send Data to Download Service",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        420,
        160
      ]
    },
    {
      "id": "13a66fcf-43f9-4f41-8c2c-7103c2d0ec33",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2740,
        1020
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "cc0555c6-7d87-4c2e-8115-ca2fe153fba4",
      "name": "Generate Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -680,
        440
      ]
    },
    {
      "id": "68c0a4b4-309b-426e-ad7c-3f4bd913ef01",
      "name": "Get Template Content",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        3344,
        650
      ]
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Send message and wait for response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Create FAL Video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Get Newsletter Template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Audio": {
      "main": [
        [
          {
            "node": "Audio Still Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Video": {
      "main": [
        [
          {
            "node": "Video Still Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WF Result": {
      "main": [
        [
          {
            "node": "HTML to Binary",
            "type": "main",
            "index": 0
          },
          {
            "node": "HubSpot",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HubSpot",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTML to Binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload JPG": {
      "main": [
        [
          {
            "node": "Save Video URL if exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "chatgpt-4o": {
      "ai_languageModel": [
        [
          {
            "node": "Determine Intent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Upload HTML": {
      "main": [
        [
          {
            "node": "JPG to Binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "gpt-4o-mini": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create Audio": {
      "main": [
        [
          {
            "node": "Wait For Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Fields": {
      "main": [
        [
          {
            "node": "Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "chatgpt-4o-2": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Video and Audio Prompt",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "JPG to Binary": {
      "main": [
        [
          {
            "node": "Upload JPG",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "TXT to Binary": {
      "main": [
        [
          {
            "node": "Upload Video URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image": {
      "main": [
        [
          {
            "node": "Set Base64 Field",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML to Binary": {
      "main": [
        [
          {
            "node": "Upload HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait For Audio": {
      "main": [
        [
          {
            "node": "Get Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait For Video": {
      "main": [
        [
          {
            "node": "Get Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Merge": {
      "main": [
        [
          {
            "node": "Get Merged Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Request": {
      "main": [
        [
          {
            "node": "Determine Intent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Newsletter": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 4
          }
        ]
      ]
    },
    "Create FAL Video": {
      "main": [
        [
          {
            "node": "Wait For Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Determine Intent": {
      "main": [
        [
          {
            "node": "Parse Intent Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Merged Video": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Set Base64 Field": {
      "main": [
        [
          {
            "node": "Convert Base64 to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Newsletter Approved": {
      "main": [
        [
          {
            "node": "WF Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Intent Fields": {
      "main": [
        [
          {
            "node": "Configuration Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Merge Request": {
      "main": [
        [
          {
            "node": "Wait for Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Template Content": {
      "main": [
        [
          {
            "node": "Build Newsletter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Audio Still Processing": {
      "main": [
        [
          {
            "node": "Wait For Audio",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Merge Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configuration Settings": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Video and Audio Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Base64 to File": {
      "main": [
        [
          {
            "node": "Send Data to Download Service",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Video Still Processing": {
      "main": [
        [
          {
            "node": "Wait For Video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Newsletter Template": {
      "main": [
        [
          {
            "node": "Get Template Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Video URL if exists": {
      "main": [
        [
          {
            "node": "TXT to Binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Data to Download Service": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Video and Audio Prompt": {
      "main": [
        [
          {
            "node": "Parse Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send message and wait for response": {
      "main": [
        [
          {
            "node": "Newsletter Approved",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}