{
  "id": "uGr9jurLeQxUVCMn",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Auto-Generate LinkedIn Posts with AI Image, Deliver via Email & Telegram",
  "tags": [],
  "nodes": [
    {
      "id": "7f253119-0dcf-4616-8f86-c555819f9b34",
      "name": "LinkedIn Post Form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        96,
        448
      ],
      "parameters": {
        "options": {},
        "formTitle": "LinkedIn Post Creator",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Post Topic"
            },
            {
              "fieldLabel": "Target Audience"
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Tone",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Professional"
                  },
                  {
                    "option": "Casual"
                  },
                  {
                    "option": "Inspirational"
                  },
                  {
                    "option": "Bold"
                  }
                ]
              }
            },
            {
              "fieldType": "email",
              "fieldLabel": "Your Email"
            }
          ]
        }
      },
      "typeVersion": 2.5
    },
    {
      "id": "a5712637-d98c-4583-83c6-a2a0b776d99a",
      "name": "Generate LinkedIn Post",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        320,
        448
      ],
      "parameters": {
        "text": "={{ $json['Post Topic'] }} for {{ $json['Target Audience'] }} \u2014 write in a {{ $json['Tone'] }} tone",
        "options": {
          "systemMessage": "You are a LinkedIn content expert. Using the research provided, write a LinkedIn post with: a strong hook, 3 key insights, relevant hashtags, and a call-to-action. Keep it under 200 words."
        },
        "promptType": "define"
      },
      "typeVersion": 3.1
    },
    {
      "id": "64b1b327-e37b-4e3d-9180-fcbf21e4dd7b",
      "name": "Create Image Prompt",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        672,
        448
      ],
      "parameters": {
        "text": "={{ $json.output }}",
        "options": {
          "systemMessage": "You are an image prompt expert. Read the LinkedIn post and create a single, short, clean visual prompt (max 100 words) for AI image generation. Make it professional, business-themed, no text in image. Output only the image prompt, nothing else."
        },
        "promptType": "define"
      },
      "typeVersion": 3.1
    },
    {
      "id": "4b5e1da1-7fee-4996-929d-cece4a71d2f5",
      "name": "Groq LLM",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        672,
        768
      ],
      "parameters": {
        "model": "llama-3.3-70b-versatile",
        "options": {
          "temperature": 0.7
        }
      },
      "credentials": {
        "groqApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "832cc885-0eb0-4a58-9f88-d62ff20ca4b5",
      "name": "Fetch AI Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1024,
        448
      ],
      "parameters": {
        "url": "={{ 'https://image.pollinations.ai/prompt/' + encodeURIComponent($json.output.substring(0, 250)) + '?width=1024&height=1024&nologo=true&model=flux' }}",
        "options": {
          "timeout": 60000,
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "generated_image"
            }
          }
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "4c53da79-7aae-40f7-8ce6-cdc1f79ff1e0",
      "name": "Tavily Web Search",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        464,
        752
      ],
      "parameters": {
        "url": "https://api.tavily.com/search",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "={{ $('LinkedIn Post Form').item.json['Post Topic'] }}"
            },
            {
              "name": "search_depth",
              "value": "basic"
            },
            {
              "name": "max_results",
              "value": "3"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_TOKEN_HERE"
            }
          ]
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "d92058a1-d5a0-483e-98b3-c9abfbe04c26",
      "name": "Send Email via Brevo",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1264,
        448
      ],
      "parameters": {
        "text": "={{ $('Generate LinkedIn Post').item.json.output }}",
        "options": {
          "attachments": "generated_image"
        },
        "subject": "=LinkedIn Post Ready: {{ $('LinkedIn Post Form').item.json['Post Topic'] }} for {{ $('LinkedIn Post Form').item.json['Target Audience'] }}",
        "toEmail": "={{ $('LinkedIn Post Form').item.json['Your Email'] }}",
        "fromEmail": "user@example.com",
        "emailFormat": "text"
      },
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "5ca8f6d9-468c-43c3-bfbd-cf657ba6f3a5",
      "name": "Log Post in Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        1472,
        448
      ],
      "parameters": {
        "title": "={{ $('LinkedIn Post Form').item.json['Post Topic'] }}",
        "options": {},
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "mode": "id",
          "value": "Notion will prompt users to reconnect their own"
        },
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Target Audience|rich_text",
              "textContent": "={{ $('LinkedIn Post Form').item.json['Target Audience'] }}"
            },
            {
              "key": "Tone|rich_text",
              "textContent": "={{ $('LinkedIn Post Form').item.json['Tone'] }}"
            },
            {
              "key": "Generated Post|rich_text",
              "textContent": "={{ $('Generate LinkedIn Post').item.json.output }}"
            },
            {
              "key": "Date|date",
              "date": "={{ $now.toISO() }}",
              "timezone": "Asia/Calcutta"
            },
            {
              "key": "Email|email",
              "emailValue": "={{ $('LinkedIn Post Form').item.json['Your Email'] }}"
            }
          ]
        }
      },
      "credentials": {
        "notionApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "0db8e80a-498f-4757-9966-1a872186b62d",
      "name": "Send Image to Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1312,
        672
      ],
      "parameters": {
        "chatId": "YOUR_TELEGRAM_CHAT_ID",
        "operation": "sendPhoto",
        "binaryData": true,
        "additionalFields": {},
        "binaryPropertyName": "generated_image"
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "dfb012ff-cc17-446d-9d2b-819e06be8093",
      "name": "Send Post to Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1552,
        672
      ],
      "parameters": {
        "text": "=\ud83d\ude80 Your LinkedIn Post is Ready!\n\n\ud83d\udccc Topic: {{ $('LinkedIn Post Form').item.json['Post Topic'] }}\n\ud83d\udc65 Audience: {{ $('LinkedIn Post Form').item.json['Target Audience'] }}\n\ud83c\udfaf Tone: {{ $('LinkedIn Post Form').item.json['Tone'] }}\n\n\ud83d\udcdd POST CONTENT:\n{{ $('Generate LinkedIn Post').item.json.output }}\n\n\u2705 Also sent to your email!",
        "chatId": "YOUR_TELEGRAM_CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b0fbf4a2-3c95-4fb9-a595-92e8ba8f5083",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        320
      ],
      "parameters": {
        "width": 464,
        "height": 592,
        "content": "## LinkedIn Post Creator - Auto Generated with AI\n\n**Who is this for :**\nMarketers, Founders, and content creators who wants their Posts to be delivered automatically on LinkedIn.\n\n**What it does :**\n- Collects your Topic, audience and tone via a simple form\n- Searches the web for latest updates and info using Tavily\n- Writes a LinkedIn Post using Groq AI in AI Agent 1 (Generate LinkedIn Post)\n- Generates a matching image using Pollinations AI ( Free ) when the Prompt received from AI Agent 2 (Create Image Prompt)\n- Sends the post and the image to Telegram\n- Emails you the final post with the image via Brevo\n- Saves everything to a Notion database\n\n**Setup needed:**\n1- Add your Groq API key ( Free at console.groq.com)\n2- Add your Tavily API Key ( free at tavily.com)\n3- Add your Brevo API key (free at brevo.com)\n4- Create a Telegram bot via Botfather and add token\n5- Connect your Notion workspace\n\nBuilt and Tested by Utkarsh Kapoor"
      },
      "typeVersion": 1
    },
    {
      "id": "53c8d5da-91aa-4f38-a618-cfe6519c7345",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        320
      ],
      "parameters": {
        "color": 4,
        "width": 848,
        "height": 592,
        "content": "## Content Generation\nForm collects topic ,audience and tone > Tavily searches the web > Groq AI writes the LinkedIn post > AI creates an image prompt"
      },
      "typeVersion": 1
    },
    {
      "id": "a0c36213-c5f6-4607-801c-9873071343f2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        928,
        320
      ],
      "parameters": {
        "color": 6,
        "width": 288,
        "height": 592,
        "content": "## Image Generation\n\nFetches a professional AI image from Pollinations using the generated prompt"
      },
      "typeVersion": 1
    },
    {
      "id": "0be62ada-ad90-47fd-8439-20e0a78c491f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1232,
        320
      ],
      "parameters": {
        "color": 2,
        "width": 496,
        "height": 592,
        "content": "## Delivery and Storage \n\nSend Image + post to Telegram , email via Brevo and log everything in Notion"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "af1d38ad-9b4f-4354-b5b9-214a0671c810",
  "connections": {
    "Groq LLM": {
      "ai_languageModel": [
        [
          {
            "node": "Generate LinkedIn Post",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Create Image Prompt",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Fetch AI Image": {
      "main": [
        [
          {
            "node": "Send Email via Brevo",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Image to Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tavily Web Search": {
      "ai_tool": [
        [
          {
            "node": "Generate LinkedIn Post",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "LinkedIn Post Form": {
      "main": [
        [
          {
            "node": "Generate LinkedIn Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Post in Notion": {
      "main": [
        [
          {
            "node": "Send Post to Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Image Prompt": {
      "main": [
        [
          {
            "node": "Fetch AI Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email via Brevo": {
      "main": [
        [
          {
            "node": "Log Post in Notion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Post to Telegram": {
      "main": [
        []
      ]
    },
    "Generate LinkedIn Post": {
      "main": [
        [
          {
            "node": "Create Image Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Image to Telegram": {
      "main": [
        []
      ]
    }
  }
}