Plantilla para extraer de PDFs

Avanzado

Este es unDocument Extraction, AI Summarizationflujo de automatización del dominio deautomatización que contiene 24 nodos.Utiliza principalmente nodos como Set, Code, Html, Merge, Discord. Modelo de IA Llama para seguimiento en Google Sheets

Requisitos previos
  • Bot Token de Discord o Webhook
  • Pueden requerirse credenciales de autenticación para la API de destino
  • Credenciales de API de Google Sheets
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "id": "7W7d0YwVNAq2e1ia",
  "meta": {
    "instanceId": "3cc1878486c4b89b99f849786349de8096d559c2a7d28662583b888d19dabd2f"
  },
  "name": "Template to extract PDFs",
  "tags": [],
  "nodes": [
    {
      "id": "e8790514-92e0-4f1f-bf17-94833512d86e",
      "name": "Al hacer clic en 'Ejecutar flujo de trabajo'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -400,
        -96
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8dea3c26-0cb2-4607-8135-d45963200c6a",
      "name": "Solicitud HTTP",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -192,
        -240
      ],
      "parameters": {
        "url": "PUT THE URL OF THE WEBSITE YOU WANT TO EXTRACT PDFS FROM",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "aacd88bc-e89b-47fc-af70-7c85f5e6c4f8",
      "name": "HTML",
      "type": "n8n-nodes-base.html",
      "position": [
        -48,
        -96
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "pdf",
              "attribute": "href",
              "cssSelector": "a[href$=\".pdf\"]",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "tittle",
              "cssSelector": "a[href$=\".pdf\"]",
              "returnArray": true
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "963ff0ab-af77-4e66-8339-11b7d105c318",
      "name": "Código",
      "type": "n8n-nodes-base.code",
      "notes": "Lista los pdfs",
      "position": [
        96,
        -96
      ],
      "parameters": {
        "jsCode": "const baseUrl = \"https://www.playway.com\";\n\nreturn $input.first().json.pdf.map(link => {\n  return {\n    json: {\n      url: `${baseUrl}${link}`\n    }\n  };\n});"
      },
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "e305771c-6ad1-43ea-a8c1-61ba61be5df7",
      "name": "Solicitud HTTP1",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        -416,
        208
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {
          "response": {
            "response": {
              "neverError": true,
              "responseFormat": "file"
            }
          }
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "1306f74c-cf7a-4f4b-897a-abc15281eac2",
      "name": "Extraer de archivo",
      "type": "n8n-nodes-base.extractFromFile",
      "onError": "continueRegularOutput",
      "position": [
        -176,
        208
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "ddaba8bb-676b-4c1e-9986-47b55503520d",
      "name": "Disparador programado",
      "type": "n8n-nodes-base.scheduleTrigger",
      "notes": "Ejecución semanal",
      "position": [
        -400,
        -288
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 1.2
    },
    {
      "id": "f56b233d-f303-4845-be9e-7cde10110f87",
      "name": "Discord",
      "type": "n8n-nodes-base.discord",
      "position": [
        1024,
        144
      ],
      "webhookId": "b30b5012-4bb4-4a31-a291-f7490b21e4f6",
      "parameters": {
        "content": "={{ $json.message }}",
        "options": {},
        "authentication": "webhook"
      },
      "typeVersion": 2
    },
    {
      "id": "4c946a75-11bd-4c5e-9e29-9b95b56b342b",
      "name": "Obtener fila(s) en hoja",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        336,
        -80
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1eJVTi79GRuz05MRn55KsQGKnn9R3yX8BBH212POrcKA",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1eJVTi79GRuz05MRn55KsQGKnn9R3yX8BBH212POrcKA/edit?usp=drivesdk",
          "cachedResultName": "PlayWay_BabelBots"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.6,
      "alwaysOutputData": true
    },
    {
      "id": "792b65d0-3e97-44d2-994b-7ddbb765c9dd",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -464,
        592
      ],
      "parameters": {
        "model": "meta-llama/llama-4-maverick",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "377311e1-ee99-48a9-8b23-fc9b09b4abbf",
      "name": "Agente IA",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        32,
        208
      ],
      "parameters": {
        "text": "=Analyze the following company report and provide an executive summary in English, highlighting:\n\n* Key financial information (if available)\n* Relevant actions announced by the company\n* Changes in the board of directors or other important decisions\n* Any potential impact for investors\n\nReport text:\n{{ \\$json.text }}\n",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "73691e8d-3eb0-4918-8f57-e42ffda2ff1e",
      "name": "Simple Memoria",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        144,
        432
      ],
      "parameters": {
        "sessionKey": "playway-agent",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "f6a43984-cc3f-4a02-aadc-575ba322778f",
      "name": "Nota adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        160
      ],
      "parameters": {
        "color": 3,
        "width": 768,
        "height": 400,
        "content": "This is the AI process — go in and change the prompt to your liking.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "1928302e-8082-4d28-a553-4a7bb295547e",
      "name": "Editar campos1",
      "type": "n8n-nodes-base.set",
      "position": [
        656,
        496
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "657129da-9b3f-43c2-ac71-a41799949ff1",
              "name": "url",
              "type": "string",
              "value": "={{ $('HTTP Request1').item.json.url }}"
            },
            {
              "id": "a3583044-d67b-4576-a9b9-b87181ce34c1",
              "name": "enviado_discord",
              "type": "string",
              "value": "true"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bfd92648-dc17-4dec-b1a0-089b949b990e",
      "name": "Actualizar fila en hoja",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        864,
        496
      ],
      "parameters": {
        "columns": {
          "value": {
            "url": "={{ $json.url }}",
            "enviado_discord": "={{ $json.enviado_discord }}"
          },
          "schema": [
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "enviado_discord",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "enviado_discord",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "url"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1eJVTi79GRuz05MRn55KsQGKnn9R3yX8BBH212POrcKA/edit#gid=0",
          "cachedResultName": "PDFs"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1eJVTi79GRuz05MRn55KsQGKnn9R3yX8BBH212POrcKA",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1eJVTi79GRuz05MRn55KsQGKnn9R3yX8BBH212POrcKA/edit?usp=drivesdk",
          "cachedResultName": "PlayWay_BabelBots"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "2996662d-4710-4340-96d0-3f6272a756ea",
      "name": "Anexar o actualizar fila en hoja",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        672,
        -80
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "enviado_discord",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "enviado_discord",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "url"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1eJVTi79GRuz05MRn55KsQGKnn9R3yX8BBH212POrcKA/edit#gid=0",
          "cachedResultName": "PDFs"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1eJVTi79GRuz05MRn55KsQGKnn9R3yX8BBH212POrcKA",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1eJVTi79GRuz05MRn55KsQGKnn9R3yX8BBH212POrcKA/edit?usp=drivesdk",
          "cachedResultName": "PlayWay_BabelBots"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "3bf5e883-58dc-4035-b0fd-a87a00702da8",
      "name": "Combinar",
      "type": "n8n-nodes-base.merge",
      "position": [
        512,
        -128
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "joinMode": "keepNonMatches",
        "fieldsToMatchString": "url"
      },
      "typeVersion": 3.2
    },
    {
      "id": "570fdfd2-e438-4b5c-86d2-e0729389b653",
      "name": "Filtro caracteres max",
      "type": "n8n-nodes-base.code",
      "position": [
        416,
        192
      ],
      "parameters": {
        "jsCode": "const input = $input.all();\nconst chunkSize = 1900;\nconst result = [];\n\nfor (const item of input) {\n  const text = item.json.output;\n  for (let i = 0; i < text.length; i += chunkSize) {\n    result.push({\n      json: {\n        message: text.slice(i, i + chunkSize)\n      }\n    });\n  }\n}\n\nreturn result;\n\n"
      },
      "typeVersion": 2
    },
    {
      "id": "23a4e1dc-5535-43a9-8f5e-0e4e7f757044",
      "name": "Nota adhesiva1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -704,
        -400
      ],
      "parameters": {
        "width": 432,
        "height": 448,
        "content": "## Start\n\nThese blocks trigger the flow — one is manual, and one is scheduled. Open them and set the frequency you want.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "807096dc-8460-4ce2-80e8-d08ce64e4141",
      "name": "Nota adhesiva2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        -368
      ],
      "parameters": {
        "color": 2,
        "width": 480,
        "height": 432,
        "content": "## Website Access and PDF Search\n\nOpen the first node that connects to the website and set it to the one you want.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "2eac5cae-923f-49c3-8897-ffc22801c882",
      "name": "Nota adhesiva3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        -272
      ],
      "parameters": {
        "width": 496,
        "height": 336,
        "content": "## Google Connection\n\nHere you need to connect to the Google Cloud API: [https://cloud.google.com/](https://cloud.google.com/) and enable both Drive and Sheets.\nThen, create a sheet in Drive — this will be the one you use.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b03fe146-3fce-464e-9f91-5edff8c9b769",
      "name": "Nota adhesiva4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        384
      ],
      "parameters": {
        "color": 6,
        "width": 320,
        "height": 368,
        "content": "## Model Connection\nHere you need to register on OpenRouter and enter the API key. You can choose any model you like, as long as it’s free.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "446111cd-3794-4812-a379-9b69ea2ebf85",
      "name": "Nota adhesiva5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        368
      ],
      "parameters": {
        "color": 4,
        "width": 448,
        "height": 288,
        "content": "## Marking the Registered URLs\n\nWith this, I simply receive which URLs I’ve downloaded the PDF from, and we mark them in the Google Sheet we created.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "511215dc-2ba6-4e62-a622-565e765d4244",
      "name": "Nota adhesiva6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        16
      ],
      "parameters": {
        "color": 4,
        "width": 448,
        "height": 288,
        "content": "## Sending to Discord\n\nIn a private Discord server, create a channel. In the channel settings, create an integration via webhook and paste it here.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b3ef412b-aeec-4a6e-89e3-f03acdc1e845",
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "4c946a75-11bd-4c5e-9e29-9b95b56b342b",
            "type": "main",
            "index": 0
          },
          {
            "node": "3bf5e883-58dc-4035-b0fd-a87a00702da8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "aacd88bc-e89b-47fc-af70-7c85f5e6c4f8": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3bf5e883-58dc-4035-b0fd-a87a00702da8": {
      "main": [
        [
          {
            "node": "2996662d-4710-4340-96d0-3f6272a756ea",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "570fdfd2-e438-4b5c-86d2-e0729389b653",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1928302e-8082-4d28-a553-4a7bb295547e": {
      "main": [
        [
          {
            "node": "bfd92648-dc17-4dec-b1a0-089b949b990e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "aacd88bc-e89b-47fc-af70-7c85f5e6c4f8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "1306f74c-cf7a-4f4b-897a-abc15281eac2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "ddaba8bb-676b-4c1e-9986-47b55503520d": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1306f74c-cf7a-4f4b-897a-abc15281eac2": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "1928302e-8082-4d28-a553-4a7bb295547e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4c946a75-11bd-4c5e-9e29-9b95b56b342b": {
      "main": [
        [
          {
            "node": "3bf5e883-58dc-4035-b0fd-a87a00702da8",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "570fdfd2-e438-4b5c-86d2-e0729389b653": {
      "main": [
        [
          {
            "node": "f56b233d-f303-4845-be9e-7cde10110f87",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "792b65d0-3e97-44d2-994b-7ddbb765c9dd": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "2996662d-4710-4340-96d0-3f6272a756ea": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e8790514-92e0-4f1f-bf17-94833512d86e": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Avanzado - Extracción de documentos, Resumen de IA

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Avanzado
Número de nodos24
Categoría2
Tipos de nodos14
Descripción de la dificultad

Adecuado para usuarios avanzados, flujos de trabajo complejos con 16+ nodos

Autor
Cristian Baño Belchí

Cristian Baño Belchí

@babelbots

Técnico en automatización y robótica, compartiré todo tipo de automatizaciones con la comunidad hispanohablante a través de youtube.

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34