AutomationFlowsWeb Scraping › Courier Performance Analytics

Courier Performance Analytics

Original n8n title: S4: Courier Performance Analytics

S4: Courier Performance Analytics. Uses httpRequest. Scheduled trigger; 11 nodes.

Cron / scheduled trigger★★★★☆ complexity11 nodesHTTP Request
Web Scraping Trigger: Cron / scheduled Nodes: 11 Complexity: ★★★★☆ Added:

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
{
  "name": "S4: Courier Performance Analytics",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 12
            }
          ]
        }
      },
      "id": "cron-trigger",
      "name": "Every 12 Hours",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.CORE_API_URL }}/api/trpc/superAdmin.getAllTenants",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "bodyParameters": {
          "parameters": []
        },
        "options": {}
      },
      "id": "get-tenants",
      "name": "Get All Tenants",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        450,
        300
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "has-tenants",
              "leftValue": "={{ $json.result.data.length }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "check-tenants",
      "name": "Has Tenants?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {
        "fieldToSplitOut": "result.data",
        "options": {}
      },
      "id": "split-tenants",
      "name": "Split Tenants",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        850,
        200
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.CORE_API_URL }}/api/trpc/shippingAutomation.computePerformance",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"date\": \"{{ new Date().toISOString().split('T')[0] }}\"\n}",
        "options": {
          "timeout": 120000
        }
      },
      "id": "compute-performance",
      "name": "Compute Performance",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1050,
        200
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "has-recommendations",
              "leftValue": "={{ $json.result.data.recommendations.length }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "check-recommendations",
      "name": "Has Recommendations?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        1250,
        200
      ]
    },
    {
      "parameters": {
        "jsCode": "// Format recommendations for notification\nconst result = $input.item.json.result.data;\nconst tenant = $('Split Tenants').item.json;\n\nconst recommendations = result.recommendations.map(r => {\n  return `\u2022 ${r.courier}${r.region ? ` (${r.region})` : ''}: ${r.recommendation} (Score: ${r.score}/100)`;\n}).join('\\n');\n\nreturn [{\n  json: {\n    tenant_id: tenant.id,\n    tenant_name: tenant.name,\n    couriers_analyzed: result.couriersAnalyzed,\n    recommendations_text: recommendations,\n    recommendations: result.recommendations\n  }\n}];"
      },
      "id": "format-recommendations",
      "name": "Format Recommendations",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1450,
        100
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.CORE_API_URL }}/api/trpc/n8nWorkflows.createAuditLog",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"workflow_id\": \"S4\",\n  \"tenant_id\": \"{{ $json.tenant_id }}\",\n  \"event_type\": \"COURIER_ANALYTICS_COMPUTED\",\n  \"entity_type\": \"performance_report\",\n  \"entity_id\": \"{{ new Date().toISOString().split('T')[0] }}\",\n  \"payload\": {\n    \"couriers_analyzed\": {{ $json.couriers_analyzed }},\n    \"recommendations_count\": {{ $json.recommendations.length }}\n  }\n}",
        "options": {}
      },
      "id": "audit-log",
      "name": "Create Audit Log",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1650,
        100
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "id": "no-recommendations",
      "name": "No Recommendations",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1450,
        300
      ]
    },
    {
      "parameters": {},
      "id": "no-tenants",
      "name": "No Tenants",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        850,
        400
      ]
    },
    {
      "parameters": {},
      "id": "complete",
      "name": "Complete",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1850,
        200
      ]
    }
  ],
  "connections": {
    "Every 12 Hours": {
      "main": [
        [
          {
            "node": "Get All Tenants",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Tenants": {
      "main": [
        [
          {
            "node": "Has Tenants?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Tenants?": {
      "main": [
        [
          {
            "node": "Split Tenants",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Tenants",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Tenants": {
      "main": [
        [
          {
            "node": "Compute Performance",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compute Performance": {
      "main": [
        [
          {
            "node": "Has Recommendations?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Recommendations?": {
      "main": [
        [
          {
            "node": "Format Recommendations",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Recommendations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Recommendations": {
      "main": [
        [
          {
            "node": "Create Audit Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Audit Log": {
      "main": [
        [
          {
            "node": "Complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No Recommendations": {
      "main": [
        [
          {
            "node": "Complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": "error-handler"
  },
  "staticData": null,
  "tags": [
    {
      "name": "shipping",
      "createdAt": "2024-01-01T00:00:00.000Z",
      "updatedAt": "2024-01-01T00:00:00.000Z"
    },
    {
      "name": "analytics",
      "createdAt": "2024-01-01T00:00:00.000Z",
      "updatedAt": "2024-01-01T00:00:00.000Z"
    }
  ],
  "triggerCount": 1,
  "updatedAt": "2024-01-01T00:00:00.000Z",
  "versionId": "1"
}

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

S4: Courier Performance Analytics. Uses httpRequest. Scheduled trigger; 11 nodes.

Source: https://github.com/bassemroshdey4-afk/DeepSolution/blob/382df7800e29f9959374b170387bc28194f6642a/n8n-workflows/S4-courier-analytics.json — original creator credit. Request a take-down →

More Web Scraping workflows → · Browse all categories →

Related workflows

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

Web Scraping

As n8n instances scale, teams often lose track of sub-workflows—who uses them, where they are referenced, and whether they can be safely updated. This leads to inefficiencies like unnecessary copies o

HTTP Request, n8n, N8N Trigger +1
Web Scraping

This workflow is an improvement of this workflow by Greg Brzezinka.

HTTP Request, Email Send, XML +1
Web Scraping

N8N-Workflow-Github-Manager. Uses github, httpRequest, n8n. Scheduled trigger; 38 nodes.

GitHub, HTTP Request, n8n
Web Scraping

This workflow uses KlickTipp community nodes, available for self-hosted n8n instances only.

N8N Nodes Klicktipp, Salesforce, Salesforce Trigger +1
Web Scraping

This workflow acts as an automated engagement bot. It sends a Direct Message (DM) with a link or resource to any follower who replies to your post with a specific target keyword.

HTTP Request