Extracción de datos estructurados de Dun & Bradstreet (GPT-4o)

Intermedio

Este es unContent Creation, Multimodal AIflujo de automatización del dominio deautomatización que contiene 11 nodos.Utiliza principalmente nodos como HttpRequest, ConvertToFile, Agent, ExtractFromFile, LmChatOpenAi. Usar GPT-4o para extraer datos estructurados de informes de Dun & Bradstreet

Requisitos previos
  • Pueden requerirse credenciales de autenticación para la API de destino
  • Clave de API de OpenAI
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
{
  "meta": {
    "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "c0768748-9099-4bb4-8d23-d4ceb1c404b7",
      "name": "Nota adhesiva10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1872,
        8464
      ],
      "parameters": {
        "width": 400,
        "height": 1312,
        "content": "## Setup Instructions\n\n\n### 🏢 Fetch Company Data from D&B (Data Blocks)\n\n1. Add a new **HTTP Request** node and name it `Data Blocks`  \n2. Configure it as follows:  \n   - **Authentication:** None (token is passed in headers)  \n   - **Method:** `GET`  \n   - **URL:**  \n     ```\n     https://plus.dnb.com/v1/data/duns/{{ $json.duns }}?blockIDs=paymentinsight_L4_v1&tradeUp=hq&customerReference=customer%20reference%20text&orderReason=6332\n     ```  \n     > This dynamically uses the `duns` value from input JSON.  \n3. Under **Headers**, add:  \n   - `Accept = application/json`  \n   - `Authorization = Bearer {{$json[\"access_token\"]}}`  \n     > Replace the hardcoded token with the dynamic token output from your **Get Bearer Token** node.  \n4. Execute the node — you’ll receive structured company data from D&B’s **Data Blocks API**.  \n\n✅ You can now pass the response to other nodes (e.g., Google Sheets, databases, or CRMs).  \n\n\n---\n\n### 🔑 Set up D&B Auth HTTP Request node\n\n1. Add a new **HTTP Request** node in your workflow  \n2. Configure it as follows:  \n   - **Authentication:** Basic Auth (use your D&B **username** and **password**)  \n   - **Method:** `POST`  \n   - **URL:** `https://plus.dnb.com/v3/token`  \n3. Under **Body Parameters**, add:  \n   - `grant_type = client_credentials`  \n4. Under **Headers**, add:  \n   - `Accept = application/json`  \n5. Execute the node — the response will include an **access_token**  \n6. Use this token in downstream requests with:  \n   - `Authorization: Bearer {{$json[\"access_token\"]}}`  \n\n\n## 📬 Contact\n\nNeed help customizing this (e.g., routing the PDF to Drive, mapping JSON to your CRM, or expanding the schema)?\n\n📧 robert@ynteractive.com  \n🔗 https://www.linkedin.com/in/robert-breen-29429625/  \n🌐 https://ynteractive.com"
      },
      "typeVersion": 1
    },
    {
      "id": "0bb07b06-7c44-47d7-b634-0b671bbd4f05",
      "name": "Modelo de chat OpenAI6",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        128,
        9216
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "4l6TDfLZVFS24g3X",
          "name": "OpenAi account 4"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0dc8ad32-c434-4c56-9f97-8d6caf59a26f",
      "name": "Modelo de chat OpenAI7",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        384,
        9312
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "4l6TDfLZVFS24g3X",
          "name": "OpenAi account 4"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2a704e6a-4996-488b-831e-b757270b6518",
      "name": "Nota adhesiva65",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        8864
      ],
      "parameters": {
        "color": 3,
        "width": 352,
        "height": 768,
        "content": "### 🏢 Fetch Company Data from D&B (Data Blocks)\n\n1. Add a new **HTTP Request** node and name it `Data Blocks`  \n2. Configure it as follows:  \n   - **Authentication:** None (token is passed in headers)  \n   - **Method:** `GET`  \n   - **URL:**  \n     ```\n     https://plus.dnb.com/v1/data/duns/{{ $json.duns }}?blockIDs=paymentinsight_L4_v1&tradeUp=hq&customerReference=customer%20reference%20text&orderReason=6332\n     ```  \n     > This dynamically uses the `duns` value from input JSON.  \n3. Under **Headers**, add:  \n   - `Accept = application/json`  \n   - `Authorization = Bearer {{$json[\"access_token\"]}}`  \n     > Replace the hardcoded token with the dynamic token output from your **Get Bearer Token** node.  \n4. Execute the node — you’ll receive structured company data from D&B’s **Data Blocks API**.  \n\n✅ You can now pass the response to other nodes (e.g., Google Sheets, databases, or CRMs).  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "a08d013f-f02c-4d97-b8a8-b39892f8f23d",
      "name": "Nota adhesiva66",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -544,
        8640
      ],
      "parameters": {
        "color": 3,
        "width": 368,
        "height": 560,
        "content": "### 🔑 Set up D&B Auth HTTP Request node\n\n1. Add a new **HTTP Request** node in your workflow  \n2. Configure it as follows:  \n   - **Authentication:** Basic Auth (use your D&B **username** and **password**)  \n   - **Method:** `POST`  \n   - **URL:** `https://plus.dnb.com/v3/token`  \n3. Under **Body Parameters**, add:  \n   - `grant_type = client_credentials`  \n4. Under **Headers**, add:  \n   - `Accept = application/json`  \n5. Execute the node — the response will include an **access_token**  \n6. Use this token in downstream requests with:  \n   - `Authorization: Bearer {{$json[\"access_token\"]}}`  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "565c3c60-61e4-4b82-81ae-d532377a2c80",
      "name": "D&B Report",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -976,
        9520
      ],
      "parameters": {
        "url": "https://plus.dnb.com/v1/reports/duns/804735132?productId=birstd&inLanguage=en-US&reportFormat=PDF&orderReason=6332&tradeUp=hq&customerReference=customer%20reference%20text",
        "options": {},
        "authentication": "headerAuth",
        "headerParametersUi": {
          "parameter": [
            {
              "name": "Accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {},
      "typeVersion": 1
    },
    {
      "id": "e6d764bd-3b2d-40d3-949e-8aa39c220668",
      "name": "Convert to PDF File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -544,
        9392
      ],
      "parameters": {
        "options": {},
        "operation": "toBinary",
        "sourceProperty": "contents[0].contentObject"
      },
      "typeVersion": 1.1
    },
    {
      "id": "eaf944cd-eda8-4b39-80c5-66378e92dddc",
      "name": "Extract Binary",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -208,
        9392
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "7c82577c-cb5f-47df-9f29-7646107276e8",
      "name": "Analyze PDF",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        224,
        8848
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "You are a precision extractor. Read the provided business report PDF and return only a single flat JSON object with the fields below. Keep it minimal and focused on overall scores.\n\nNo arrays/lists.\n\nNo prose.\n\nIf a value is missing, output null.\n\nDates must be YYYY-MM-DD.\n\nNumbers must be plain numerics (no commas or $).\n\nOutput Format\n\nReturn only in JSON object:\n\n\nRules\n\nPrefer the most recent or highest-level “overall” values if multiple are shown.\n\nNever include arrays, nested structures, or text outside of the JSON object.",
          "passthroughBinaryImages": true
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "0bf7ddc4-910a-4c15-8265-c959ddf16e7a",
      "name": "Structured Output",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        368,
        9120
      ],
      "parameters": {
        "autoFix": true,
        "jsonSchemaExample": "{\n  \"report_date\": \"\",\n  \"company_name\": \"\",\n  \"duns\": \"\",\n  \"dnb_rating_overall\": \"\",\n  \"composite_credit_appraisal\": \"\",\n  \"viability_score\": \"\",\n  \"portfolio_comparison_score\": \"\",\n  \"paydex_3mo\": \"\",\n  \"paydex_24mo\": \"\",\n  \"credit_limit_conservative\": \"\"\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "f8126ea2-1265-45fc-adf8-2e507a23df14",
      "name": "Get Token",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -400,
        9072
      ],
      "parameters": {
        "url": "https://plus.dnb.com/v3/token",
        "options": {},
        "requestMethod": "POST",
        "authentication": "basicAuth",
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "grant_type",
              "value": "client_credentials"
            }
          ]
        },
        "headerParametersUi": {
          "parameter": [
            {
              "name": "Content-Type",
              "value": "application/x-www-form-urlencoded"
            }
          ]
        }
      },
      "credentials": {},
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "565c3c60-61e4-4b82-81ae-d532377a2c80": {
      "main": [
        [
          {
            "node": "e6d764bd-3b2d-40d3-949e-8aa39c220668",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "eaf944cd-eda8-4b39-80c5-66378e92dddc": {
      "main": [
        [
          {
            "node": "7c82577c-cb5f-47df-9f29-7646107276e8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0bf7ddc4-910a-4c15-8265-c959ddf16e7a": {
      "ai_outputParser": [
        [
          {
            "node": "7c82577c-cb5f-47df-9f29-7646107276e8",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model6": {
      "ai_languageModel": [
        [
          {
            "node": "7c82577c-cb5f-47df-9f29-7646107276e8",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model7": {
      "ai_languageModel": [
        [
          {
            "node": "0bf7ddc4-910a-4c15-8265-c959ddf16e7a",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "e6d764bd-3b2d-40d3-949e-8aa39c220668": {
      "main": [
        [
          {
            "node": "eaf944cd-eda8-4b39-80c5-66378e92dddc",
            "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?

Intermedio - Creación de contenido, IA Multimodal

¿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.

Flujos de trabajo relacionados recomendados

Información del flujo de trabajo
Nivel de dificultad
Intermedio
Número de nodos11
Categoría2
Tipos de nodos7
Descripción de la dificultad

Adecuado para usuarios con experiencia intermedia, flujos de trabajo de complejidad media con 6-15 nodos

Autor
Robert Breen

Robert Breen

@rbreen

Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34