N
n8n Store
Workflow Market
Knowledge base auto update

Knowledge base auto update

by rahul080 views

Description

Categories

🤖 AI & Machine Learning

Nodes Used

n8n-nodes-base.ifn8n-nodes-base.coden8n-nodes-base.coden8n-nodes-base.zendeskn8n-nodes-base.zendeskn8n-nodes-base.emailSendn8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNote
PriceKostenlos
Views0
Last Updated11/28/2025
workflow.json
{
  "id": "cgDm9vVlMd7iOO7R",
  "meta": {
    "instanceId": "8443f10082278c46aa5cf3acf8ff0f70061a2c58bce76efac814b16290845177"
  },
  "name": "Knowledge base auto update",
  "tags": [],
  "nodes": [
    {
      "id": "48804c68-423a-4268-bb12-95531adf0425",
      "name": "When clicking 'Execute workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1504,
        1712
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ca452dad-821d-491f-870e-72d97a903534",
      "name": "Error Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        -1280,
        2448
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "12c1be58-113b-4aa7-9278-da78048ce9a7",
      "name": "Error Trigger Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        2432
      ],
      "parameters": {
        "width": 320,
        "height": 328,
        "content": "## Error Trigger Node\n\nAutomatically activates when ANY node in the workflow fails.\n\n**How it works:**\n- Monitors the entire workflow execution\n- Catches errors from any node\n- Triggers the error handling path\n- Prevents silent failures\n\n**Best Practice:** This ensures no errors go unnoticed in production."
      },
      "typeVersion": 1
    },
    {
      "id": "5449c962-eb4a-498f-9244-812a865bb0d4",
      "name": "Format Error Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1264,
        2704
      ],
      "parameters": {
        "width": 320,
        "height": 384,
        "content": "## Format Error Details\n\nTransforms raw error data into structured, readable format.\n\n**Extracted Information:**\n- Timestamp of error\n- Workflow and execution IDs\n- Failed node name\n- Error message and type\n- Context (which ticket/item failed)\n- Stack trace for debugging\n- Severity level\n\n**Output:** Clean JSON ready for logging to sheets."
      },
      "typeVersion": 1
    },
    {
      "id": "dca1671e-2b16-479c-8dca-d9b58d8c2ccc",
      "name": "Log Error Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -944,
        2304
      ],
      "parameters": {
        "width": 320,
        "height": 488,
        "content": "## Error Log Sheet\n\nPersists all error details to Google Sheets for tracking and analysis.\n\n**Log Columns:**\n- Timestamp\n- Workflow Name\n- Execution ID\n- Node Name\n- Error Message\n- Error Type\n- Ticket/Item ID\n- Stack Trace\n- Status\n- Severity\n\n**Benefits:** Historical error tracking, pattern identification, audit trail."
      },
      "typeVersion": 1
    },
    {
      "id": "0d60a036-f2b3-495e-900e-3e3dc9f6af3f",
      "name": "Email Error Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        2096
      ],
      "parameters": {
        "width": 320,
        "height": 424,
        "content": "## Email Error Notification\n\nSends immediate alert emails when workflow fails.\n\n**Email Contains:**\n- Error summary\n- Failed node name\n- Timestamp\n- Link to execution (if configured)\n\n**Configuration Required:**\n- Set up SMTP credentials\n- Update 'fromEmail' and 'toEmail'\n- Can add multiple recipients\n\n**Tip:** Consider using Slack/Teams webhooks instead for faster alerts."
      },
      "typeVersion": 1
    },
    {
      "id": "4946b2e9-c107-4793-ada0-e95ffe07b966",
      "name": "Success Summary Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -544,
        2608
      ],
      "parameters": {
        "width": 320,
        "height": 332,
        "content": "## Success Summary\n\nCalculates and formats execution success metrics.\n\n**What it does:**\n- Counts total tickets processed\n- Captures execution timestamp\n- Records workflow and execution IDs\n- Creates success message\n\n**Purpose:** Provides visibility into successful runs, not just failures. Helps track workflow performance over time."
      },
      "typeVersion": 1
    },
    {
      "id": "4ee4440b-c840-4b6f-bece-1de4273cf79f",
      "name": "Execution Log Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        2880
      ],
      "parameters": {
        "width": 320,
        "height": 460,
        "content": "## Execution Log Sheet\n\nLogs ALL successful workflow executions.\n\n**Logged Data:**\n- Timestamp\n- Workflow Name\n- Execution ID\n- Status (SUCCESS)\n- Number of tickets processed\n- Success message\n\n**Use Cases:**\n- Monitor workflow health\n- Track processing volume\n- Performance trending\n- Audit compliance\n\n**Combined with Error Log:** Complete execution history."
      },
      "typeVersion": 1
    },
    {
      "id": "6f884973-d34f-4fac-b31b-dbead40cf933",
      "name": "Workflow Description1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2160,
        1600
      ],
      "parameters": {
        "width": 526,
        "height": 336,
        "content": "## Workflow Purpose\n\nThis workflow automatically updates a Google Sheets knowledge base with Zendesk tickets that have the \"howto\" tag.\n\n**Flow Overview:**\n1. Fetches all tickets from Zendesk\n2. Filters for tickets with \"howto\" tag only\n3. Gets detailed user information for each ticket\n4. Updates Google Sheets with ticket details\n5. **NEW: Comprehensive error handling and logging**\n\n**Use Case:** Perfect for maintaining a knowledge base of how-to requests from customers."
      },
      "typeVersion": 1
    },
    {
      "id": "c821dc37-e8cc-4e0f-b37c-284041f38fcc",
      "name": "Trigger Instructions1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        1360
      ],
      "parameters": {
        "width": 320,
        "height": 296,
        "content": "## Manual Trigger\n\nClick the 'Execute Workflow' button to run this automation manually.\n\n**When to use:**\n- Testing the workflow\n- One-time data sync\n- Troubleshooting\n\n**Note:** You can also set this up with a schedule trigger to run automatically (daily, weekly, etc.)"
      },
      "typeVersion": 1
    },
    {
      "id": "b62bdc8f-683f-4025-9659-08e3f678a5dd",
      "name": "Zendesk Fetch Details1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1440,
        1904
      ],
      "parameters": {
        "width": 320,
        "height": 312,
        "content": "## Zendesk Integration\n\nFetches ALL tickets from your Zendesk instance.\n\n**What it does:**\n- Connects to Zendesk using API credentials\n- Retrieves all available tickets\n- Passes ticket data to next step\n\n**Important:** Make sure your Zendesk credentials are properly configured in the node settings."
      },
      "typeVersion": 1
    },
    {
      "id": "1e144223-9445-4c91-8355-7a1b734b3539",
      "name": "Filter Explanation1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1200,
        1376
      ],
      "parameters": {
        "width": 320,
        "height": 296,
        "content": "## Filtering Logic\n\nOnly processes tickets with the \"howto\" tag.\n\n**Filter Condition:**\n- Checks if first tag equals \"howto\"\n- Case sensitive matching\n- Only matching tickets proceed to next step\n\n**Tip:** You can modify this filter to use different tags or multiple conditions as needed."
      },
      "typeVersion": 1
    },
    {
      "id": "672f5275-a2ac-4025-b125-d12e969e7186",
      "name": "User Details Purpose1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -976,
        1888
      ],
      "parameters": {
        "width": 320,
        "height": 296,
        "content": "## User Details Enrichment\n\nGets detailed information about the person who created each ticket.\n\n**Retrieved Data:**\n- User name\n- Email address\n- Other user profile information\n\n**Why needed:** The initial ticket data only contains user ID, but we need name and email for the spreadsheet."
      },
      "typeVersion": 1
    },
    {
      "id": "e88abaf3-a1b1-4fc7-a5cd-b17ada33241f",
      "name": "Sheets Update Logic1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        1280
      ],
      "parameters": {
        "width": 320,
        "height": 384,
        "content": "## Google Sheets Update\n\nSaves or updates ticket information in your knowledge base spreadsheet.\n\n**Data Saved:**\n- Ticket Number\n- Description\n- Status\n- Tag\n- Owner Name\n- Email\n\n**Smart Update:** Uses description as matching column to avoid duplicates - existing tickets get updated instead of creating new rows."
      },
      "typeVersion": 1
    },
    {
      "id": "d031d1a6-f10b-45f4-9f12-e57894161b76",
      "name": "Error Handling Documentation1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        1280
      ],
      "parameters": {
        "width": 400,
        "height": 400,
        "content": "## 🚨 Error Handling & Logging\n\n**Production Features Added:**\n\n1. **Error Trigger:** Catches all workflow errors automatically\n\n2. **Error Logger:** Logs detailed error info to Google Sheets:\n   - Timestamp\n   - Error node name\n   - Error message\n   - Failed ticket/user ID\n   - Stack trace\n\n3. **Retry Logic:** Auto-retries failed operations\n\n4. **Email Notifications:** Alerts team on failures\n\n**Monitor errors in the Error Log sheet!**"
      },
      "typeVersion": 1
    },
    {
      "id": "01f922f2-c854-4550-98d8-02d00d331e23",
      "name": "Filter HowTo Tickets Only1",
      "type": "n8n-nodes-base.if",
      "position": [
        -1088,
        1712
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "cc47baeb-cdfb-4a6b-94ca-ef18c6450d9f",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.tags[0] }}",
              "rightValue": "=howto"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "767d5d14-50c1-4b0b-b851-0f4ddee830ae",
      "name": "Get Requester User Info1",
      "type": "n8n-nodes-base.zendesk",
      "maxTries": 3,
      "position": [
        -864,
        1712
      ],
      "parameters": {
        "id": "={{ $json.requester_id }}",
        "resource": "user",
        "operation": "get"
      },
      "credentials": {
        "zendeskApi": {
          "id": "BQ61OjTaFfNPQ1bK",
          "name": "Zendesk account-anuj"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1,
      "continueOnFail": true,
      "waitBetweenTries": 1000
    },
    {
      "id": "f04ef795-df09-4f97-9ecb-ab19679f6219",
      "name": "Update Knowledge Base Sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "maxTries": 3,
      "position": [
        -640,
        1712
      ],
      "parameters": {
        "columns": {
          "value": {
            "Tag": "={{ $('Filter HowTo Tickets Only1').item.json.tags[0] || 'No tags' }}",
            "email": "={{ $json.email }}",
            "owner": "={{ $json.name }}",
            "Status": "={{ $('Filter HowTo Tickets Only1').item.json.status }}",
            "Ticket No.": "={{ $('Filter HowTo Tickets Only1').item.json.id }}",
            "Description": "={{ $('Filter HowTo Tickets Only1').item.json.description }}"
          },
          "schema": [
            {
              "id": "Ticket No.",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Ticket No.",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Description",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "owner",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "owner",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Tag",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Tag",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Description"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Utpt2Z8krX-29nE3_HAJVmm9yUp9NRcq-_P8JL1UqRk/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Utpt2Z8krX-29nE3_HAJVmm9yUp9NRcq-_P8JL1UqRk",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Utpt2Z8krX-29nE3_HAJVmm9yUp9NRcq-_P8JL1UqRk/edit?usp=drivesdk",
          "cachedResultName": "Ticket status dummy"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "kpPEOLCGn963qpoh",
          "name": "[email protected]"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.6,
      "continueOnFail": true,
      "waitBetweenTries": 2000
    },
    {
      "id": "b5adbd34-2c67-4226-aa0a-10cb8f18b97f",
      "name": "Fetch All Zendesk Tickets1",
      "type": "n8n-nodes-base.zendesk",
      "maxTries": 3,
      "position": [
        -1312,
        1712
      ],
      "parameters": {
        "options": {},
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "zendeskApi": {
          "id": "BQ61OjTaFfNPQ1bK",
          "name": "Zendesk account-anuj"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1,
      "waitBetweenTries": 1000
    },
    {
      "id": "641b189d-d542-4c82-8dca-3e72d1bb1152",
      "name": "Format Error Details1",
      "type": "n8n-nodes-base.code",
      "position": [
        -1056,
        2448
      ],
      "parameters": {
        "jsCode": "// Extract error details and format for logging\nconst errorData = $input.item.json;\n\nconst formattedError = {\n  timestamp: new Date().toISOString(),\n  workflowName: $workflow.name,\n  executionId: $execution.id,\n  nodeName: errorData.node?.name || 'Unknown Node',\n  errorMessage: errorData.error?.message || 'Unknown Error',\n  errorType: errorData.error?.name || 'Error',\n  ticketId: errorData.error?.context?.itemIndex !== undefined \n    ? `Item ${errorData.error.context.itemIndex}` \n    : 'N/A',\n  stackTrace: errorData.error?.stack?.substring(0, 500) || 'No stack trace',\n  workflowStatus: 'FAILED',\n  severity: 'HIGH'\n};\n\nreturn { json: formattedError };"
      },
      "typeVersion": 2
    },
    {
      "id": "fd059320-ee35-47fc-bb65-3c7e9d907c95",
      "name": "Log Error to Sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "notes": "Creates Error Log sheet if it doesn't exist",
      "position": [
        -784,
        2448
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "={{ $json.workflowStatus }}",
            "Severity": "={{ $json.severity }}",
            "Node Name": "={{ $json.nodeName }}",
            "Timestamp": "={{ $json.timestamp }}",
            "Error Type": "={{ $json.errorType }}",
            "Stack Trace": "={{ $json.stackTrace }}",
            "Execution ID": "={{ $json.executionId }}",
            "Error Message": "={{ $json.errorMessage }}",
            "Workflow Name": "={{ $json.workflowName }}",
            "Ticket/Item ID": "={{ $json.ticketId }}"
          },
          "schema": [
            {
              "id": "Timestamp",
              "type": "string",
              "required": false,
              "displayName": "Timestamp"
            },
            {
              "id": "Workflow Name",
              "type": "string",
              "required": false,
              "displayName": "Workflow Name"
            },
            {
              "id": "Execution ID",
              "type": "string",
              "required": false,
              "displayName": "Execution ID"
            },
            {
              "id": "Node Name",
              "type": "string",
              "required": false,
              "displayName": "Node Name"
            },
            {
              "id": "Error Message",
              "type": "string",
              "required": false,
              "displayName": "Error Message"
            },
            {
              "id": "Error Type",
              "type": "string",
              "required": false,
              "displayName": "Error Type"
            },
            {
              "id": "Ticket/Item ID",
              "type": "string",
              "required": false,
              "displayName": "Ticket/Item ID"
            },
            {
              "id": "Stack Trace",
              "type": "string",
              "required": false,
              "displayName": "Stack Trace"
            },
            {
              "id": "Status",
              "type": "string",
              "required": false,
              "displayName": "Status"
            },
            {
              "id": "Severity",
              "type": "string",
              "required": false,
              "displayName": "Severity"
            }
          ],
          "mappingMode": "defineBelow"
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=1",
          "cachedResultName": "Error Log"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Utpt2Z8krX-29nE3_HAJVmm9yUp9NRcq-_P8JL1UqRk",
          "cachedResultName": "Ticket status dummy"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "s4dP1fNuVZ2gWvs3",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "9ab36aa6-753b-48ff-8aae-102f0daea66b",
      "name": "Send Error Notification1",
      "type": "n8n-nodes-base.emailSend",
      "notes": "Configure your SMTP credentials",
      "position": [
        -512,
        2448
      ],
      "webhookId": "c0a84dff-82d2-4618-ab81-5b7baab4555a",
      "parameters": {
        "options": {},
        "subject": "🚨 Knowledge Base Workflow Error - {{ $json.nodeName }}",
        "toEmail": "[email protected]",
        "fromEmail": "[email protected]"
      },
      "typeVersion": 2.1
    },
    {
      "id": "ffaa5350-2709-44de-b6eb-d3554053d164",
      "name": "Success Summary1",
      "type": "n8n-nodes-base.code",
      "position": [
        -416,
        1712
      ],
      "parameters": {
        "jsCode": "// Log successful execution summary\nconst items = $input.all();\n\nconst summary = {\n  timestamp: new Date().toISOString(),\n  workflowName: $workflow.name,\n  executionId: $execution.id,\n  status: 'SUCCESS',\n  ticketsProcessed: items.length,\n  message: `Successfully processed ${items.length} tickets`\n};\n\nreturn { json: summary };"
      },
      "typeVersion": 2
    },
    {
      "id": "3ca07889-3c23-42bf-9ef0-7f6241b8c6c4",
      "name": "Log Successful Execution1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -192,
        1712
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "={{ $json.status }}",
            "Message": "={{ $json.message }}",
            "Timestamp": "={{ $json.timestamp }}",
            "Execution ID": "={{ $json.executionId }}",
            "Workflow Name": "={{ $json.workflowName }}",
            "Tickets Processed": "={{ $json.ticketsProcessed }}"
          },
          "schema": [
            {
              "id": "Timestamp",
              "type": "string",
              "required": false,
              "displayName": "Timestamp"
            },
            {
              "id": "Workflow Name",
              "type": "string",
              "required": false,
              "displayName": "Workflow Name"
            },
            {
              "id": "Execution ID",
              "type": "string",
              "required": false,
              "displayName": "Execution ID"
            },
            {
              "id": "Status",
              "type": "string",
              "required": false,
              "displayName": "Status"
            },
            {
              "id": "Tickets Processed",
              "type": "number",
              "required": false,
              "displayName": "Tickets Processed"
            },
            {
              "id": "Message",
              "type": "string",
              "required": false,
              "displayName": "Message"
            }
          ],
          "mappingMode": "defineBelow"
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=2",
          "cachedResultName": "Execution Log"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Utpt2Z8krX-29nE3_HAJVmm9yUp9NRcq-_P8JL1UqRk",
          "cachedResultName": "Ticket status dummy"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "s4dP1fNuVZ2gWvs3",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5e36abd5-9ff1-48ad-b877-f26093d34fe1",
  "connections": {
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Format Error Details1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Success Summary1": {
      "main": [
        [
          {
            "node": "Log Successful Execution1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Error to Sheet1": {
      "main": [
        [
          {
            "node": "Send Error Notification1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Error Details1": {
      "main": [
        [
          {
            "node": "Log Error to Sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Requester User Info1": {
      "main": [
        [
          {
            "node": "Update Knowledge Base Sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch All Zendesk Tickets1": {
      "main": [
        [
          {
            "node": "Filter HowTo Tickets Only1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter HowTo Tickets Only1": {
      "main": [
        [
          {
            "node": "Get Requester User Info1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Knowledge Base Sheet1": {
      "main": [
        [
          {
            "node": "Success Summary1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking 'Execute workflow'": {
      "main": [
        [
          {
            "node": "Fetch All Zendesk Tickets1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

相关工作流