{
  "name": "My workflow 14",
  "nodes": [
    {
      "parameters": {
        "content": "# \ud83d\udcda [Join our Skool community for support, premium content and more!](https://www.skool.com/ai-agents-az/about?w5)\n\n## Be part of a growing community and help us create more content like this",
        "height": 220,
        "width": 860,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        7400,
        560
      ],
      "id": "44f740f1-7849-4d41-bf55-57bb89ad4c08",
      "name": "Sticky Note6"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        7480,
        1440
      ],
      "id": "e792910d-0abd-4ede-b692-d018552286b7",
      "name": "When clicking \u2018Test workflow\u2019"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=I'm working on an article with the following topic:\n\n<TopicTitle>\n{{ $('Come up with a topic1').item.json.output.title }}\n</TopicTitle>\n\n<TopicSummary>\n{{ $('Come up with a topic1').item.json.output.summary }}\n</TopicSummary>\n\nOriginal articles we used as an inspiration to come up with the topic\n\n<InpirationArticles>\n{{ $('Come up with a topic1').item.json.output.inspirations.map(item => `<Article>\\n${item.article}\\n</Article>`).join('\\n') }}\n</InpirationArticles>\n\n\nI did a research on google and came up with the results below. Each article is the markdown content of the HTML body.\n\n<OnlineResearch>\n{{  $json.research_results.map(item => `<Article>\\n${item.summary}\\n</Article>`).join('\\n') }}\n</OnlineResearch>\n\nWrite an detailed, long, engaging article on the subject, make sure to structure the article well, breaking the long text with lists, using bold, etc..",
        "hasOutputParser": true
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.5,
      "position": [
        11440,
        1440
      ],
      "id": "9d7bc9cb-66e6-4506-ba3d-140f38e14de4",
      "name": "Basic LLM Chain3"
    },
    {
      "parameters": {
        "content": "# 4. Write and post the article\n\n## After creating the article, you could other LLM chains or agents to add\n- SEO keywords\n- Add personality by rewriting the content in your style\n- Adding interlinks\n- Add sources",
        "height": 240,
        "width": 860
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        11440,
        1160
      ],
      "id": "b4094562-03f1-47fc-a40e-b5fede4f5d1f",
      "name": "Sticky Note5",
      "disabled": true
    },
    {
      "parameters": {
        "title": "={{ $json.output.title }}",
        "additionalFields": {
          "content": "={{ $json.content_html }}",
          "status": "publish"
        }
      },
      "type": "n8n-nodes-base.wordpress",
      "typeVersion": 1,
      "position": [
        12120,
        1440
      ],
      "id": "54bbcc1d-4cb5-4b1a-8c8b-7acf9c5a6139",
      "name": "Wordpress",
      "credentials": {
        "wordpressApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n    \"type\": \"object\",\n    \"properties\": {\n        \"title\": {\n            \"type\": \"string\",\n            \"description\": \"the title of the article\"\n        },\n        \"content\": {\n            \"type\": \"string\",\n            \"description\": \"the content of the article\"\n        }\n    },\n    \"required\": [\n        \"title\",\n        \"content\"\n    ]\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.2,
      "position": [
        11700,
        1700
      ],
      "id": "39f365f4-755e-47b0-8e74-60e5acc494de",
      "name": "Structured Output Parser3"
    },
    {
      "parameters": {
        "mode": "markdownToHtml",
        "markdown": "={{ $json.output.content }}",
        "destinationKey": "content_html",
        "options": {}
      },
      "type": "n8n-nodes-base.markdown",
      "typeVersion": 1,
      "position": [
        11900,
        1440
      ],
      "id": "f2bf30a7-5d84-49cf-807b-73f156195a47",
      "name": "Markdown"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        10280,
        2180
      ],
      "id": "61f91620-db0d-4e86-9514-aa1556bcfef7",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "fieldToSplitOut": "bookmarks",
        "options": {
          "destinationFieldName": "bookmark"
        }
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        8260,
        1440
      ],
      "id": "42ab8e69-f335-4366-af5b-e7008ab61fab",
      "name": "Split Out"
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "bookmarks",
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        8700,
        1440
      ],
      "id": "d88487f8-565e-41de-98f7-aa7e8031ff54",
      "name": "Aggregate"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n    \"type\": \"object\",\n    \"properties\": {\n        \"ai_bookmarks\": {\n            \"type\": \"array\",\n            \"description\": \"user name\",\n            \"items\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"title\": {\n                        \"type\": \"string\"\n                    },\n                    \"link\": {\n                        \"type\": \"string\"\n                    }\n                },\n                \"required\": [\n                    \"title\",\n                    \"link\"\n                ]\n            }\n        }\n    },\n    \"required\": [\n        \"ai_bookmarks\"\n    ]\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.2,
      "position": [
        9440,
        1700
      ],
      "id": "de812263-2794-492b-b793-7655fec7ca59",
      "name": "Structured Output Parser2"
    },
    {
      "parameters": {
        "url": "https://pinboard.in/popular/",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        7780,
        1440
      ],
      "id": "6b28714b-f206-4e5a-ac91-4ae400bf1be7",
      "name": "Get popular bookmarks"
    },
    {
      "parameters": {
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "bookmarks",
              "cssSelector": ".display",
              "returnValue": "html",
              "returnArray": true
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.html",
      "typeVersion": 1.2,
      "position": [
        8040,
        1440
      ],
      "id": "f905febc-df2b-4b63-a04b-d0a85e7b9f41",
      "name": "Extract bookmarks"
    },
    {
      "parameters": {
        "operation": "extractHtmlContent",
        "dataPropertyName": "bookmark",
        "extractionValues": {
          "values": [
            {
              "key": "link",
              "cssSelector": ".bookmark_title",
              "returnValue": "attribute",
              "attribute": "href"
            },
            {
              "key": "title",
              "cssSelector": ".bookmark_title"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.html",
      "typeVersion": 1.2,
      "position": [
        8480,
        1440
      ],
      "id": "1b19927b-9cca-4dd0-9733-610e9f3c5a46",
      "name": "Extract bookmark"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Your job is to find an interesting topic to create an article about in the AI subject. The audience is \"AI enthusiasts\".\n\nYou are presented with popular articles (title and content). Please create an idea for an article that my AI enthusiastic audience will love. They are mostly knowledge workers, managers, leaders.\n\nThe thought process you should follow:\n1. Review all the articles from below\n2. Find the most interesting one for my audience. You can combine multiple articles if it makes sense.\n3. Return the articles used for inspiration by copying them over without changing the content.\n\n<Articles>\n{{ $('Aggregate3').item.json.articles.map(item => `<Article>\\n<Title>\\n${item.title}\\n</Title>\\n<Link>\\n${item.link}\\n<\\Link>\\n<Content>\\n${item.article}\\n</Content>\\n</Article>`).join('\\n') }}\n</Articles>",
        "hasOutputParser": true
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.5,
      "position": [
        10580,
        1440
      ],
      "id": "d13ec8ec-ce16-413e-a458-25d20317d481",
      "name": "Come up with a topic1",
      "retryOnFail": true
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=<Instruction>\nYour job is to find AI related bookmarks that I can use as inspiration to write an article for my audience - mostly managers and leaders. Make sure you only pick bookmarks that are suitable for them.\n</Instruction>\n\n<ThoughtProcess>\nThe thought process you should follow:\n1. Review all the articles from below\n2. Find the ones that are AI related and relevant for my audience\n3. Return the title and the link of each AI related bookmarks\n</ThoughtProcess>\n\n<Bookmarks>\n{{ $json.bookmarks.map(bookmark => `<Bookmark>\\n<Title>${bookmark.title}</Title>\\n<Link>${bookmark.link}</Link>\\n</Bookmark>`).join('\\n') }}\n</Bookmarks>",
        "hasOutputParser": true
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.5,
      "position": [
        9160,
        1440
      ],
      "id": "6e96cd4d-9672-4f09-bb2a-1701cc99c6a5",
      "name": "Find trending AI bookmarks",
      "retryOnFail": true
    },
    {
      "parameters": {
        "fieldToSplitOut": "output.ai_bookmarks",
        "options": {
          "destinationFieldName": "bookmark"
        }
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        9500,
        1440
      ],
      "id": "892eef5f-8ceb-4520-a3ab-4ffc509ece81",
      "name": "Split Out3"
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "articles",
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        10120,
        1440
      ],
      "id": "155c67d1-943c-4126-af55-58d0983fd3bf",
      "name": "Aggregate3"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "d7b5f308-b2e9-49f7-b9bd-4d339d96d0ee",
              "name": "article",
              "value": "={{ $json.data }}",
              "type": "string"
            },
            {
              "id": "2cf35a52-6c39-4109-a5b2-3ae3e45fdde3",
              "name": "title",
              "value": "={{ $('Split Out3').item.json.bookmark.title }}",
              "type": "string"
            },
            {
              "id": "41c86ac7-6301-47a8-881d-9402f76e1a06",
              "name": "link",
              "value": "={{ $('Split Out3').item.json.bookmark.link }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        9920,
        1440
      ],
      "id": "5d4791d9-3d4a-4301-b60a-c7370f2d5592",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n    \"type\": \"object\",\n    \"properties\": {\n        \"title\": {\n            \"type\": \"string\"\n        },\n        \"summary\": {\n            \"type\": \"string\"\n        },\n        \"inspirations\": {\n            \"type\": \"array\",\n            \"description\": \"inspirations used to create the concept for the article\",\n            \"items\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"title\": {\n                        \"type\": \"string\",\n                        \"description\": \"the title of the inspiration\"\n                    },\n                    \"link\": {\n                        \"type\": \"string\",\n                        \"description\": \"the link of the inspiration\"\n                    },\n                    \"article\": {\n                        \"type\": \"string\",\n                        \"description\": \"the content of the inspiration\"\n                    }\n                },\n                \"required\": [\n                    \"title\",\n                    \"link\",\n                    \"article\"\n                ]\n            }\n        }\n    },\n    \"required\": [\n        \"inspirations\",\n        \"title\",\n        \"summary\"\n    ]\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.2,
      "position": [
        10680,
        1720
      ],
      "id": "5bd6d308-42e8-49c1-b413-a21fa733479b",
      "name": "Structured Output Parser1"
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "0HtQ72bNs1lx7LHj",
          "mode": "list",
          "cachedResultName": "Scrape link subworkflow"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {
            "link": "={{ $json.bookmark.link }}"
          },
          "matchingColumns": [
            "link"
          ],
          "schema": [
            {
              "id": "link",
              "displayName": "link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true,
              "type": "string",
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        },
        "options": {}
      },
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.2,
      "position": [
        9720,
        1440
      ],
      "id": "16ca64f9-1b83-414d-bc0e-a227278d1bcb",
      "name": "Scrape and summarize bookmarks"
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "oSdtjLRztYX86nWY",
          "mode": "list",
          "cachedResultName": "Deep research subworkflow"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {
            "top_results": 3,
            "num_search_terms": 2,
            "context": "=<Instructions>\nI'd like to create an article. I already got inspirations from other articles, and came up with a title and a summary. Find the data below.\n\nI want to run a research on Google on the subject to collect even more data/inspiration. Help me to come up with search terms I can use.\nI need 4 search terms. Make sure to be creative, and give me different ones so I can get diverse search results.\n</Instructions>\n\n<Title>\n{{ $json.output.title }}\n</Title>\n\n<Summary>\n{{ $json.output.summary }}\n</Summary>\n\n<Inspirations>\n{{ $json.output.inspirations.map(item => `<Inspiration>\\n${item.article}\\n</Inspiration>`).join('\\n') }}\n</Inspirations>"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "top_results",
              "displayName": "top_results",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true,
              "type": "number"
            },
            {
              "id": "context",
              "displayName": "context",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true,
              "type": "string"
            },
            {
              "id": "num_search_terms",
              "displayName": "num_search_terms",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "canBeUsedToMatch": true,
              "type": "number"
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        },
        "options": {}
      },
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1.2,
      "position": [
        10920,
        1440
      ],
      "id": "99d58229-a7d5-47a6-a202-31909d7ed7b5",
      "name": "Run deep research"
    },
    {
      "parameters": {
        "content": "# 1. Gather bookmarks",
        "height": 80,
        "width": 760
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        8040,
        1320
      ],
      "id": "90cc25ac-d580-4e29-a15f-4a66ebbdd936",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "# 2. Pick the related bookmarks",
        "height": 80,
        "width": 1060
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        9160,
        1320
      ],
      "id": "1e457227-47a7-489c-af94-157541dacb4a",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "# 3. Create topic, deep research",
        "height": 80,
        "width": 560
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        10580,
        1320
      ],
      "id": "aa95b63c-b00d-4fc5-9a7a-7c6463a05fc7",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "# I recommend you to add some kind of persistency so you won't use the same bookmarks twice",
        "height": 680,
        "width": 300,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        7680,
        980
      ],
      "id": "36eeeac5-19d7-4f7b-81ab-811e3e54346c",
      "name": "Sticky Note7"
    }
  ],
  "connections": {
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Get popular bookmarks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain3": {
      "main": [
        [
          {
            "node": "Markdown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser3": {
      "ai_outputParser": [
        [
          {
            "node": "Basic LLM Chain3",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Markdown": {
      "main": [
        [
          {
            "node": "Wordpress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain3",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Find trending AI bookmarks",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Come up with a topic1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Extract bookmark",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Find trending AI bookmarks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser2": {
      "ai_outputParser": [
        [
          {
            "node": "Find trending AI bookmarks",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Get popular bookmarks": {
      "main": [
        [
          {
            "node": "Extract bookmarks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract bookmarks": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract bookmark": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find trending AI bookmarks": {
      "main": [
        [
          {
            "node": "Split Out3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out3": {
      "main": [
        [
          {
            "node": "Scrape and summarize bookmarks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate3": {
      "main": [
        [
          {
            "node": "Come up with a topic1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Aggregate3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Come up with a topic1",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Come up with a topic1": {
      "main": [
        [
          {
            "node": "Run deep research",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape and summarize bookmarks": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run deep research": {
      "main": [
        [
          {
            "node": "Basic LLM Chain3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e50ee71f-9787-4aba-9a3f-28295ac93b96",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "ucEHSGg73IPzhX1n",
  "tags": []
}