{
  "id": "EtfW67xHoluHiN0Q",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Automated Structured Data Extract & Summary via Decodo +Gemini & Google Sheets",
  "tags": [
    {
      "id": "Kujft2FOjmOVQAmJ",
      "name": "Engineering",
      "createdAt": "2025-04-09T01:31:00.558Z",
      "updatedAt": "2025-04-09T01:31:00.558Z"
    },
    {
      "id": "ZOwtAMLepQaGW76t",
      "name": "Building Blocks",
      "createdAt": "2025-04-13T15:23:40.462Z",
      "updatedAt": "2025-04-13T15:23:40.462Z"
    },
    {
      "id": "ddPkw7Hg5dZhQu2w",
      "name": "AI",
      "createdAt": "2025-04-13T05:38:08.053Z",
      "updatedAt": "2025-04-13T05:38:08.053Z"
    },
    {
      "id": "rKOa98eAi3IETrLu",
      "name": "HR",
      "createdAt": "2025-04-13T04:59:30.580Z",
      "updatedAt": "2025-04-13T04:59:30.580Z"
    }
  ],
  "nodes": [
    {
      "id": "6d8713c2-0e66-4756-abe9-34e524e8525e",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -800,
        -64
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "86b4415c-47ca-41f9-96ef-5099598c6ec1",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        112
      ],
      "parameters": {
        "width": 496,
        "height": 352,
        "content": "## Purpose\n\nAutomatically extract, parse, and analyze the generic URL to generate structured data with summaries and insights.\n\n### Flow Summary:\n\n- Input: A valid URL.\n\n- Decodo: Performs Web Scraping of URL\n\n- Google Gemini: Enriches and summarizes data.\n\n- Output: Structured JSON or formatted data"
      },
      "typeVersion": 1
    },
    {
      "id": "e364f62e-f4c8-4019-b836-d7cc16a527c5",
      "name": "Decodo",
      "type": "@decodo/n8n-nodes-decodo.decodo",
      "position": [
        -304,
        -64
      ],
      "parameters": {
        "geo": "=",
        "url": "={{ $json.url }}",
        "headless": false,
        "markdown": true
      },
      "credentials": {
        "decodoApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1
    },
    {
      "id": "85c7bfee-1c77-4f89-8a60-da47b078333d",
      "name": "Set the Input Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -544,
        -64
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "01a2dade-6674-4158-8303-97a1151d3965",
              "name": "url",
              "type": "string",
              "value": "https://docs.langchain.com/YOUR_AWS_SECRET_KEY_HERE"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "732cf8f7-a8a3-4af8-92a3-109b417006e7",
      "name": "Structured Data Extractor",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        80,
        -224
      ],
      "parameters": {
        "text": "=Parse and Extract the following content {{ $json.results[0].content }}  in JSON Schema",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "You are an expert data extractor and parser"
            }
          ]
        },
        "promptType": "define"
      },
      "retryOnFail": true,
      "typeVersion": 1.7,
      "alwaysOutputData": true
    },
    {
      "id": "34b314e7-69b3-424e-86b0-c71cf0cb7047",
      "name": "Extract the JSON",
      "type": "n8n-nodes-base.code",
      "position": [
        528,
        -224
      ],
      "parameters": {
        "jsCode": "let text =  $input.first().json.text;\nconst output = [];\n\n// Remove ```json ... ``` or ``` ... ``` wrappers\ntext = text\n      .replace(/```json\\s*/gi, '')\n      .replace(/```/g, '')\n      .trim();\n\n// Parse the cleaned JSON text\nconst parsed = JSON.parse(text);\noutput.push({ json: parsed });\n\nreturn output;"
      },
      "typeVersion": 2
    },
    {
      "id": "ebac4b62-a1e5-4975-9845-b09a9e3875b4",
      "name": "Summarize Content",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        80,
        112
      ],
      "parameters": {
        "text": "=Analyze and Summarize the {{ $json.data.results[0].content }}\n\nDo not output your own thoughts or suggestions or recommendations. Instead, just output the summary.",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "You are an expert summarizer"
            }
          ]
        },
        "promptType": "define"
      },
      "retryOnFail": true,
      "typeVersion": 1.7,
      "alwaysOutputData": true
    },
    {
      "id": "1edbdc38-7338-4dfd-abff-c8ff16cc29e2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -304
      ],
      "parameters": {
        "color": 6,
        "width": 608,
        "height": 768,
        "content": "## Data Enrichment "
      },
      "typeVersion": 1
    },
    {
      "id": "2897de56-2543-423d-a0a7-ed376fff6032",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        736,
        0
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "d7dfb222-2eae-4b3e-b155-7830ab352487",
      "name": "Append or update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        992,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "output": "={{ $json.toJsonString() }}"
          },
          "schema": [
            {
              "id": "output",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "output",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "output"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nopL6tWWBydiGqRz4HuyTjbp4D_1to75QNGzLszUV-g/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1gtUrhuCc62et_Hvub3-Cg4b72ArOnxCp6XAloyJwNcc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gtUrhuCc62et_Hvub3-Cg4b72ArOnxCp6XAloyJwNcc/edit?usp=drivesdk",
          "cachedResultName": "Decodo Structured Data Extract"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "7ebaf945-8308-4948-a6fe-91b4945b0ee9",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -624
      ],
      "parameters": {
        "color": 3,
        "width": 608,
        "height": 288,
        "content": "## Disclaimer\n\n![Logo](https://cdn.brandfetch.io/idIeG9_eXK/w/100/h/100/theme/dark/icon.jpeg?c=1bxid64Mup7aczewSAYMX&t=1756483136894)\n\nThis workflow is only available on n8n self-hosted as it's making use of the community node for the Decodo Web Scraping"
      },
      "typeVersion": 1
    },
    {
      "id": "55e0f5ac-68ce-449a-a7a5-a4f6d5c89018",
      "name": "Google Gemini Chat Model for Summary",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        80,
        288
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash-exp"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3497bf32-4417-4ef5-91c0-16d061251b3f",
      "name": "Google Gemini Chat Model for Structured Data",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        80,
        -48
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash-exp"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "bfc9bc64-6e41-4b17-9fb9-b43d72cff22c",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decodo": {
      "main": [
        [
          {
            "node": "Structured Data Extractor",
            "type": "main",
            "index": 0
          },
          {
            "node": "Summarize Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract the JSON": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Content": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Set the Input Fields": {
      "main": [
        [
          {
            "node": "Decodo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Data Extractor": {
      "main": [
        [
          {
            "node": "Extract the JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet": {
      "main": [
        []
      ]
    },
    "Google Gemini Chat Model for Summary": {
      "ai_languageModel": [
        [
          {
            "node": "Summarize Content",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Set the Input Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model for Structured Data": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Data Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}