AutomationFlowsData & Sheets › Audit Workflow Credential Usage to Google Sheets Using Google Drive and Sqlite3

Audit Workflow Credential Usage to Google Sheets Using Google Drive and Sqlite3

ByZiana Mitchell @zmglobalit on n8n.io

This workflow is specifically for Self-Hosted N8N Docker users.

Event trigger★★★★★ complexity37 nodesTime SavedHTTP RequestGoogle SheetsGoogle Drive
Data & Sheets Trigger: Event Nodes: 37 Complexity: ★★★★★ Added:

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

This workflow follows the Google Drive → Google Sheets 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
{
  "id": "LjqjwPSLWwbMFouQ",
  "name": "Workflow Credentialls Auditor - Template-3",
  "tags": [
    {
      "id": "lER6qgVHZweXztiL",
      "name": "Template",
      "createdAt": "2026-03-28T19:24:33.753Z",
      "updatedAt": "2026-03-28T19:24:33.753Z"
    },
    {
      "id": "u2Zf7F4Fj1uPzjeQ",
      "name": "ZMGIT",
      "createdAt": "2026-03-14T13:30:15.728Z",
      "updatedAt": "2026-03-14T13:30:15.728Z"
    }
  ],
  "nodes": [
    {
      "id": "19182763-1070-4870-aa84-0bfa9a7401a2",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "disabled": true,
      "position": [
        1296,
        1184
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "755c2df9-73e5-4574-a024-46dbf784d1b4",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "notes": "filter out workflows with no associated credentials",
      "position": [
        3072,
        896
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a4367387-89ca-4ee1-b9bc-ef036cbfcc0e",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.nodes.some(node => node.hasOwnProperty('credentials')) }}",
              "rightValue": "="
            }
          ]
        },
        "looseTypeValidation": true
      },
      "notesInFlow": true,
      "typeVersion": 2.3
    },
    {
      "id": "1f828c8f-d2c3-459b-9461-5d0e23a2306d",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "notes": "filter out nodes with no credentials",
      "position": [
        3520,
        896
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6891be3c-b3c9-47a4-8e91-2955ac98c28e",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.nodes.credentials }}",
              "rightValue": ""
            }
          ]
        },
        "looseTypeValidation": true
      },
      "notesInFlow": true,
      "typeVersion": 2.3
    },
    {
      "id": "267f0c8b-b291-49e0-ad35-31dce4aa1cf1",
      "name": "Summarize",
      "type": "n8n-nodes-base.summarize",
      "position": [
        3968,
        896
      ],
      "parameters": {
        "options": {
          "outputFormat": "separateItems"
        },
        "fieldsToSplitBy": "Workflow",
        "fieldsToSummarize": {
          "values": [
            {
              "field": "nodeName",
              "aggregation": "append"
            },
            {
              "field": "credentials",
              "aggregation": "append",
              "includeEmpty": true
            },
            {
              "field": "nodeName"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "be7fa6fb-1bb2-4041-8034-e906a7357e9c",
      "name": "Time Saved",
      "type": "n8n-nodes-base.timeSaved",
      "position": [
        3712,
        1408
      ],
      "parameters": {
        "minutesSaved": 10
      },
      "typeVersion": 1
    },
    {
      "id": "bdc0ffb8-2d4a-4bcd-b99d-020c77a1e5e0",
      "name": "Time Saved1",
      "type": "n8n-nodes-base.timeSaved",
      "position": [
        5296,
        896
      ],
      "parameters": {
        "minutesSaved": 15
      },
      "typeVersion": 1
    },
    {
      "id": "c8a7460f-b391-4ba1-8e58-ac82cf75edb2",
      "name": "credsList",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2144,
        1424
      ],
      "parameters": {
        "url": "https://<WEBHOOK DOMAIN GOES HERE>/api/v1/credentials",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-N8N-API-KEY",
              "value": "API KEY GOES HERE"
            }
          ]
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "9b722b3a-eef0-4671-bcbb-33c449226653",
      "name": "flowsList",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2176,
        896
      ],
      "parameters": {
        "url": "https://<WEBHOOK DOMAIN GOES HERE>/api/v1/workflows",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-N8N-API-KEY",
              "value": "API KEY GOES HERE"
            }
          ]
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "3508f163-8ee2-44c6-8e20-7799066b1f04",
      "name": "version_labels",
      "type": "n8n-nodes-base.code",
      "position": [
        2624,
        896
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const sqlite3 = require('sqlite3').verbose();\nconst dbPath = '/home/node/.n8n/database.sqlite';\n\n// We use a Promise because the standard sqlite3 module is asynchronous\nreturn new Promise((resolve) => {\n  const db = new sqlite3.Database(dbPath, sqlite3.OPEN_READONLY, (err) => {\n    if (err) {\n      return resolve({ ...$json, version_label: 'Conn Error: ' + err.message });\n    }\n\n    const query = `\n      SELECT name \n      FROM workflow_history \n      WHERE workflowId = ? \n      AND name IS NOT NULL \n      ORDER BY createdAt DESC \n      LIMIT 1\n    `;\n\n    db.get(query, [$json.id], (err, row) => {\n      db.close();\n      if (err) {\n        return resolve({ ...$json, version_label: 'Query Error' });\n      }\n      \n      resolve({\n        ...$json,\n        version_label: row ? row.name : 'No Label'\n      });\n    });\n  });\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "f353b6ee-812b-45ae-9c1e-482a36cddd22",
      "name": "flow_names",
      "type": "n8n-nodes-base.code",
      "position": [
        2816,
        1440
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const sqlite3 = require('sqlite3').verbose();\nconst dbPath = '/home/node/.n8n/database.sqlite';\n\nreturn new Promise((resolve) => {\n  const db = new sqlite3.Database(dbPath, sqlite3.OPEN_READONLY, (err) => {\n    if (err) {\n      return resolve({ ...$json, workflow_names: 'Conn Error: ' + err.message });\n    }\n\n    // We search the JSON string in the 'nodes' column for your credential ID\n    const query = `\n      SELECT name \n      FROM workflow_entity \n      WHERE nodes LIKE ?\n    `;\n\n    // Wrapping the ID in wildcards to find it anywhere in the nodes JSON\n    const searchString = `%${$json.id}%`;\n\n    db.all(query, [searchString], (err, rows) => {\n      db.close();\n      if (err) {\n        return resolve({ ...$json, workflow_names: 'Query Error: ' + err.message });\n      }\n      \n      // Since one credential can be in many workflows, we join the names\n      const names = rows.length > 0 ? rows.map(r => r.name).join(', ') : 'Not in use';\n      \n      resolve({\n        ...$json,\n        impacted_workflows: names\n      });\n    });\n  });\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "0cde6968-2fbd-41d7-861d-910d2273eee9",
      "name": "CleanJson",
      "type": "n8n-nodes-base.code",
      "position": [
        4192,
        896
      ],
      "parameters": {
        "jsCode": "return $input.all().map(item => {\n  const data = item.json;\n\n  // Helper function to safely parse only if it's a string\n  const safeParse = (val) => {\n  if (!val || val === \"\") return []; // Return empty array if field is empty\n  return typeof val === 'string' ? JSON.parse(val) : val;\n};\n\n// Use Set to remove duplicates\nconst uniqueNodes = [...new Set(safeParse(data.appended_nodeName))];\nconst uniqueCreds = [...new Set(safeParse(data.appended_credentials))];\n\nconst cleanedCreds = {\n  \"workflow\": safeParse(data.Workflow),\n  \"nodeCount\": data.count_nodeName,\n  \"nodes\": uniqueNodes.join(', '),\n  \"credentials\": uniqueCreds.join(', ')\n};\n\n  // Remove nulls from nodes if they exist\n  if (Array.isArray(cleanedCreds.nodes)) {\n    cleanedCreds.nodes = cleanedCreds.nodes.filter(i => i !== null);\n  }\n    return { json: cleanedCreds };\n\n    // Remove nulls from credentials if they exist\n  if (Array.isArray(cleanedCreds.credentials)) {\n    cleanedCreds.credentials = cleanedCreds.credentials.filter(i => i !== null);\n  }\n    return { json: cleanedCreds };\n\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "3706eb1a-a1c1-4b36-ba4a-af3a417bf0db",
      "name": "credInventory",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        4848,
        896
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "locationDefine": {
            "values": {}
          }
        },
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create credInventory').item.json.spreadsheetId }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "5ba9799a-633e-44f4-988e-17c2f60ddc99",
      "name": "credEdits",
      "type": "n8n-nodes-base.set",
      "position": [
        3040,
        1440
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "75502b17-4357-4289-acab-c50d4a418868",
              "name": "Credential",
              "type": "string",
              "value": "={{ $json.name }}"
            },
            {
              "id": "6a82ea4c-ec34-477b-9b2c-a43173d79e8b",
              "name": "ID",
              "type": "string",
              "value": "='{{ $json.id }}"
            },
            {
              "id": "cdca344c-5126-4fd5-9063-08473a770a70",
              "name": "Type",
              "type": "string",
              "value": "={{ $json.type }}"
            },
            {
              "id": "21a0a2f6-7f3b-45da-abe6-d41fb8b89290",
              "name": "Created",
              "type": "string",
              "value": "='{{ $json.createdAt }}"
            },
            {
              "id": "1568460c-56cc-4ad3-b1f8-451684115b27",
              "name": "Updated",
              "type": "string",
              "value": "='{{ $json.updatedAt }}"
            },
            {
              "id": "c908bc17-caf6-44fd-aa7d-9b440000361a",
              "name": "Workflows",
              "type": "string",
              "value": "={{ $json.impacted_workflows }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ad9d3fd1-f094-4036-b759-800ce175350e",
      "name": "credMap",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3280,
        1424
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "locationDefine": {
            "values": {}
          }
        },
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create credMap').item.json.spreadsheetId }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "f7960da2-a4d6-4a65-8172-2ea3e5dbf20c",
      "name": "Create credInventory",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1952,
        896
      ],
      "parameters": {
        "title": "=Workflow-Credentials-Inventory_{{ $now.toISODate() }}_{{ $now.toISOTime().split('.')[0] }}",
        "options": {},
        "resource": "spreadsheet",
        "sheetsUi": {
          "sheetValues": [
            {
              "title": "Sheet1"
            }
          ]
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "executeOnce": false,
      "typeVersion": 4.7
    },
    {
      "id": "7ac1b836-3724-44b4-924e-ae7008877642",
      "name": "Create credMap",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1920,
        1424
      ],
      "parameters": {
        "title": "=Credential-Impact-Map_{{ $now.toISODate() }}_{{ $now.toISOTime().split('.')[0] }}",
        "options": {},
        "resource": "spreadsheet",
        "sheetsUi": {
          "sheetValues": [
            {
              "title": "Sheet1"
            }
          ]
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "executeOnce": false,
      "typeVersion": 4.7
    },
    {
      "id": "d074d575-586d-4f4c-abc4-3f62fe1b1519",
      "name": "splitFlows",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2400,
        896
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "data"
      },
      "typeVersion": 1
    },
    {
      "id": "75ae8f02-9f5d-4535-8614-626179822d8c",
      "name": "splitCreds",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2368,
        1424
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "data"
      },
      "typeVersion": 1
    },
    {
      "id": "8fb91bcf-3128-4cc0-9a7c-9f87cac06c83",
      "name": "splitNodes",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        3296,
        896
      ],
      "parameters": {
        "include": "allOtherFields",
        "options": {},
        "fieldToSplitOut": "nodes"
      },
      "typeVersion": 1
    },
    {
      "id": "1b496c42-038c-4bef-a377-9643aa72fb90",
      "name": "sortCredNames",
      "type": "n8n-nodes-base.sort",
      "position": [
        2592,
        1440
      ],
      "parameters": {
        "options": {},
        "sortFieldsUi": {
          "sortField": [
            {
              "fieldName": "name"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1a26e4ba-4b30-44ae-a7fc-c2617eba3cd9",
      "name": "nodeEdits",
      "type": "n8n-nodes-base.set",
      "position": [
        3744,
        896
      ],
      "parameters": {
        "include": "selected",
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ddd5cbdd-26c9-4bca-a23e-7c7b09b5eb8b",
              "name": "nodeName",
              "type": "string",
              "value": "={{ $json.nodes.name }}"
            },
            {
              "id": "653cdd3d-4312-459d-b459-2ee7f85e6aad",
              "name": "credentials",
              "type": "string",
              "value": "={{ Object.values($json.nodes.credentials)[0]?.name || 'None' }}"
            }
          ]
        },
        "includeFields": "Workflow",
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "9fc83561-e97f-4338-ad8b-75eb56876eab",
      "name": "finalFlowEdits",
      "type": "n8n-nodes-base.set",
      "position": [
        4416,
        896
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "8a16eb21-ddcf-47bf-aed9-0aa706fffca9",
              "name": "Workflow",
              "type": "string",
              "value": "={{ $('CleanJson').item.json.workflow.name }}"
            },
            {
              "id": "7ea6fd7c-88b1-45c0-b3e2-99535ccc17dc",
              "name": "ID",
              "type": "string",
              "value": "='{{ $('CleanJson').item.json.workflow.id }}"
            },
            {
              "id": "2cf0fed2-5663-406a-9982-e6ecc944e70f",
              "name": "Published",
              "type": "string",
              "value": "={{ $('CleanJson').item.json.workflow.published.status }}"
            },
            {
              "id": "ebf94657-01d2-4938-8810-17627a570e90",
              "name": "Live Version",
              "type": "string",
              "value": "={{ $('CleanJson').item.json.workflow.published.latestVersion }}"
            },
            {
              "id": "699219d3-8e73-4108-b027-b9e12ab0dfa1",
              "name": "Last Published",
              "type": "string",
              "value": "='{{ $('CleanJson').item.json.workflow.published.date }}"
            },
            {
              "id": "b2ce285e-d2a1-4a9d-9d98-5f21d8930686",
              "name": "Current Version ID",
              "type": "string",
              "value": "='{{ $('CleanJson').item.json.workflow.currentVersion.id }}"
            },
            {
              "id": "26decaf8-7e11-44b5-9ab6-cc8d75ad19a4",
              "name": "Node w/ Creds",
              "type": "string",
              "value": "={{ $('CleanJson').item.json.nodeCount }}"
            },
            {
              "id": "202d79ac-9e2e-4955-8596-41ab218f13b3",
              "name": "Nodes",
              "type": "string",
              "value": "={{$json.nodes }}"
            },
            {
              "id": "57154e07-3f15-4f9e-8985-be78b7a84fed",
              "name": "Credentials",
              "type": "string",
              "value": "={{ $json.credentials }}"
            },
            {
              "id": "f552f0db-feb7-4394-9430-b0fab509e165",
              "name": "URL",
              "type": "string",
              "value": "=https://{{YOUR WEBHOOK GOES HERE}}/workflow/{{ $('CleanJson').item.json.workflow.id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "72dc5586-68cc-425c-b867-fdcd3b5c934e",
      "name": "flowEdits",
      "type": "n8n-nodes-base.set",
      "position": [
        2848,
        896
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ddd5cbdd-26c9-4bca-a23e-7c7b09b5eb8b",
              "name": "Workflow.name",
              "type": "string",
              "value": "={{ $json.name }}"
            },
            {
              "id": "a9e3a9f2-a0b7-464d-a1ea-cd109d5e121b",
              "name": "Workflow.id",
              "type": "string",
              "value": "={{ $json.id }}"
            },
            {
              "id": "cdbea29a-c66a-438b-ac03-40c3168743e0",
              "name": "Workflow.published.status",
              "type": "string",
              "value": "={{ $json.active ? 'Yes' : 'No' }}"
            },
            {
              "id": "1e7048e6-11c7-4f33-b1aa-2e8d4479fb6e",
              "name": "Workflow.published.latestVersion",
              "type": "string",
              "value": "={{ $json.version_label }}"
            },
            {
              "id": "7420264e-523a-430d-9922-5a47e6dd0258",
              "name": "Workflow.published.date",
              "type": "string",
              "value": "={{ $json.activeVersion.createdAt }}"
            },
            {
              "id": "19d81566-2ec5-4556-85b5-546460b716c1",
              "name": "Workflow.currentVersion.id",
              "type": "string",
              "value": "={{ $json.versionId }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "3611556d-5612-409e-bc42-29d6a8aefee3",
      "name": "Create folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1568,
        992
      ],
      "parameters": {
        "name": "={{ $now.toISODate() }}_{{ $now.toISOTime().split('.')[0] }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {
          "folderColorRgb": "#F18F17"
        },
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "[FOLDER ID GOES HERE]"
        },
        "resource": "folder"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "e82afe17-b731-461f-8d1a-065060ccefbe",
      "name": "moveCreds",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        3504,
        1424
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create credMap').item.json.spreadsheetId }}"
        },
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create folder').item.json.id }}"
        },
        "operation": "move"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "b6633301-c413-4758-83c1-60669d520111",
      "name": "moveFlows",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        5072,
        896
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create credInventory').item.json.spreadsheetId }}"
        },
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create folder').item.json.id }}"
        },
        "operation": "move"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "46e68792-76b9-4858-8340-0788e9a1133c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -80
      ],
      "parameters": {
        "width": 1072,
        "height": 2256,
        "content": "# Workflow Introduction \n\nThis workflow is specifically for Self-Hosted N8N Docker users.\n\nThe purpose of this workflow is to: \n1. Take an inventory of all workflows with credentials (Workflow -> Credential 1, Credential 2, etc.), connecting credential names to workflow names\n2. Create a credentials impact map (Credential -> Workflow 1, Workflow 2, etc.), connecting workflow names to credential IDs and names\n\n\nThis workflow drastically minimizes the amount of time spent trying to figure out which workflows will break if a credential is updated or deleted by bridging the gap between the public API (workflow metadata) and the internal sqlite database (hidden version labels and credential mappings).\n\nIn essence this tool audits your n8n environment without touching your sensitive encrypted data, keeping you API Keys 100% secure.\n\nIt features dynamic time saving trackers, set for what I estimate to be the amount of time it would take to manually complete every individual thing this workflow does in less than 5 minutes.\n\n# Limitations\nThis workflow is optimized for the **Standard N8N Execution Mode**. Due to the high-frequency data lookups required for this tool, it is **not compatible with Task Runners (N8N_RUNNERS_ENABLED=true)**. For maximum stability and to prevent \"Database Locked\" errors, please ensure your instance is running in the default configuration. If you use Method 1 (Direct Insertion) in the API Key Instructions below your N8N API key will not appear as connected to this workflow in the resulting Credential Impact Map. Same goes for all other credentials directly inserted into a HTTP Request node across your N8N environment.\n\n# Setting it up - Requirements\n## Environment Variables Required:\n**These enviornment variables are required in order for the version_labels and flow_names code nodes to work.**\nNODE_FUNCTION_ALLOW_BUILTIN=*\nNODE_FUNCTION_ALLOW_EXTERNAL=sqlite3\n\t- **Note:** If you need access to multiple external functions across your n8n instance, add them as a string like this: NODE_FUNCTION_ALLOW_EXTERNAL=sqlite3, better-sqlite3\n\n## Credentials Needed:\nn8n account > n8n self-hosted API key \nGoogle Sheets account\nGoogle Drive account\n\nThe nodes that need manually inputted credentials or node parameter information are: Create folder, flowsList, credsList, and finalFlowEdits\n\n**Note:** If you create your credentials before openning any process nodes, your credentials will be auto connected to the associated nodes. However, this will not happen for the n8n self-hosted API keys. If you have multiple Google Sheets or Google Drive accounts you will need to point the associated nodes to the specific one you want to use. \n\n## API Key Instructions\nHow to get: Setting > API > Create API key \n_**Copy the API key and save it somewhere secure. You won't be able to see it again!!**_\nHow to use (Two Methods): **Note: The node is set up for Method 1 by default**\nMethod 1 (Direct Insertion). In the flowsList and credsList nodes: \n\t   - Authentication: None \n\t- Send Headers: on \n\t- Name: X-N8N-API-KEY \n\t- Value: <YOUR N8N API KEY> \n\n Method 2 (N8N Credential). In the flowsList and credsList nodes: \n\t- Authentication: Generic Credential Type  \n\t- Generic Auth Type: Header Auth \n\t- Header Auth: Select 'Create new credential' (**If you already have a Header Auth for your N8N API key select it here**) \n\t2a. In the credential creation area:\n\t\t- Name: X-N8N-API-KEY  \n\t\t- Value: <YOUR N8N API KEY>\n\nQueries and Body aren't needed.\n\nEndpoints:\nflowsList: http://localhost:5678/api/v1/workflows or https://<your webhook domain>/api/v1/workflows\ncredsList: http://localhost:5678/api/v1/credentials or https://<your webhook domain>/api/v1/credentials\n\n\n# The Workflow Processes\n## Global Actions\n1. Executes on on a set schedule (weekly on Fridays at 2pm)\n1a. A deactivated execute on command node is included for testing, or for when updated files are needed before the scheduled date/time \n2. Creates a Drive folder to house the resulting spreadsheets using the current date and time as the name\n2a. This workflow creates the folders inside a specified parent folder.\n2b. This node also sets the folder color \n\t- You are welcome to change this to your preferred color. \n\n\n## Branch 1: Workflow Credentials Inventory Process\n1. Creates a google spreadsheet with the current date in the name\n2. Gets the list of all workflows from the public API\n3. Splits the list into individual items for easier processing\n4. Gets the version labels for active workflows from the internal sqlite database\n5. Sets fields for the workflow's name, id, published status, latest published version label, current version's id (whether the workflow is published or not) \n6. Filters out the workflows that don't have any nodes with credentials\n7. Splits out the list of nodes for easier processing\n8. Filters out the nodes that don't have associated credentials\n9. Sets fields for the node names, and credential names\n10. Summarize the output from the Nodes editor, based on workflows\n10a. Append nodeNames\n10b. Append credetntials\n10c. Count the nodes\n11. Clean up the summarized information, converting it back to recognizible clean json format\n12. Set fields for spreadsheet aethestics\n\t- This step can be skipped, however, I didn't like the visual look of the direct from CleanJson to credInventory\n13. Appends header row and data rows to the spreadsheet created in Step 1.\n14. Move the file into the folder created at the start of the workflow from whereever google put it by default\n15. Track the estimated time it would have taken to manually do every step, in a time saved node\n\n\n## Branch 2: Credential Impact Map Process\n1. Creates a spreadsheet with the current date in the name\n2. Gets a list of all credentials from the public API\n3. Splits the list into individual items for easier processing\n4. Sorts the credentials by name in ascending order (A->Z) in case they come from the split out of order\n5. Gets a list of all workflows with nodes associated with each credential ID from the internal sqlite database\n6. Set fields for the credential name, id, type, created and updated timestamps, and list of workflow names\n7. Appends the header row and data rows to the spreadsheet created in Step 1 of this branch\n8. Move the file into the folder created at the start of the workflow from whereever google put it by default\n9. Track the estimated time it would have taken to manually do every step, in a time saved node"
      },
      "typeVersion": 1
    },
    {
      "id": "f2df049c-7107-4c71-84ce-e61a9bda7553",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1248,
        928
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                5
              ],
              "triggerAtHour": 14
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "8d26ac6e-b51d-473e-90a3-ad567ba7f780",
      "name": "Sort",
      "type": "n8n-nodes-base.sort",
      "position": [
        4624,
        896
      ],
      "parameters": {
        "options": {},
        "sortFieldsUi": {
          "sortField": [
            {
              "fieldName": "Workflow"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6914b8cb-02e9-4452-93e8-38a18760c365",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1856,
        1248
      ],
      "parameters": {
        "color": 7,
        "width": 2096,
        "height": 432,
        "content": "## Branch 2 - Credentials Mapping\nThis part of the workflow grabs your credentials and the associated workflows and generates a google sheet\n- Lists all credentials and all the workflows using each one\n"
      },
      "typeVersion": 1
    },
    {
      "id": "7b37a01c-843d-4a99-88eb-36d9055df009",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        816
      ],
      "parameters": {
        "color": 7,
        "width": 720,
        "height": 608,
        "content": "## Global Actions"
      },
      "typeVersion": 1
    },
    {
      "id": "a0f375f8-b4b8-4a4b-ab46-c026957ac5f7",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1856,
        688
      ],
      "parameters": {
        "color": 7,
        "width": 3552,
        "height": 528,
        "content": "## Branch 1 - Workflow Credentials Inventory\nThis part of the workflow grabs all your workflows that have credentials attached and all the credentials involved in each one, and generates a google sheet"
      },
      "typeVersion": 1
    },
    {
      "id": "32e84e87-5719-421b-bd0c-0bea803e3fae",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2096,
        1072
      ],
      "parameters": {
        "color": 3,
        "height": 96,
        "content": "## Edit URL and API Key"
      },
      "typeVersion": 1
    },
    {
      "id": "739ef916-2866-48eb-bd09-9f62f58a97c6",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2080,
        1584
      ],
      "parameters": {
        "color": 3,
        "height": 96,
        "content": "## Edit URL and API Key"
      },
      "typeVersion": 1
    },
    {
      "id": "905b8c3f-7aac-46ac-a2e9-53a37cd5a53f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1504,
        1216
      ],
      "parameters": {
        "color": 3,
        "height": 128,
        "content": "## Edit folder destination and parent folder ID"
      },
      "typeVersion": 1
    },
    {
      "id": "86e910d9-98f5-4428-8ec4-b6044a826df3",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4368,
        1088
      ],
      "parameters": {
        "color": 3,
        "height": 96,
        "content": "## Edit URL"
      },
      "typeVersion": 1
    },
    {
      "id": "56e867c7-9a9d-49e3-8bf0-8ab9bea8a221",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1152,
        432
      ],
      "parameters": {
        "color": 3,
        "width": 672,
        "height": 128,
        "content": "## Disable Runners - If you have runners enabled on your n8n container this workflow will not work."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "4494a980-79f6-4ed3-ae18-a829d389ce39",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "splitNodes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "nodeEdits",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort": {
      "main": [
        [
          {
            "node": "credInventory",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "credMap": {
      "main": [
        [
          {
            "node": "moveCreds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CleanJson": {
      "main": [
        [
          {
            "node": "finalFlowEdits",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize": {
      "main": [
        [
          {
            "node": "CleanJson",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "credEdits": {
      "main": [
        [
          {
            "node": "credMap",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "credsList": {
      "main": [
        [
          {
            "node": "splitCreds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "flowEdits": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "flowsList": {
      "main": [
        [
          {
            "node": "splitFlows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "moveCreds": {
      "main": [
        [
          {
            "node": "Time Saved",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "moveFlows": {
      "main": [
        [
          {
            "node": "Time Saved1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "nodeEdits": {
      "main": [
        [
          {
            "node": "Summarize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "flow_names": {
      "main": [
        [
          {
            "node": "credEdits",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "splitCreds": {
      "main": [
        [
          {
            "node": "sortCredNames",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "splitFlows": {
      "main": [
        [
          {
            "node": "version_labels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "splitNodes": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create folder": {
      "main": [
        [
          {
            "node": "Create credMap",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create credInventory",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "credInventory": {
      "main": [
        [
          {
            "node": "moveFlows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "sortCredNames": {
      "main": [
        [
          {
            "node": "flow_names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create credMap": {
      "main": [
        [
          {
            "node": "credsList",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "finalFlowEdits": {
      "main": [
        [
          {
            "node": "Sort",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "version_labels": {
      "main": [
        [
          {
            "node": "flowEdits",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Create folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create credInventory": {
      "main": [
        [
          {
            "node": "flowsList",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Create folder",
            "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

This workflow is specifically for Self-Hosted N8N Docker users.

Source: https://n8n.io/workflows/14423/ — 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

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
Data & Sheets

Overview

Google Sheets, Google Drive, HTTP Request