Skip to content
9.3 KB
Raw Blame
{
  "name": "My workflow 14",
  "nodes": [
    {
      "parameters": {
        "content": "# 📚 [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": [4960, 740],
      "id": "44f740f1-7849-4d41-bf55-57bb89ad4c08",
      "name": "Sticky Note6"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [6480, 1320],
      "id": "8c85a884-c71d-4032-b99e-4e9dc7325346",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "9z2BF40dqIRV3ovL",
          "name": "OpenAI"
        }
      }
    },
    {
      "parameters": {
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "data",
              "cssSelector": "body",
              "returnValue": "html"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.html",
      "typeVersion": 1.2,
      "position": [5700, 1080],
      "id": "ff97155c-8388-4b36-adea-f66dc79ec7b5",
      "name": "HTML"
    },
    {
      "parameters": {
        "html": "={{ $json.data }}",
        "options": {}
      },
      "type": "n8n-nodes-base.markdown",
      "typeVersion": 1,
      "position": [5920, 1080],
      "id": "e0dbf57f-f261-4a38-a3a0-7e4b271dd3a1",
      "name": "Markdown"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n    \"type\": \"object\",\n    \"properties\": {\n        \"summary\": {\n            \"type\": \"string\",\n            \"description\": \"the summary of the content\"\n        }\n    },\n    \"required\": [\n        \"summary\"\n    ]\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.2,
      "position": [6840, 1300],
      "id": "31de760a-2d4f-48da-b8fc-7ebb02d1dc17",
      "name": "Structured Output Parser1"
    },
    {
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "link"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [4980, 1080],
      "id": "d72715ba-2e86-4fed-8472-93733c6f8419",
      "name": "When Executed by Another Workflow"
    },
    {
      "parameters": {
        "url": "={{ $json.link }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "user-agent",
              "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [5220, 1080],
      "id": "7035b9a3-c838-4209-a33b-8df13982f379",
      "name": "get the content of the link",
      "alwaysOutputData": false,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "99cf6ac1-d77b-491c-86dc-44555032f5b0",
              "leftValue": "={{ $json.error }}",
              "rightValue": "",
              "operator": {
                "type": "object",
                "operation": "notExists",
                "singleValue": true
              }
            },
            {
              "id": "e6dd1301-acb8-4dc4-83d0-4d5b1a7f2036",
              "leftValue": "={{ $json.data }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [5460, 1080],
      "id": "3e8e7258-1f63-405c-95e9-6ee9a78775dd",
      "name": "filter out the errors"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "e70a34f7-b723-47fe-a62f-1a318c483959",
              "leftValue": "={{ $json.data }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [6140, 1080],
      "id": "9c20db8b-d300-4c18-9d26-a6c394d8d598",
      "name": "filter empty results"
    },
    {
      "parameters": {
        "jsCode": "for (const item of $input.all()) {\n  item.json.data = item.json.data.replace(/!\\[[^\\]]+\\]\\([^\\)]+\\)/g, \"\") // remove images\n  item.json.data = item.json.data.replace(/\\[.*?\\]\\(.*?\\)/g, \"\") // remove links\n  item.json.data = item.json.data.replace(/\\n{2,}/g, \"\") // remove extra new line characters\n}\n\nreturn $input.all();"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [6360, 1080],
      "id": "2a43d357-b0bb-443f-89ef-f5efe3841524",
      "name": "cleanup the markdown"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Please summarize the following content for me. Make sure to capture all the information in a concise format. Don't miss anything important.\nIgnore generic website elements like cookie policies, etc.\n\n<Content>\n{{ $json.data }}\n</Content>",
        "hasOutputParser": true
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.5,
      "position": [6580, 1080],
      "id": "6b61b922-d63d-4270-8de0-7ff8863ac5d7",
      "name": "summarize",
      "retryOnFail": true
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "53e16d12-8a90-4cf8-85e2-6aa2ef2ae3af",
              "name": "data",
              "value": "={{ $('summarize').item.json.output.summary }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [6960, 1080],
      "id": "ba1e0a81-74f8-4dfa-9a13-5b11272b20ab",
      "name": "set data field"
    }
  ],
  "pinData": {},
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "summarize",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "HTML": {
      "main": [
        [
          {
            "node": "Markdown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Markdown": {
      "main": [
        [
          {
            "node": "filter empty results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "summarize",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "get the content of the link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get the content of the link": {
      "main": [
        [
          {
            "node": "filter out the errors",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "filter out the errors": {
      "main": [
        [
          {
            "node": "HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "filter empty results": {
      "main": [
        [
          {
            "node": "cleanup the markdown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cleanup the markdown": {
      "main": [
        [
          {
            "node": "summarize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "summarize": {
      "main": [
        [
          {
            "node": "set data field",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "fbb39ad4-0234-4e49-a5a2-98965fe25683",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "636db6b6ab21a21c6458e2137f340e33dc3e49f5a1c560c8d1e2372c227cf40e"
  },
  "id": "ucEHSGg73IPzhX1n",
  "tags": []
}