i’m trying to make it search in specific website for information about a specific topic then pass it to the ai agent and let local ollama model create an article based on the prompt then post it on wordpress.
I’m not finding a solution to extracting the write information or search results to pass it to the ai agent .
He’re the workflow:
{
“name”: “Autoblogger RCF”,
“nodes”: [
{
“parameters”: {
“model”: “qwen2.5:32b-instruct”,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOllama”,
“typeVersion”: 1,
“position”: [
660,
220
],
“id”: “275cb8d5-25ca-44d9-8518-6a1c2a93c78c”,
“name”: “Ollama Chat Model”,
“credentials”: {
“ollamaApi”: {
“id”: “d1gIGjutIE0uyDZl”,
“name”: “Ollama account”
}
}
},
{
“parameters”: {},
“type”: “@n8n/n8n-nodes-langchain.memoryPostgresChat”,
“typeVersion”: 1.3,
“position”: [
840,
220
],
“id”: “67be894c-24d8-4523-ad50-93a2f1d6c643”,
“name”: “Postgres Chat Memory”,
“credentials”: {
“postgres”: {
“id”: “5ceCFsG5OgZTBY5K”,
“name”: “Postgres account”
}
}
},
{
“parameters”: {
“model”: “qwen2.5:32b-instruct”,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOllama”,
“typeVersion”: 1,
“position”: [
1120,
200
],
“id”: “4ef205da-63d8-40b3-a4d3-a4ec229a8386”,
“name”: “Ollama Chat Model1”,
“credentials”: {
“ollamaApi”: {
“id”: “d1gIGjutIE0uyDZl”,
“name”: “Ollama account”
}
}
},
{
“parameters”: {
“promptType”: “define”,
“text”: “=Based on this research content:{{ $(‘Fetch Website Content’).item.json.data }} "Write a comprehensive and engaging article about {{ $(‘When chat message received’).item.json.chatInput }} . The aim of this article is to raise cancer awareness among the general public by providing informative, accessible, and empowering content. Please adhere to the following guidelines to ensure the article is high-quality, professional, SEO-optimized, and not mediocre:\n\nArticle Content Requirements:\n\n Research and Accuracy: Utilize up-to-date, evidence-based information from reputable sources such as peer-reviewed journals, major medical institutions (e.g., Mayo Clinic, National Cancer Institute), and recognized cancer organizations (e.g., American Cancer Society, Cancer Research UK). Fact-check all data and statistics meticulously. Include in-text citations and a full list of references at the end. Prioritize reputable, primary sources whenever possible. \n\n Structure and Formatting:\n Title: Craft a clear, concise, and engaging title that accurately reflects the article’s content and incorporates relevant keywords for SEO.\n Introduction: Provide a brief overview of the topic, explain its importance and impact on the general public, and clearly state what readers will learn in the article. Aim to capture the reader’s attention immediately.\n Body:\n Organize the content logically using clear and descriptive subheadings that are also SEO-friendly (incorporating relevant keywords).\n Use bullet points or numbered lists to highlight key information, practical tips, and actionable advice.\n Where applicable, include practical tips and actionable advice that readers can implement in their daily lives.\n Conclusion: Summarize the key takeaways of the article, reinforce the importance of the topic, encourage proactive steps related to cancer awareness or prevention, and include a clear call to action (e.g., ‘Talk to your doctor,’ ‘Learn more at [relevant organization website],’ ‘Share this article’).\n References and Additional Resources: List all sources cited within the text in a consistent citation style (e.g., APA, MLA). Provide direct links to further reading, support organizations, and reputable websites where readers can find more information.\n\nWriting Style and Tone:\n\n Tone: Maintain a supportive and compassionate tone, acknowledging the emotional impact of cancer and offering hope and encouragement. The overall tone should also be informative and empowering, providing clear, factual information that enables readers to make informed decisions about their health.\n Style: Use clear and simple language, avoiding complex medical jargon. If technical terms are necessary, provide clear and concise explanations in plain language. Write in an engaging and accessible conversational style that is easy for a general audience to understand. Aim for a concise article length of approximately 600-800 words, ensuring it is detailed yet not overwhelming.\n Voice: Use an active voice and employ the first-person plural (we, our) where appropriate to create a sense of community and shared experience. Be respectful and non-judgmental in your language, avoiding any phrasing that could be perceived as blaming or shaming.\n\nLanguage:\n\n Deliver two versions of the article: one written in fluent and accurate English, and a second version translated into fluent and accurate Arabic. Ensure high-quality translation that maintains the original meaning, tone, and structure, using appropriate medical terminology in Arabic.\n\nCredibility Measures:\n\n Citations: Cite all sources within the text using a consistent method (e.g., hyperlinking to the source or using bracketed numbers corresponding to the reference list). Provide a full list of references at the end of the article.\n Regular Updates: Indicate that this article should be reviewed and updated at least annually to reflect the latest research and guidelines. Include a placeholder for the date of the last update at the beginning or end of the article (e.g., ‘Last Updated: [Date]’).\n Author Credentials: Include a placeholder for the author’s name and a link to their LinkedIn profile (e.g., ‘Written by [Author Name], connect on LinkedIn: [LinkedIn Profile URL]’).\n Transparency: Include a statement disclosing any potential conflicts of interest, if applicable (e.g., ‘The author declares no conflicts of interest.’). Be transparent about the sources of information and the general review process (e.g., ‘This article was based on research from the sources listed below and reviewed for accuracy.’).\n\nTechnical Specifications (for web optimization):\n\n Readability: Use short paragraphs and sentences to enhance readability for online audiences.\n Font: Suggest the use of a readable and web-friendly font (e.g., Arial, Helvetica, Open Sans) in a size of 12-14 points.\n Multimedia: Suggest relevant and high-quality images, infographics, and videos to enhance understanding and engagement. Ensure all multimedia elements include descriptive alt text for accessibility and SEO.\n Links and Navigation: Incorporate relevant internal hyperlinks to other articles within the website (if applicable) and external hyperlinks to reputable sources and related high-quality content. Ensure all links are functional. \n\n Accessibility: Adhere to web accessibility guidelines (WCAG) to ensure the content is accessible to people with disabilities. Use appropriate headers (H1, H2, H3, etc.), bulleted/numbered lists, and descriptive link texts to aid navigation and screen readers.\n\nSEO Optimization:\n\n Conduct keyword research for the chosen topic and strategically incorporate relevant keywords and synonyms throughout the title, headings, subheadings, introduction, body, and conclusion.\n Optimize image file names and alt text with relevant keywords.\n Ensure the article has a clear and logical structure with appropriate use of headings and subheadings (H1, H2, H3 tags).\n Include internal and external links to authoritative sources.\n Aim for a readable URL structure.\n Consider including a meta description and relevant tags for the article.\n\nOverall Quality:\n\n Ensure the final article is free of grammatical errors, typos, and factual inaccuracies.\n The article should be well-organized, easy to follow, and provide valuable information to the reader, ultimately contributing to increased cancer awareness.\n\nPlease provide the two versions of this article (English and Arabic) based on these comprehensive guidelines." “,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 1.7,
“position”: [
820,
-60
],
“id”: “402b6bce-008a-4af5-94cf-0c34b5b49c0a”,
“name”: “English blog writer”
},
{
“parameters”: {
“promptType”: “define”,
“text”: “=Translate this to professional Arabic {{ $json.output }}”,
“options”: {
“systemMessage”: “You are a helpful assistant”
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 1.7,
“position”: [
1140,
-20
],
“id”: “f0362b2b-9bcd-471e-9d69-956e5b7f2b0d”,
“name”: “Arabic Blog writer”
},
{
“parameters”: {
“public”: true,
“initialMessages”: “Hi there! \nMy name is RCF. How can I assist you today?”,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.chatTrigger”,
“typeVersion”: 1.1,
“position”: [
-520,
-140
],
“id”: “49f705bb-9375-48a2-9a17-42d0894c0e64”,
“name”: “When chat message received”,
“webhookId”: “aa206c14-a65a-41f1-b87c-8a2dbba7d9b6”
},
{
“parameters”: {
“title”: “={{ $(‘When chat message received’).item.json.chatInput }}”,
“additionalFields”: {
“content”: “={{ $(‘English blog writer’).item.json.output }}”,
“postTemplate”: {
“values”: {}
}
}
},
“type”: “n8n-nodes-base.wordpress”,
“typeVersion”: 1,
“position”: [
1600,
0
],
“id”: “fdd77e84-a95f-4972-a895-9314d0f7689e”,
“name”: “Wordpress”,
“credentials”: {
“wordpressApi”: {
“id”: “D01yLS46YqPxmgIR”,
“name”: “Wordpress account”
}
}
},
{
“parameters”: {
“mode”: “raw”,
“jsonOutput”: “{\n "urls": [\n { "url": "https://www.cancer.gov/\” },\n { "url": "https://www.cancer.org/\” },\n { "url": "https://www.mayoclinic.org/cancer-care\” },\n { "url": "https://www.cdc.gov/cancer/index.htm\" },\n { "url": "https://www.cancer.net/\" },\n { "url": "National Comprehensive Cancer Network - Home" },\n { "url": "https://www.cancerresearchuk.org/\" },\n { "url": "https://medlineplus.gov/cancer.html\" },\n { "url": "https://www.aacr.org/\" },\n { "url": "Breastcancer.org - Breast Cancer Information and Support" }\n ]\n}\n",
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
-320,
-120
],
“id”: “cd6ac006-9fa6-45c7-9160-a0d0f934e9d0”,
“name”: “Website URL Storage”
},
{
“parameters”: {
“url”: “={{ $json.url }}\n”,
“options”: {
“response”: {
“response”: {
“responseFormat”: “text”
}
}
}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
260,
-100
],
“id”: “97da7104-58f8-4981-99e9-7db27f741e02”,
“name”: “Fetch Website Content”
},
{
“parameters”: {
“options”: {
“reset”: false
}
},
“type”: “n8n-nodes-base.splitInBatches”,
“typeVersion”: 3,
“position”: [
-40,
-100
],
“id”: “26ced1e8-fafc-4dc9-b353-ca14fec1a18b”,
“name”: “Process Each Website”
},
{
“parameters”: {
“operation”: “extractHtmlContent”,
“extractionValues”: {
“values”: [
{
“cssSelector”: “body”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.html”,
“typeVersion”: 1.2,
“position”: [
540,
-100
],
“id”: “97844bc1-fed0-4103-aa48-51406a17badb”,
“name”: “Extract Website Content”
}
],
“pinData”: {},
“connections”: {
“Ollama Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “English blog writer”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Postgres Chat Memory”: {
“ai_memory”: [
[
{
“node”: “English blog writer”,
“type”: “ai_memory”,
“index”: 0
}
]
]
},
“Ollama Chat Model1”: {
“ai_languageModel”: [
[
{
“node”: “Arabic Blog writer”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“English blog writer”: {
“main”: [
[
{
“node”: “Arabic Blog writer”,
“type”: “main”,
“index”: 0
}
]
]
},
“When chat message received”: {
“main”: [
[
{
“node”: “Website URL Storage”,
“type”: “main”,
“index”: 0
}
]
]
},
“Arabic Blog writer”: {
“main”: [
[
{
“node”: “Wordpress”,
“type”: “main”,
“index”: 0
}
]
]
},
“Website URL Storage”: {
“main”: [
[
{
“node”: “Process Each Website”,
“type”: “main”,
“index”: 0
}
]
]
},
“Fetch Website Content”: {
“main”: [
[
{
“node”: “Extract Website Content”,
“type”: “main”,
“index”: 0
}
]
]
},
“Process Each Website”: {
“main”: [
[
{
“node”: “Fetch Website Content”,
“type”: “main”,
“index”: 0
}
],
]
},
“Extract Website Content”: {
“main”: [
[
{
“node”: “English blog writer”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“active”: false,
“settings”: {
“executionOrder”: “v1”
},
“versionId”: “a86a5f78-edd2-4fe9-b28e-a6164393a234”,
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “c7b9543a068b4fd0db62c19ba6292798f3a0ea3bea7a5ce2510c962a66d4ac98”
},
“id”: “AOZqw5IwncW2SbCm”,
“tags”:
}"
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system: