{ "nodes": [ { "parameters": { "fieldToSplitOut": "choices[0].message.content", "options": {} }, "id": "6599c5c2-58e0-44ca-9442-bb39c182b561", "name": "Split Out", "type": "n8n-nodes-base.splitOut", "position": [ -300, 360 ], "typeVersion": 1 }, { "parameters": { "content": "## Query for trends\n\n", "height": 240, "width": 400 }, "id": "44a026f7-0994-4c10-997b-1af7d37be449", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -1440, 280 ], "typeVersion": 1 }, { "parameters": { "content": "## Choose topic\n\n\n\n", "height": 440, "width": 360 }, "id": "240eb686-62a6-47a4-a4af-fe38262f0c7e", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ -1020, 280 ], "typeVersion": 1 }, { "parameters": { "content": "## Write entry\n\n\n", "height": 240, "width": 500 }, "id": "0ab48a8f-3c71-4acb-b918-005b0ef7ba16", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ -640, 280 ], "typeVersion": 1 }, { "parameters": { "url": "https://serpapi.com/search", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "q", "value": "= {{ $json.query.q }}" }, { "name": "geo", "value": "US" }, { "name": "hl", "value": "en" }, { "name": "date", "value": "={{ $now.minus({ days: 7 }).format('yyyy-MM-dd') }} {{ $now.format('yyyy-MM-dd') }}" }, { "name": "data_type", "value": "RELATED_QUERIES" }, { "name": "engine", "value": "google_trends" }, { "name": "api_key" } ] }, "options": {} }, "id": "589810fa-01c7-4a34-9a20-926ba242df3b", "name": "Google Trends", "type": "n8n-nodes-base.httpRequest", "position": [ -1400, 360 ], "typeVersion": 4.2 }, { "parameters": { "amount": 10 }, "id": "e70fe7c7-9c0b-4dae-9a28-59981bfbd114", "name": "Wait", "type": "n8n-nodes-base.wait", "position": [ -440, 360 ], "webhookId": "[GENERATED_WEBHOOK_ID]", "typeVersion": 1.1 }, { "parameters": { "content": "## Post", "height": 260 }, "id": "ce390fb5-0d30-4d2a-a8db-22c152b20d57", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ -80, 280 ], "typeVersion": 1 }, { "parameters": { "modelName": "models/gemini-2.0-flash", "options": {} }, "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini", "typeVersion": 1, "position": [ -960, 580 ], "id": "395246c2-d0a2-411a-87df-fba7b874bd7b", "name": "Google Gemini Chat Model", "credentials": { "googlePalmApi": { "id": "aLVr0H9YofE1KarF", "name": "Google Gemini(PaLM) Api account 2" } } }, { "parameters": { "model": "deepseek-r1:latest", "options": {} }, "type": "@n8n/n8n-nodes-langchain.lmChatOllama", "typeVersion": 1, "position": [ -800, 580 ], "id": "b8413af1-b76b-4237-a878-57b222789055", "name": "Ollama Chat Model", "credentials": { "ollamaApi": { "id": "xq2wZPhjbwYfOtm3", "name": "Ollama account" } } }, { "parameters": { "method": "POST", "url": "https://api.x.ai/v1/chat/completions", "authentication": "predefinedCredentialType", "nodeCredentialType": "xAiApi", "sendBody": true, "specifyBody": "json", "jsonBody": "={\n \"model\": \"grok-3\",\n \"messages\": [\n \n {\n \"role\": \"user\",\n \"content\": \"You are a business and technology insider and expert copywriter in a blog editor development team about technology and business. Generate exactly one LinkedIn post that is easy to read for humans and adheres to LinkedIn's API formatting guidelines. Follow these rules:\\n\\nStructure:\\n1. Hook: Start with a bold opening line using Unicode characters (e.g., \\\"ππŽπ‹πƒ π’π“π€π“π„πŒπ„ππ“\\\").\\n2. Body: Use short paragraphs (1-3 sentences) separated by \\\\n\\\\n.\\n3. Use bullet points (β€’) for key features or highlights.\\n4. End with a clear call-to-action (e.g., \\\"Comment below with your thoughts!\\\").\\n\\nFormatting Requirements:\\n- Remove all numeric citation brackets like [2], [3], [4] from the text.\\n- Instead of citation brackets, if needed, add a brief phrase like \\\"according to Google I/O 2025\\\" or \\\"as reported by DeepMind\\\" naturally within the sentence.\\n- No Markdown or rich text formatting.\\n- Use Unicode characters or emojis for emphasis (e.g., β˜…, πŸš€).\\n- Include up to 3 relevant hashtags at the end (e.g., #AI #Automation).\\n- Add URLs or references, for them use placeholders like [Link] instead of raw URLs.\\n- If mentioning users or companies, use official LinkedIn URN format (e.g., \\\"urn:li:organization:123456\\\").\\n\\nContent Rules:\\n- Max 1,200 characters.\\n- Avoid promotional language.\\n- Include one statistical claim or industry insight.\\n- Add one personal anecdote or professional observation.\\n\\nReturn the post as plain text without additional commentary.\\n\\nInput: {{ $json.message.content }}\"\n },\n {\n \"role\": \"system\",\n \"content\": \"Act as a skilled editor revising AI-generated text to make it sound authentically human. Follow these rules:\\n\\n1. Punctuation Adjustments\\n - Limit digressions in parentheses; integrate explanations into the main sentence. Language.\\n - Eliminate ellipses in the middle of sentences, unless they mimic a deliberate hesitation.\\n - Replace long dashes, semicolons, or rephrase sentences when neccessary.\\n - Avoid semicolons in informal contexts; use periods or conjunctions (e.g., 'and,' 'but').\\n \\n2. Language\\n - Replace hedging phrases with direct statements.\\n - Avoid stock transitions.\\n - Vary repetitive terms.\\n - Use contractions in informal contexts.\\n - Replace overly formal words with simpler alternatives.\\n\\n3. Style\\n - Prioritize concise, varied sentence lengths.\\n - Allow minor imperfections.\\n - Maintain the core message but adjust tone to match the audience.\"\n }\n ]\n}\n", "options": {} }, "id": "428e80a6-3d43-4baa-acb9-0148054904ff", "name": "Grok The writer", "type": "n8n-nodes-base.httpRequest", "position": [ -600, 360 ], "typeVersion": 4.2, "credentials": { "xAiApi": { "id": "JyOUOFKlOUeTFtvw", "name": "xAi account 2" } } }, { "parameters": { "person": "[CONFIGURE_YOUR_LINKEDIN_PERSON_ID]", "text": "={{ $json['choices[0].message.content'] }}", "additionalFields": {} }, "id": "5678cee5-c1b3-4052-8861-f8e97b6d5c9c", "name": "LinkedIn Post", "type": "n8n-nodes-base.linkedIn", "position": [ -20, 360 ], "typeVersion": 1, "credentials": { "linkedInOAuth2Api": { "id": "56SuV0gAmXsv4g2K", "name": "LinkedIn account" } } }, { "parameters": { "mode": "raw", "jsonOutput": "={\n \"top5\": {\n\n \"#1\": { \n\n \"query\":\"{{ $json.related_queries.rising[0].query }}\",\n \"extracted_value\":\"{{ $json.related_queries.rising[0].extracted_value }}\"\n\n },\n\n\n \"#2\": { \n\n \"query\":\"{{ $json.related_queries.rising[1].query }}\",\n \"extracted_value\":\"{{ $json.related_queries.rising[1].extracted_value }}\"\n\n },\n\n\n \"#3\": { \n\n \"query\":\"{{ $json.related_queries.rising[2].query }}\",\n \"extracted_value\":\"{{ $json.related_queries.rising[2].extracted_value }}\"\n\n },\n\n\n \"#4\": { \n\n \"query\":\"{{ $json.related_queries.rising[3].query }}\",\n \"extracted_value\":\"{{ $json.related_queries.rising[3].extracted_value }}\"\n\n },\n\n\n \"#5\": { \n\n \"query\":\"{{ $json.related_queries.rising[4].query }}\",\n \"extracted_value\":\"{{ $json.related_queries.rising[4].extracted_value }}\"\n\n }\n\n \n }\n}", "options": {} }, "id": "317108c5-b764-4984-8433-598ec8b7b0a1", "name": "5 Most Trending", "type": "n8n-nodes-base.set", "position": [ -1180, 360 ], "typeVersion": 3.4 }, { "parameters": { "path": "304a39ca-dc97-4156-bbc9-fcb5aa937e21", "options": {} }, "type": "n8n-nodes-base.webhook", "typeVersion": 2, "position": [ -1620, 360 ], "id": "0532ceda-f80c-4fa0-98d8-3a8bd8dd45ed", "name": "Webhook", "webhookId": "304a39ca-dc97-4156-bbc9-fcb5aa937e21" }, { "parameters": { "promptType": "define", "text": "=You are part of the editorial team of a technology and business company, your job is to choose interesting topics to post on linkedin. \nSome of the posts are also posted in company's webpage. It is important that the entries are well positioned at SEO level.\nYou are provided with a list of keywords that have been the most searched for in Google during the last week.\nYour job is to choose what you think would be the most relevant blog post with the best SEO results.\nKeywords have two attributes:\n1. query: this attribute marks the search query that users have performed and that is trending.\n2. extracted_value: this attribute marks the percentage increase that the keyword has experienced compared to previous periods. \nYou should choose one taking into account both the keyword's relevance to the company's SEO efforts and the comparative trend determined by the β€œvalue” attribute.\nWrite the keyword you have decided to post about without reasoning. Just write the word. Don't explain your reasoning\nFor this case:\n\n\nKeyword 1:\n{{ $('5 Most Trending').item.json['top5']['#1'].toJsonString() }} \n\nKeyword 2: \n{{ $('5 Most Trending').item.json['top5']['#2'].toJsonString() }} \n\nKeyword 3:\n{{ $('5 Most Trending').item.json['top5']['#3'].toJsonString() }} \n\nKeyword 4: \n{{ $('5 Most Trending').item.json['top5']['#4'].toJsonString() }} \n\nKeyword 5:\n{{ $('5 Most Trending').item.json['top5']['#5'].toJsonString() }} \n\n", "options": {} }, "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 1.9, "position": [ -980, 360 ], "id": "9b650620-4d8f-48b8-86bc-64fee1387864", "name": "AI Agent" } ], "connections": { "Split Out": { "main": [ [ { "node": "LinkedIn Post", "type": "main", "index": 0 } ] ] }, "Google Trends": { "main": [ [ { "node": "5 Most Trending", "type": "main", "index": 0 } ] ] }, "Wait": { "main": [ [ { "node": "Split Out", "type": "main", "index": 0 } ] ] }, "Ollama Chat Model": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Grok The writer": { "main": [ [ { "node": "Wait", "type": "main", "index": 0 } ] ] }, "5 Most Trending": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "Webhook": { "main": [ [ { "node": "Google Trends", "type": "main", "index": 0 } ] ] }, "AI Agent": { "main": [ [ { "node": "Grok The writer", "type": "main", "index": 0 } ] ] } }, "pinData": {}, "meta": { "instanceId": "0ee5abdd8f9c56637e04397d0c74c91ed93e35a75a1b16997a2f3ce16ccb560a" } }