{
  "name": "Blog Posts to Social Media Posts",
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "id": "40955220-3f15-4177-bc8c-a0afca023f78",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        520,
        -340
      ],
      "webhookId": "6eddf556-2f9b-4383-9faf-372620aa085b",
      "typeVersion": 1,
      "credentials": {
        "telegramApi": {
          "id": "b19joq4pPMtB7hWl",
          "name": "Telegram account 25"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 1
          },
          "conditions": [
            {
              "leftValue": "={{ $json.message.text }}",
              "rightValue": "http",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "id": "eb6e3922-3e3b-471e-8079-3b7f45384096"
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "2fd78c57-f47d-47bf-b3b0-cfac07acd23f",
      "name": "Check for URL",
      "type": "n8n-nodes-base.if",
      "position": [
        660,
        -340
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Telegram Trigger').item.json.message.chat.id }}"
      },
      "id": "c0bfc9b2-eb29-49c5-a718-6e764d1c92fa",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1060,
        -220
      ],
      "typeVersion": 1.3
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Website Text: {{ $json.scrapedContent }}",
        "options": {
          "systemMessage": "=You are a website summarization assistant. Your task is to:\n\n1. **Create a comprehensive summary** of the provided website content (200–300 words and store it to the Google Sheet \"Save_Summary\" tool.\n   - Focus on key points, main ideas, and actionable insights.\n   - Follow these summary formatting rules:\n     - Only one sentence per line and one empty line between each sentence.\n  \n     - You are allowed to use alt code bullets \"•\".\n\n2. add two sentences on top of the summary text:\n\nSentence 1: Compelling first sentnce making sure people are forced to read, by stating a crazy fact related to the blog post, a striking result or anything that would hook peoples attention.\n\nSentence 2: builds tension that the first sentence starts, and implies sometoing is revealed.\n\n#Formatting rule: You MUST add an EMPTY line between Sentence 1 and Sentence 2.\n\n\n3. **Generate a high-quality, visually descriptive image prompt** for the summary, using these guidelines and examples for Flux AI:\n\n   - Write the prompt in a single sentence.\n   - Focus on one main subject or scene, avoiding too many elements—aim for a visually balanced image suitable for social media.\n- NEVER use futursitic symbols or graphic elements like holograms, but the image prompt must look like a real life situioatn.\n\n   - For maximum engagement, prefer warm, relatable, or lightly humorous imagery (such as people, emotions, daily life, or friendly AI helpers), .\n\n   - NEVER  use cold, overly technical, or generic \"AI\" images like blue glowing heads or floating tech.\n   - Be specific about the foreground, background, mood, and important objects or actions, but keep the scene simple.\n\n   - Use atmospheric details, lighting, or mood to add interest.\n\n   - Do not include any text in the image prompt unless it’s part of a physical sign or object in the scene.\n\n   - Structure your prompt like these examples:\n\n     **Good prompt example:**  \n     “In the foreground, a vintage car with a 'CLASSIC' plate is parked on a cobblestone street. Behind it, a bustling market scene with colorful awnings. In the background, the silhouette of an old castle on a hill, shrouded in mist.”\n\n     **Good prompt example:**  \n     “A single tree standing in the middle of the image. The left half of the tree has bright, vibrant green leaves under a bright, sunny blue sky, while the right half has bare branches covered in frost, with a cold, dark, thunderous sky. On the left there's green, lush grass on the ground; on the right - thick snow. The split is sharp, with the transition happening right down the middle of the tree.”\n\n     **Good prompt example:**  \n     \"A hanging glass terrarium featuring a miniature rainforest scene with colorful orchids and tiny waterfalls. Just beyond the glass, a neon sign reads 'Rainforest Retreat.' The rain-soaked glass creates a beautiful distortion, adding a soft glow to the sign's vibrant colors.\"\n\n   - Output only the image prompt, nothing else for this step.\n\n4. **Use the Google Sheets tool \"Save_Summary\" to save** the summary and image prompt:\n   - Blog Summary: The complete summary text you generated in Step 1 (including the two hook sentences)\n   - Image Prompt: The image prompt text you generated in Step 3\n   \n   Only provide these two text values. Do not include any other data.\n\n5. **Include the summary in your output to the user along with the first two punchy lines that force people to keep reading.**\n\n---\n\n**#Summary Formatting Rules:**  \n- Only one sentence per line and one empty line between each sentence.  \n- The first two sentences must be punchy and invoke massive curiosity so people feel compelled to keep reading. Please you must add that hook text as first part of the summary. \n- You are allowed to use alt code bullets \"•\".\n\n**#Rules:**  \n- Only include the hook text with summary in your output to the user. Do not include the imae prompt in your output\n- you must always use the Google sehet tool \"Save_Summary\"\n"
        }
      },
      "id": "73e0a3c2-3c9e-4391-9517-538d3ba6e438",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1060,
        -440
      ],
      "typeVersion": 1.8
    },
    {
      "parameters": {
        "chatId": "={{ $json.message.chat.id }}",
        "text": "❌ URL/Website Link in your message was not correct. Try again and ensure it starts with http:// or https://",
        "additionalFields": {}
      },
      "id": "77a2b31e-ace7-46ea-8664-2ad8b4721ada",
      "name": "No URL Response",
      "type": "n8n-nodes-base.telegram",
      "position": [
        900,
        -40
      ],
      "typeVersion": 1.2,
      "webhookId": "c3652161-e7b0-4ffa-9fcd-c25c2c3dd7fb",
      "credentials": {
        "telegramApi": {
          "id": "b19joq4pPMtB7hWl",
          "name": "Telegram account 25"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "15R17g00wcOVHwCWOdfHVHp_AlZE534MATCMoBLd8x-A",
          "mode": "list",
          "cachedResultName": "Building - AI Agent - Website to Post - autonoma.agency",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/15R17g00wcOVHwCWOdfHVHp_AlZE534MATCMoBLd8x-A/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1915567193,
          "mode": "list",
          "cachedResultName": "Summaries",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/15R17g00wcOVHwCWOdfHVHp_AlZE534MATCMoBLd8x-A/edit#gid=1915567193"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Blog Link": "={{ $('Telegram Trigger').item.json.message.text }}",
            "Blog Summary": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Blog_Summary', `Store the summary you generatd.`, 'string') }}",
            "Image Prompt": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Image_Prompt', `This is an prompt that is used to generate an image using Flux.1 AI image generator tools. `, 'string') }}",
            "Blog Title": "={{ $('Extract Text').item.json.pageTitle }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "Blog Link",
              "displayName": "Blog Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Blog Title",
              "displayName": "Blog Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Blog Summary",
              "displayName": "Blog Summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Image Prompt",
              "displayName": "Image Prompt",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Image Link",
              "displayName": "Image Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "LinkedIn Post",
              "displayName": "LinkedIn Post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Facebook Post",
              "displayName": "Facebook Post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Instagram Post",
              "displayName": "Instagram Post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Twitter/X Post",
              "displayName": "Twitter/X Post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Publish Date",
              "displayName": "Publish Date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.5,
      "position": [
        1220,
        -220
      ],
      "id": "60923955-0f9c-4e89-a85f-ffbe910a5811",
      "name": "Save_Summary",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gqxL0RdQpLcwUlCA",
          "name": "Google Sheets account 27"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.piapi.ai/api/v1/task",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n    \"model\": \"Qubico/flux1-dev\",\n    \"task_type\": \"txt2img\",\n    \"input\": {\n        \"prompt\": \"{{ $json.image_prompt_clean }}\",\n        \"width\": 1024, \n        \"height\": 1024\n    } \n} ",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1660,
        -480
      ],
      "id": "dfa7654e-befa-4987-ba6c-b3111a47244f",
      "name": "Generate Image",
      "credentials": {
        "httpHeaderAuth": {
          "id": "3W0ltImi73vptzAS",
          "name": "Header Auth account 8"
        }
      }
    },
    {
      "parameters": {
        "url": "=https://api.piapi.ai/api/v1/task/{{ $json.data.task_id }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1920,
        -480
      ],
      "id": "80a5becf-13c2-4922-8e0f-56a41ba674a9",
      "name": "Get Image",
      "credentials": {
        "httpHeaderAuth": {
          "id": "3W0ltImi73vptzAS",
          "name": "Header Auth account 8"
        }
      }
    },
    {
      "parameters": {
        "amount": 2,
        "unit": "minutes"
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1800,
        -480
      ],
      "id": "fb345c99-145e-4a06-a037-4dd5db18ae84",
      "name": "Wait",
      "webhookId": "0689ad3c-924a-44c7-833b-8379831b263e"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "15R17g00wcOVHwCWOdfHVHp_AlZE534MATCMoBLd8x-A",
          "mode": "list",
          "cachedResultName": "Building - AI Agent - Website to Post - autonoma.agency",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/15R17g00wcOVHwCWOdfHVHp_AlZE534MATCMoBLd8x-A/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1915567193,
          "mode": "list",
          "cachedResultName": "Summaries",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/15R17g00wcOVHwCWOdfHVHp_AlZE534MATCMoBLd8x-A/edit#gid=1915567193"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Blog Link": "={{ $('Telegram Trigger').first().json.message.text }}",
            "Image Link": "={{ $json.data.output.image_url }}"
          },
          "matchingColumns": [
            "Blog Link"
          ],
          "schema": [
            {
              "id": "Blog Link",
              "displayName": "Blog Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Blog Title",
              "displayName": "Blog Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Blog Summary",
              "displayName": "Blog Summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Image Prompt",
              "displayName": "Image Prompt",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Image Link",
              "displayName": "Image Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "LinkedIn Post",
              "displayName": "LinkedIn Post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Facebook Post",
              "displayName": "Facebook Post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Instagram Post",
              "displayName": "Instagram Post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Twitter/X Post",
              "displayName": "Twitter/X Post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Publish Date",
              "displayName": "Publish Date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1400,
        -280
      ],
      "id": "b7dcbe18-cfba-4499-a4b4-dee33c93cf7a",
      "name": "Save Image",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gqxL0RdQpLcwUlCA",
          "name": "Google Sheets account 27"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "15R17g00wcOVHwCWOdfHVHp_AlZE534MATCMoBLd8x-A",
          "mode": "list",
          "cachedResultName": "Building - AI Agent - Website to Post - autonoma.agency",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/15R17g00wcOVHwCWOdfHVHp_AlZE534MATCMoBLd8x-A/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1915567193,
          "mode": "list",
          "cachedResultName": "Summaries",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/15R17g00wcOVHwCWOdfHVHp_AlZE534MATCMoBLd8x-A/edit#gid=1915567193"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "Blog Link",
              "lookupValue": "={{ $('Telegram Trigger').item.json.message.text }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1400,
        -480
      ],
      "id": "2628ddfc-f05d-40e2-86e7-6ffee78a93f0",
      "name": "Get Image Prompt",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gqxL0RdQpLcwUlCA",
          "name": "Google Sheets account 27"
        }
      }
    },
    {
      "parameters": {
        "person": "CuV8AkviSo",
        "text": "={{ $json['LinkedIn Post'] }}",
        "shareMediaCategory": "IMAGE",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.linkedIn",
      "typeVersion": 1,
      "position": [
        2320,
        -480
      ],
      "id": "e7c0b87b-e918-4bac-b409-216591890808",
      "name": "LinkedIn",
      "credentials": {
        "linkedInOAuth2Api": {
          "id": "EeNPRIQwomE9nmKd",
          "name": "LinkedIn account 3"
        }
      }
    },
    {
      "parameters": {
        "url": "={{ $('Save Image').item.json['Image Link'] }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        2160,
        -480
      ],
      "id": "4b14fcb1-6350-4719-bce1-354248204282",
      "name": "DL Image"
    },
    {
      "parameters": {
        "jsCode": "const html = $input.first().json.data; // Or use .body if that's where the HTML is\n\n// --- 1. Extract the <title> tag ---\nlet title = null;\nconst titleMatch = html.match(/<title[^>]*>([^<]+)<\\/title>/i);\nif (titleMatch) {\n  title = titleMatch[1].trim();\n} else {\n  // Fallback to Open Graph title\n  const ogTitleMatch = html.match(/<meta[^>]+property=[\"']og:title[\"'][^>]+content=[\"']([^\"']+)[\"']/i);\n  if (ogTitleMatch) {\n    title = ogTitleMatch[1].trim();\n  }\n}\n\n// --- 2. Clean the HTML content ---\nconst cleanText = html\n  .replace(/<script[^>]*>.*?<\\/script>/gis, '')\n  .replace(/<style[^>]*>.*?<\\/style>/gis, '')\n  .replace(/<[^>]*>/g, ' ')\n  .replace(/\\s+/g, ' ')\n  .trim();\n\n// --- 3. Return result with everything you want ---\nreturn [{\n  ...$input.first().json,\n  pageTitle: title,\n  scrapedContent: cleanText,\n  originalLength: cleanText.length\n}];\n"
      },
      "id": "eb405e89-00dd-4005-ab2d-e3a2f090bb80",
      "name": "Extract Text",
      "type": "n8n-nodes-base.code",
      "position": [
        940,
        -440
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "url": "={{ $json.message.text }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        800,
        -440
      ],
      "id": "96e01d58-26fd-439b-b252-4b655a5d8dd7",
      "name": "Get Content"
    },
    {
      "parameters": {
        "jsCode": "// Get the LLM response text\nconst llmOutput = $input.first().json.text;\n\n// Split by platform labels and extract content\nconst linkedinMatch = llmOutput.match(/Post_LinkedIn:\\s*([\\s\\S]*?)(?=Post_Facebook:|$)/);\nconst facebookMatch = llmOutput.match(/Post_Facebook:\\s*([\\s\\S]*?)(?=Post_Instagram:|$)/);\nconst instagramMatch = llmOutput.match(/Post_Instagram:\\s*([\\s\\S]*?)(?=Post_Twitter:|$)/);\nconst twitterMatch = llmOutput.match(/Post_Twitter:\\s*([\\s\\S]*?)$/);\n\n// Extract and clean the content\nconst linkedinPost = linkedinMatch ? linkedinMatch[1].trim() : '';\nconst facebookPost = facebookMatch ? facebookMatch[1].trim() : '';\nconst instagramPost = instagramMatch ? instagramMatch[1].trim() : '';\nconst twitterPost = twitterMatch ? twitterMatch[1].trim() : '';\n\n// Return as separate fields\nreturn {\n  linkedin_content: linkedinPost,\n  facebook_content: facebookPost,\n  instagram_content: instagramPost,\n  twitter_content: twitterPost,\n  original_summary: $input.first().json.original_summary || ''\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1800,
        -280
      ],
      "id": "9efc5575-de5e-4f7d-8f5c-3e592dbb0f24",
      "name": "Split"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "15R17g00wcOVHwCWOdfHVHp_AlZE534MATCMoBLd8x-A",
          "mode": "list",
          "cachedResultName": "Building - AI Agent - Website to Post - autonoma.agency",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/15R17g00wcOVHwCWOdfHVHp_AlZE534MATCMoBLd8x-A/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1915567193,
          "mode": "list",
          "cachedResultName": "Summaries",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/15R17g00wcOVHwCWOdfHVHp_AlZE534MATCMoBLd8x-A/edit#gid=1915567193"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Blog Link": "={{ $('Telegram Trigger').first().json.message.text }}",
            "LinkedIn Post": "={{ $json.linkedin_content }}",
            "Facebook Post": "={{ $json.facebook_content }}",
            "Instagram Post": "={{ $json.instagram_content }}",
            "Twitter/X Post": "={{ $json.twitter_content }}"
          },
          "matchingColumns": [
            "Blog Link"
          ],
          "schema": [
            {
              "id": "Blog Link",
              "displayName": "Blog Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Blog Title",
              "displayName": "Blog Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Blog Summary",
              "displayName": "Blog Summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Image Prompt",
              "displayName": "Image Prompt",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Image Link",
              "displayName": "Image Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "LinkedIn Post",
              "displayName": "LinkedIn Post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Facebook Post",
              "displayName": "Facebook Post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Instagram Post",
              "displayName": "Instagram Post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Twitter/X Post",
              "displayName": "Twitter/X Post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Publish Date",
              "displayName": "Publish Date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1920,
        -280
      ],
      "id": "1e67930c-cdcd-4c5e-a77c-41b60ae6f7cf",
      "name": "Save Posts",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gqxL0RdQpLcwUlCA",
          "name": "Google Sheets account 27"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://YOUR_MAKE_WEBHOOK",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "Row Number",
              "value": "={{ $('Get Image Prompt').first().json.row_number }}"
            },
            {
              "name": "Image URL",
              "value": "={{ $('Save Image').item.json['Image Link'] }}"
            },
            {
              "name": "Chat ID",
              "value": "={{ $('Telegram Trigger').first().json.message.chat.id }}"
            },
            {
              "name": "Facebook Post",
              "value": "={{ $('Split').item.json.facebook_content }}"
            },
            {
              "name": "Instagram Post",
              "value": "={{ $('Split').item.json.instagram_content }}"
            },
            {
              "name": "Twitter Post",
              "value": "={{ $('Split').item.json.twitter_content }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        2180,
        -260
      ],
      "id": "7aa5e343-e849-4eaa-9180-eb98cbb277e0",
      "name": "Make.com Webhook"
    },
    {
      "parameters": {
        "content": "## Generate Summary",
        "height": 420,
        "width": 560
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        780,
        -500
      ],
      "id": "2d9ce836-5bb0-473a-835c-ec84bcfe8811",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Generate Content",
        "height": 560,
        "width": 700,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1380,
        -540
      ],
      "id": "bc3c14cd-57a5-4d82-ae84-01d6e2c8b2a6",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## Publish Content",
        "height": 440,
        "width": 600,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        2100,
        -540
      ],
      "id": "36c60a41-552d-4db3-8c92-d9dc1b7b1efa",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-3-7-sonnet-20250219",
          "cachedResultName": "Claude 3.7 Sonnet"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.3,
      "position": [
        900,
        -220
      ],
      "id": "20072804-24b4-4d38-b85c-e75bc886db02",
      "name": "Anthropic Chat Model",
      "credentials": {
        "anthropicApi": {
          "id": "V3fqS2iW92jDHAR8",
          "name": "Anthropic account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Get the image prompt\nlet imagePrompt =  $input.first().json['Image Prompt']|| '';\n\n// Remove all problematic characters that cause syntax errors\nimagePrompt = imagePrompt\n  // Remove all types of quotes\n  .replace(/[\"\"\"'']/g, '')\n  // Remove apostrophes (including smart apostrophes)\n  .replace(/['']/g, '')\n  // Remove backticks\n  .replace(/`/g, '')\n  // Remove backslashes\n  .replace(/\\\\/g, '')\n  // Clean up any double spaces created by removals\n  .replace(/\\s+/g, ' ')\n  // Trim whitespace\n  .trim();\n\nreturn {\n  summary: $json.summary,\n  image_prompt_clean: imagePrompt,\n  image_prompt_original: $json.image_prompt\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1520,
        -480
      ],
      "id": "33d8e3d8-5d54-4099-8bff-48ee1fadb2b6",
      "name": "Clean"
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
        "text": "=Your post was submitted for publishing:\n\n{{ $('AI Agent').first().json.output }}",
        "additionalFields": {
          "parse_mode": "Markdown"
        }
      },
      "id": "69a77ddd-ed27-48c5-810c-3ceabb0f55aa",
      "name": "Send Post",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2340,
        -260
      ],
      "typeVersion": 1.2,
      "webhookId": "af4891f6-d3e8-4599-877c-a061700c2185",
      "credentials": {
        "telegramApi": {
          "id": "b19joq4pPMtB7hWl",
          "name": "Telegram account 25"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendPhoto",
        "chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
        "file": "={{ $('Get Image').first().json.data.output.image_url }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        2520,
        -400
      ],
      "id": "4ff99010-cb64-4c81-b5f7-97cc042a1ce5",
      "name": "Send Image",
      "webhookId": "cc4994ca-0a19-40f8-a2ab-3fb48b065820",
      "credentials": {
        "telegramApi": {
          "id": "b19joq4pPMtB7hWl",
          "name": "Telegram account 25"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-3-7-sonnet-20250219",
          "cachedResultName": "Claude 3.7 Sonnet"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.3,
      "position": [
        1540,
        -120
      ],
      "id": "a288e7de-06b6-436d-8e2e-d9eeaa445038",
      "name": "Anthropic Chat Model1",
      "credentials": {
        "anthropicApi": {
          "id": "V3fqS2iW92jDHAR8",
          "name": "Anthropic account"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Take this blog article summary and rewrite it for 4 different social media platforms:\n\nLINKEDIN: Professional tone, focus on business insights and industry implications, minimal bullet points, end with strategic question\n\nTWITTER: Maximum 200 characters, lead with the most shocking statistic, conversational tone, 1-2 relevant hashtags max\n\nINSTAGRAM: Engaging but not emoji-heavy (max 3 emojis total), focus on storytelling, use line breaks for readability, 3-5 strategic hashtags\n\nFACEBOOK: Conversational and relatable tone, focus on practical implications, ask engaging question that drives comments\n\n**FORMATTING RULE FOR LINKEDIN, INSTAGRAM, AND FACEBOOK:**\n- Only one sentence per line\n- Add one empty line between each sentence\n- This creates better readability on mobile devices\n\nMake the content more compelling by:\n- Leading with the most surprising statistic or insight\n- Using power words that create urgency or curiosity\n- Focusing on \"what this means for you\" rather than just facts\n- Creating natural conversation starters\n- Avoiding emoji overload (Instagram max 3, others max 1)\n\nSummary to rewrite: \n\n{{ $('AI Agent').first().json.output }}\n\n-----------\n\nReturn the output in this exact format:\n\nPost_LinkedIn:\n[LinkedIn version here]\n\nPost_Facebook: \n[Facebook version here]\n\nPost_Instagram:\n[Instagram version here]\n\nPost_Twitter:\n[Twitter version here]",
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        1520,
        -280
      ],
      "id": "b3919b8e-efb6-463b-941a-d2d024cf57a4",
      "name": "Generate Content"
    }
  ],
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Check for URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for URL": {
      "main": [
        [
          {
            "node": "Get Content",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No URL Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Get Image Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No URL Response": {
      "main": [
        []
      ]
    },
    "Save_Summary": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image": {
      "main": [
        [
          {
            "node": "Save Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Get Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Image": {
      "main": [
        [
          {
            "node": "Generate Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image Prompt": {
      "main": [
        [
          {
            "node": "Clean",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DL Image": {
      "main": [
        [
          {
            "node": "LinkedIn",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LinkedIn": {
      "main": [
        [
          {
            "node": "Make.com Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Content": {
      "main": [
        [
          {
            "node": "Extract Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split": {
      "main": [
        [
          {
            "node": "Save Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Posts": {
      "main": [
        [
          {
            "node": "DL Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Make.com Webhook": {
      "main": [
        [
          {
            "node": "Send Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Clean": {
      "main": [
        [
          {
            "node": "Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Post": {
      "main": [
        [
          {
            "node": "Send Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Image": {
      "main": [
        []
      ]
    },
    "Anthropic Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Content",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Generate Content": {
      "main": [
        [
          {
            "node": "Split",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "90e0772d-3759-4da0-9334-683160e56793",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "7ff6625f0127f3e9a7865e3493009de1c48f57dc5ed87def3ae3316be7f6b238"
  },
  "id": "ujNChlii8zAzrjXo",
  "tags": []
}