{
  "name": "LinkedIn Post",
  "nodes": [
    {
      "parameters": {
        "toolDescription": "Use this tool to search the web. ",
        "method": "POST",
        "url": "https://api.tavily.com/search",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"query\": \"{searchTerm}\",\n  \"topic\": \"general\",\n  \"search_depth\": \"advanced\",\n  \"chunks_per_source\": 3,\n  \"max_results\": 1,\n  \"time_range\": null,\n  \"days\": 7,\n  \"include_answer\": true,\n  \"include_raw_content\": false,\n  \"include_images\": false,\n  \"include_image_descriptions\": false,\n  \"include_domains\": [],\n  \"exclude_domains\": []\n}",
        "placeholderDefinitions": {
          "values": [
            {
              "name": "searchTerm",
              "description": "What the user is searching for. "
            }
          ]
        }
      },
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "typeVersion": 1.1,
      "position": [
        -1400,
        320
      ],
      "id": "d32d147f-99e9-4fac-a52b-cfa568884de3",
      "name": "Tavily",
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": "openai/gpt-4.1",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        -1260,
        320
      ],
      "id": "5f12b54a-9e34-4568-85c2-6d4d2d378fdf",
      "name": "GPT_4.1",
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Blog Post: \n{{ $json.output }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "=# Overview\nYou are an AI agent that transforms LinkedIn posts into visual prompt descriptions for generating graphic marketing materials. These visuals are designed to be paired with the post on LinkedIn, helping communicate the message in a visually engaging, brand-aligned way.\n\n## Objective:\n- Read and analyze the given LinkedIn post.\n- Identify the main message, insight, or takeaway from the post.\n- Create a clear and compelling graphic prompt that can be used with a text-to-image generator.\n- The result should be a marketing-style graphic \u2014 not a literal scene or hyperrealistic photo \u2014 that:\n1) Visually supports or illustrates the key idea of the post\n2) Looks appropriate for use in a professional LinkedIn feed\n3) Feels polished, modern, and engaging\n\n## Output Instructions:\n- Output only the final image prompt. Do not output quotation marks.\n- Do not repeat or rephrase the LinkedIn post.\n- Do not add any explanations or extra content \u2014 just the image prompt.\n- Never leave things blank like \"Header area reserved for customizable callout text\"\n- Output numeric stats when available in the original post\n\n## Style Guidelines:\n- Think like a brand designer or marketing creative.\n- Visuals may include: text, charts, icons, abstract shapes, overlays, modern illustrations, motion-like effects, bold typography elements (described, not rendered), or metaphorical concepts.\n- You can mention layout suggestions (e.g., \"split screen design,\" \"header with bold title and subtle background illustration\").\n- Assume the output will be generated using AI image tools \u2014 your prompt should guide those tools effectively.\n\n## Example Prompt Format:\nA modern flat-style graphic showing a human brain connected to mechanical gears, representing the fusion of AI and automation. Minimalist background, soft gradients, clean sans-serif text placement space at the top."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.9,
      "position": [
        -980,
        40
      ],
      "id": "cc7bc0bb-ab00-4f74-932f-cea88ddabdeb",
      "name": "Image Prompt Agent"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/images/generations",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-image-1"
            },
            {
              "name": "prompt",
              "value": "={{ $json.output.prompt.replace(/\"/g, '') }}"
            },
            {
              "name": "size",
              "value": "1024x1024"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -540,
        40
      ],
      "id": "15caf708-762f-45a8-8e03-21eeff9e1c8f",
      "name": "Generate Image",
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "toBinary",
        "sourceProperty": "data[0].b64_json",
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        -340,
        40
      ],
      "id": "4d457166-37aa-45f4-be37-1d4e58793513",
      "name": "Convert to Binary"
    },
    {
      "parameters": {
        "content": "# Content Generation",
        "height": 260,
        "width": 380
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1480,
        -60
      ],
      "id": "47b85ad5-1946-4e35-b298-871f8f633049",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "# Generate Image\n",
        "height": 260,
        "width": 460,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -620,
        -60
      ],
      "id": "ec10c863-57d9-4853-98ab-64a0a5433234",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "# Image Prompt\n",
        "height": 260,
        "width": 440,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1080,
        -60
      ],
      "id": "bf817bd4-0c04-4b1f-ba3a-b2ce2f67d52d",
      "name": "Sticky Note4"
    },
    {
      "parameters": {
        "content": "## Tool & Model",
        "height": 240,
        "width": 380,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1480,
        220
      ],
      "id": "4be3df2c-a747-461f-9661-2f6f1fcb0ebe",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "postTopic"
            },
            {
              "name": "targetAudience"
            },
            {
              "name": "chatID"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [
        -1680,
        40
      ],
      "id": "adbbc66c-28a8-42fd-a2c0-448ded9c1833",
      "name": "When Executed by Another Workflow"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Topic of Post: {{ $json.blogTopic }}\n\nTarget Audience: {{ $json.targetAudience }}",
        "options": {
          "systemMessage": "=# Overview\nYou are an AI agent specialized in creating professional, educational, and engaging LinkedIn posts based on any topic provided by the user.\n\n## Objectives:\nAlways begin by conducting a real-time search using the Tavily tool to gather the most accurate, up-to-date information on the topic. The post should be written to appeal to the provided target audience.\n\nBased on your research, generate a well-structured LinkedIn post that:\n- Starts with an engaging hook\n- Professional in tone\n- Clear and easy to read\n- Educational and insightful\n- Light on emojis (use only when highly relevant and minimal)\n- Includes proper source attribution (e.g., \u201caccording to [source]\u201d)\n- Contains relevant hashtags to improve visibility\n- Ends with a clear call to action (e.g., asking for thoughts, feedback, or shares)\n\n## Output Instructions:\n- Your ONLY output should be the final LinkedIn post text.\n- Do not include explanations, notes, or anything beyond the post itself.\n\n## Example Workflow:\n1) Receive a topic (e.g., \u201cThe ROI of warehouse automation\u201d)\n2) Use Tavily to search and gather recent information or case studies\n3) Draft a LinkedIn post using that research\n4) Format it with source citations, clean structure, optional hashtags, and a call to action"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.9,
      "position": [
        -1420,
        40
      ],
      "id": "e89b4d18-3859-4401-8403-0ba9451c6c4d",
      "name": "Blog Post Agent"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1JqOTd49heNBdmrf5hSwxI66X724tspAmSjzWoA6-EU0",
          "mode": "list",
          "cachedResultName": "Marketing Team Log",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1JqOTd49heNBdmrf5hSwxI66X724tspAmSjzWoA6-EU0/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1JqOTd49heNBdmrf5hSwxI66X724tspAmSjzWoA6-EU0/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Request": "={{ $('When Executed by Another Workflow').item.json.postTopic }} for {{ $('When Executed by Another Workflow').item.json.targetAudience }}",
            "ID": "={{ $json.id }}",
            "Link": "={{ $json.webViewLink }}",
            "Post": "={{ $('Blog Post Agent').item.json.output }}",
            "Title": "={{ $('When Executed by Another Workflow').item.json.postTopic }}",
            "Type": "Post"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "Title",
              "displayName": "Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Type",
              "displayName": "Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Request",
              "displayName": "Request",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Link",
              "displayName": "Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Post",
              "displayName": "Post",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        220,
        200
      ],
      "id": "bd01c1b1-85d2-400e-b80c-fc350ffa5f76",
      "name": "Image Log",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"title\": \"<2-4 word creative title for the image>\",\n  \"prompt\": \"<full detailed image generation prompt>\"\n}\n"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.2,
      "position": [
        -880,
        320
      ],
      "id": "beea7518-3f06-484c-b4d0-e5af6e69a6f6",
      "name": "Image & Title"
    },
    {
      "parameters": {
        "content": "## Structured Output",
        "height": 240,
        "width": 320,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1000,
        220
      ],
      "id": "be245b99-7766-4f1a-9164-f026f338dc73",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "chatId": "={{ $('When Executed by Another Workflow').item.json.chatID }}",
        "text": "={{ $('Blog Post Agent').item.json.output }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        220,
        -100
      ],
      "id": "d1cd8c19-443a-400e-8ea8-78c514e9c2d4",
      "name": "Send Blog",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendPhoto",
        "chatId": "={{ $('When Executed by Another Workflow').item.json.chatID }}",
        "binaryData": true,
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        0,
        -100
      ],
      "id": "1bf45d2e-eab8-4093-b3fa-87a0e7c6b119",
      "name": "Send Photo",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "# Trigger\n",
        "height": 260,
        "width": 260,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1760,
        -60
      ],
      "id": "c7c0a34f-0ea4-4eac-9e8a-cc308e145ea5",
      "name": "Sticky Note5",
      "disabled": true
    },
    {
      "parameters": {
        "content": "# Write to Drive & Sheets",
        "height": 240,
        "width": 540,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -120,
        120
      ],
      "id": "1175a580-8ae1-444b-b2ec-7b877cdee2d2",
      "name": "Sticky Note6"
    },
    {
      "parameters": {
        "content": "# Send Content",
        "height": 240,
        "width": 540,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -120,
        -180
      ],
      "id": "94b94662-d7c5-48da-9d4c-1d0f331a55a9",
      "name": "Sticky Note7"
    },
    {
      "parameters": {
        "name": "={{ $('Image Prompt Agent').item.json.output.title }}.png",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "1TgQu-5hlOzO1X28TMMzLxfhunhPSUIqy",
          "mode": "list",
          "cachedResultName": "AI Image Generation",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1TgQu-5hlOzO1X28TMMzLxfhunhPSUIqy"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        0,
        200
      ],
      "id": "7f60caf9-9108-456f-a106-e06598618540",
      "name": "Upload",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Tavily": {
      "ai_tool": [
        [
          {
            "node": "Blog Post Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "GPT_4.1": {
      "ai_languageModel": [
        [
          {
            "node": "Blog Post Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Image Prompt Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Image Prompt Agent": {
      "main": [
        [
          {
            "node": "Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image": {
      "main": [
        [
          {
            "node": "Convert to Binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to Binary": {
      "main": [
        [
          {
            "node": "Send Photo",
            "type": "main",
            "index": 0
          },
          {
            "node": "Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Blog Post Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Blog Post Agent": {
      "main": [
        [
          {
            "node": "Image Prompt Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image & Title": {
      "ai_outputParser": [
        [
          {
            "node": "Image Prompt Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Send Photo": {
      "main": [
        [
          {
            "node": "Send Blog",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload": {
      "main": [
        [
          {
            "node": "Image Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "bd13e436-162f-4daf-8870-4f2ef455863f",
  "id": "RgUBWsswXoQsX2tI",
  "tags": []
}