AutomationFlowsData & Sheets › Enrich Google Sheets with Dun & Bradstreet Data Blocks

Enrich Google Sheets with Dun & Bradstreet Data Blocks

ByRobert Breen @rbreen on n8n.io

Automate company enrichment directly in Google Sheets using Dun & Bradstreet (D&B) Data Blocks. This workflow reads DUNS numbers from a sheet, fetches a Bearer token (via Basic Auth → ), calls the Data Blocks API for each row (), extracts Paydex, and appends or updates the…

Event trigger★★★★☆ complexity12 nodesGoogle SheetsHTTP Request
Data & Sheets Trigger: Event Nodes: 12 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #8869 — we link there as the canonical source.

This workflow follows the Google Sheets → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "1c18aaa3-e056-4739-9fe1-90c8842eebc3",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1296,
        6848
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d2723780-444a-454b-9619-14f3e4d97976",
      "name": "Sticky Note55",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        6432
      ],
      "parameters": {
        "color": 7,
        "width": 1824,
        "height": 1808,
        "content": "### Enrich DUNS rows in Google Sheets with Dun & Bradstreet Data Blocks (Bearer YOUR_TOKEN_HERE \u2192 Fetch \u2192 Upsert)\n\nAutomate company enrichment in **Google Sheets** using **Dun & Bradstreet**. This workflow reads DUNS from a sheet, gets a D&B **Bearer YOUR_TOKEN_HERE** (Basic Auth \u2192 `/v3/token`), calls **Data Blocks** (`/v1/data/duns/...`), pulls **Paydex** from the response, and **append-or-updates** the sheet. A **Filter** node skips rows already marked `Complete`.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d68788c4-a0aa-49f7-b4ad-8f01d9dc64c0",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1808,
        6432
      ],
      "parameters": {
        "width": 400,
        "height": 1792,
        "content": "## Setup Instructions\n\n### 1\ufe0f\u20e3 Connect Google Sheets (OAuth2)\n1. In **n8n \u2192 Credentials \u2192 New \u2192 Google Sheets (OAuth2)**  \n2. Sign in with your Google account and grant access  \n3. In your workflow\u2019s **Google Sheets** nodes, select this credential  \n4. Use/prepare a sheet with at least: **duns**, **paydex**, **Complete**\n\n---\n\n### 2\ufe0f\u20e3 Get a D&B Bearer YOUR_TOKEN_HERE (Basic Auth \u2192 `/v3/token`)\n1. Add (or enable) an **HTTP Request** node named `Get Bearer YOUR_TOKEN_HERE`  \n2. Configure:  \n   - **Authentication:** Basic Auth (your **D&B username** & **password**)  \n   - **Method:** `POST`  \n   - **URL:** `https://plus.dnb.com/v3/token`  \n   - **Body Parameters:** `grant_type = client_credentials`  \n   - **Headers:** `Accept = application/json`  \n3. **Execute** \u2014 the response includes `access_token` you will reference later\n\n> \u26a0\ufe0f **Security:** Don\u2019t hardcode tokens. Always fetch the token and reference it dynamically.\n\n---\n\n### 3\ufe0f\u20e3 Call D&B Data Blocks (use dynamic Bearer YOUR_TOKEN_HERE)\n1. Add an **HTTP Request** node named `Data Blocks`  \n2. Configure:  \n   - **Authentication:** None  \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     > `{{ $json.duns }}` resolves per row from the Google Sheets node.  \n   - **Headers:**  \n     - `Accept = application/json`  \n     - `Authorization = Bearer {{$node[\"Get Bearer YOUR_TOKEN_HERE\"].json[\"access_token\"]}}`\n       > This pulls the token from the token node\u2019s output.\n\n---\n\n### 4\ufe0f\u20e3 Map Paydex and Upsert to Google Sheets\n1. **Set** node (`Edit Fields1`) \u2192 create a field:  \n   - **Name:** `Paydex`  \n   - **Value (Number):**  \n     ```\n     {{$json.organization.businessTrading[0].summary[0].paydexScoreHistory[0].paydexScore}}\n     ```\n2. **Google Sheets \u2192 Append or Update**  \n   - **Operation:** `Append or Update`  \n   - **Matching column:** `duns`  \n   - **Columns mapping:**  \n     - `duns = {{ $('Get row(s) in sheet2').item.json.duns }}`  \n     - `paydex = {{ $json.Paydex }}`  \n     - `Complete = Yes`\n\n---\n\n\n## \ud83d\udcec Contact  \nNeed help customizing this (e.g., enriching more fields, normalizing responses, or bulk-processing large sheets)?\n\n- \ud83d\udce7 **robert@ynteractive.com**  \n- \ud83d\udd17 **https://www.linkedin.com/in/robert-breen-29429625/**  \n- \ud83c\udf10 **https://ynteractive.com**\n"
      },
      "typeVersion": 1
    },
    {
      "id": "281b764f-8c47-4593-b1de-c71a9f32bd39",
      "name": "Sticky Note61",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -944,
        7296
      ],
      "parameters": {
        "color": 3,
        "width": 352,
        "height": 704,
        "content": "### \ud83d\udcd1 Fetch Company Report from D&B (PDF/JSON)\n\n1. Add a new **HTTP Request** node and name it `D&B Report`  \n2. Configure it as follows:  \n   - **Authentication:** Header Auth (use your D&B credential in n8n)  \n   - **Method:** `GET`  \n   - **URL:**  \n     ```\n     https://plus.dnb.com/v1/reports/duns/804735132?productId=birstd&inLanguage=en-US&reportFormat=PDF&orderReason=6332&tradeUp=hq&customerReference=customer%20reference%20text\n     ```  \n     > Replace the sample DUNS (`804735132`) with a dynamic reference like `{{ $json.duns }}` if pulling from input data.  \n3. Under **Headers**, add:  \n   - `Accept = application/json`  \n4. Execute the node \u2014 you\u2019ll receive a **company report** from D&B (JSON metadata, or PDF depending on `reportFormat`).  \n\n\u2705 You can route the output to **Google Drive**, **email**, or save it to a database for compliance and reporting.  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "5a5a82d6-a4d3-4719-80b0-c6897f7bef60",
      "name": "Sticky Note63",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        6640
      ],
      "parameters": {
        "color": 3,
        "width": 368,
        "height": 560,
        "content": "### \ud83d\udd11 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 \u2014 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": "6ba9acfa-d68f-462d-aa09-03ca25195997",
      "name": "Get Companies",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1248,
        7200
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1h0D5C1oJElBUsz9Dv4AllEUU5eIAR4ae4VTXH1XcwBM/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1h0D5C1oJElBUsz9Dv4AllEUU5eIAR4ae4VTXH1XcwBM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1h0D5C1oJElBUsz9Dv4AllEUU5eIAR4ae4VTXH1XcwBM/edit?usp=drivesdk",
          "cachedResultName": "Temp White Oak Companies"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "85fec4ba-5945-4271-a521-6dadfb41c850",
      "name": "Only New Rows",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1232,
        7776
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "96912772-2442-4ca0-a546-653a014cabed",
              "operator": {
                "type": "string",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json.Complete }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "2071d117-207e-44db-9156-5dd0459ea372",
      "name": "D&B Info",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -816,
        7856
      ],
      "parameters": {
        "url": "=https://plus.dnb.com/v1/data/duns/{{ $json.duns }}?blockIDs=paymentinsight_L4_v1&tradeUp=hq&customerReference=customer%20reference%20text&orderReason=6332 ",
        "options": {},
        "authentication": "headerAuth",
        "headerParametersUi": {
          "parameter": [
            {
              "name": "Accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {},
      "typeVersion": 1
    },
    {
      "id": "894623ee-e36b-49ce-8ee4-f73d94f55ac0",
      "name": "Keep Score",
      "type": "n8n-nodes-base.set",
      "position": [
        -352,
        7696
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1f789f32-f98e-47a0-9402-8a61ccf5fd78",
              "name": "Paydex",
              "type": "number",
              "value": "={{ $json.organization.businessTrading[0].summary[0].paydexScoreHistory[0].paydexScore }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "8300bc14-9714-4b3d-af51-b416e4e8c7bc",
      "name": "Append to g-sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        176,
        7840
      ],
      "parameters": {
        "columns": {
          "value": {
            "duns": "={{ $('Get Companies').item.json.duns }}",
            "paydex": "={{ $json.Paydex }}",
            "Complete": "Yes"
          },
          "schema": [
            {
              "id": "Company",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Company",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "duns",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "duns",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "paydex",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "paydex",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Complete",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Complete",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "duns"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1h0D5C1oJElBUsz9Dv4AllEUU5eIAR4ae4VTXH1XcwBM/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1wlzNuN16KfD72owWceXmTvVulGBplMBv3c1DlsSayHI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1wlzNuN16KfD72owWceXmTvVulGBplMBv3c1DlsSayHI/edit?usp=drivesdk",
          "cachedResultName": "d&b Companies"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "8576657b-7488-425a-a68a-65b68b2b2d7d",
      "name": "Sticky Note64",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        7216
      ],
      "parameters": {
        "color": 3,
        "width": 224,
        "height": 752,
        "content": "### 3) Connect Google Sheets (OAuth2)\n\n1. In **n8n \u2192 Credentials \u2192 New \u2192 Google Sheets (OAuth2)**  \n2. Sign in with your Google account and **grant access**.  \n3. In your workflow\u2019s **Google Sheets** node (e.g., *Append or Update*), select this spreadsheet and tab:  \n   - **Spreadsheet URL:** https://docs.google.com/spreadsheets/d/1wlzNuN16KfD72owWceXmTvVulGBplMBv3c1DlsSayHI/edit?gid=0#gid=0  \n   - **Spreadsheet ID:** `1wlzNuN16KfD72owWceXmTvVulGBplMBv3c1DlsSayHI`  \n   - **Tab (gid):** `0` *(usually \u201cSheet1\u201d)*  \n4. (Optional) Set **Operation** to **Append or Update** and choose a **Matching Column** (e.g., `duns`) to prevent duplicates.  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "c1670672-3ce0-4f73-b4db-58beeb988e18",
      "name": "Get Token1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -320,
        7088
      ],
      "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
    }
  ],
  "connections": {
    "D&B Info": {
      "main": [
        [
          {
            "node": "Keep Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep Score": {
      "main": [
        [
          {
            "node": "Append to g-sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Companies": {
      "main": [
        [
          {
            "node": "Only New Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only New Rows": {
      "main": [
        [
          {
            "node": "D&B Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Automate company enrichment directly in Google Sheets using Dun & Bradstreet (D&B) Data Blocks. This workflow reads DUNS numbers from a sheet, fetches a Bearer token (via Basic Auth → ), calls the Data Blocks API for each row (), extracts Paydex, and appends or updates the…

Source: https://n8n.io/workflows/8869/ — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Data & Sheets

This template is ideal for solo store owners, eCommerce marketers, automation beginners, or anyone using Shopify and Gmail who wants to recover lost revenue without coding.

HTTP Request, Gmail, Twilio +3
Data & Sheets

PCN. Uses googleSheets, httpRequest, @n-octo-n/n8n-nodes-json-database, itemLists. Event-driven trigger; 60 nodes.

Google Sheets, HTTP Request, @N Octo N/N8N Nodes Json Database +3
Data & Sheets

The workflow automates the process of gathering extensive keyword data for a "Main Keyword." It starts by reading initial parameters from a Google Sheets template, creates a new dedicated Google Sheet

Google Sheets, Google Drive, HTTP Request
Data & Sheets

🔥 March Sale – n8n Community Members Get ideoGener8r for Just $27! (Reg. $47) Use Coupon Code: (Valid until 3/31/2025 for n8n community members)

HTTP Request, Google Drive, Google Sheets
Data & Sheets

📄 Documentation: Notion Guide

Google Sheets, Google Drive, HTTP Request +2