# Score your n8n workflows out of 100 with an HTML report

**Use case:** 

Give every workflow a health score out of 100 and get a shareable HTML report of the whole audit on one page: the score table first, then every finding grouped by severity. The score starts at 100 and deducts per finding by severity, with a per-rule cap so one repeated rule cannot sink a workflow on its own, and the weights are calibrated against 58 real templates rather than picked by hand.

## Input

```json
{
  "workflowJson": {
    "workflows": [
      {
        "id": "score-clean",
        "name": "Weekly KPI email",
        "nodes": [
          {
            "id": "1",
            "name": "Every Monday",
            "type": "n8n-nodes-base.scheduleTrigger",
            "typeVersion": 1.2,
            "position": [
              0,
              0
            ],
            "parameters": {
              "rule": {
                "interval": [
                  {
                    "field": "weeks"
                  }
                ]
              }
            }
          },
          {
            "id": "2",
            "name": "Query metrics",
            "type": "n8n-nodes-base.postgres",
            "typeVersion": 3,
            "position": [
              240,
              0
            ],
            "parameters": {
              "operation": "executeQuery",
              "query": "SELECT week, revenue FROM kpi_weekly ORDER BY week DESC LIMIT 8",
              "options": {}
            },
            "credentials": {
              "postgres": {
                "id": "5",
                "name": "Postgres account"
              }
            },
            "retryOnFail": true
          },
          {
            "id": "3",
            "name": "Send report",
            "type": "n8n-nodes-base.emailSend",
            "typeVersion": 2.1,
            "position": [
              480,
              0
            ],
            "parameters": {
              "subject": "Weekly KPIs",
              "toEmail": "exec@acme.test"
            },
            "credentials": {
              "smtp": {
                "id": "9",
                "name": "SMTP account"
              }
            },
            "retryOnFail": true
          }
        ],
        "connections": {
          "Every Monday": {
            "main": [
              [
                {
                  "node": "Query metrics",
                  "type": "main",
                  "index": 0
                }
              ]
            ]
          },
          "Query metrics": {
            "main": [
              [
                {
                  "node": "Send report",
                  "type": "main",
                  "index": 0
                }
              ]
            ]
          }
        },
        "settings": {
          "errorWorkflow": "err-alerts"
        }
      },
      {
        "id": "score-middling",
        "name": "Shopify order fulfilment",
        "nodes": [
          {
            "id": "1",
            "name": "Order paid",
            "type": "n8n-nodes-base.webhook",
            "typeVersion": 2,
            "position": [
              0,
              0
            ],
            "parameters": {
              "path": "shopify-order-paid",
              "httpMethod": "POST",
              "authentication": "headerAuth"
            },
            "credentials": {
              "httpHeaderAuth": {
                "id": "2",
                "name": "Webhook header auth"
              }
            }
          },
          {
            "id": "2",
            "name": "Get order",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 4.2,
            "position": [
              240,
              0
            ],
            "parameters": {
              "url": "=https://acme.myshopify.com/admin/api/2024-10/orders/{{ $json.body.id }}.json",
              "options": {}
            },
            "credentials": {
              "httpHeaderAuth": {
                "id": "6",
                "name": "Shopify header auth"
              }
            }
          },
          {
            "id": "3",
            "name": "Create shipment",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 4.2,
            "position": [
              480,
              0
            ],
            "parameters": {
              "url": "https://api.shipstation.com/shipments",
              "method": "POST",
              "options": {}
            },
            "credentials": {
              "httpHeaderAuth": {
                "id": "7",
                "name": "ShipStation header auth"
              }
            }
          },
          {
            "id": "4",
            "name": "Legacy label printer",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 4.2,
            "position": [
              480,
              220
            ],
            "parameters": {
              "url": "https://labels.internal/print",
              "method": "POST",
              "options": {}
            }
          },
          {
            "id": "5",
            "name": "Notify warehouse",
            "type": "n8n-nodes-base.slack",
            "typeVersion": 2.2,
            "position": [
              720,
              0
            ],
            "parameters": {
              "channel": "#warehouse",
              "text": "New shipment"
            },
            "credentials": {
              "slackApi": {
                "id": "4",
                "name": "Slack account"
              }
            }
          }
        ],
        "connections": {
          "Order paid": {
            "main": [
              [
                {
                  "node": "Get order",
                  "type": "main",
                  "index": 0
                }
              ]
            ]
          },
          "Get order": {
            "main": [
              [
                {
                  "node": "Create shipment",
                  "type": "main",
                  "index": 0
                }
              ]
            ]
          },
          "Create shipment": {
            "main": [
              [
                {
                  "node": "Notify warehouse",
                  "type": "main",
                  "index": 0
                }
              ]
            ]
          }
        },
        "settings": {}
      },
      {
        "id": "score-bad",
        "name": "Marketing lead scraper",
        "nodes": [
          {
            "id": "1",
            "name": "Cron",
            "type": "n8n-nodes-base.cron",
            "typeVersion": 1,
            "position": [
              0,
              0
            ],
            "parameters": {
              "triggerTimes": {
                "item": [
                  {
                    "mode": "everyHour"
                  }
                ]
              }
            }
          },
          {
            "id": "2",
            "name": "Scrape leads",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 2,
            "position": [
              240,
              0
            ],
            "parameters": {
              "url": "https://api.leadsource.io/v1/leads",
              "sendHeaders": true,
              "headerParameters": {
                "parameters": [
                  {
                    "name": "X-API-Key",
                    "value": "7Kq2mVx8RtLpZn4WbYcH3dTfGjA6sQeU"
                  }
                ]
              },
              "options": {}
            }
          },
          {
            "id": "3",
            "name": "Function",
            "type": "n8n-nodes-base.function",
            "typeVersion": 1,
            "position": [
              480,
              0
            ],
            "parameters": {
              "functionCode": "const r = await fetch('https://enrich.leadsource.io/v1/bulk');\nreturn items;"
            }
          },
          {
            "id": "4",
            "name": "Save to sheet",
            "type": "n8n-nodes-base.googleSheets",
            "typeVersion": 3,
            "position": [
              720,
              0
            ],
            "parameters": {
              "operation": "append",
              "sheetName": "Leads"
            },
            "credentials": {
              "googleSheetsOAuth2Api": {
                "id": "1",
                "name": "Google Sheets account"
              }
            }
          },
          {
            "id": "5",
            "name": "Old HubSpot push",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 2,
            "position": [
              720,
              240
            ],
            "parameters": {
              "url": "https://api.hubapi.com/contacts/v1/contact",
              "method": "POST",
              "options": {}
            }
          }
        ],
        "connections": {
          "Cron": {
            "main": [
              [
                {
                  "node": "Scrape leads",
                  "type": "main",
                  "index": 0
                }
              ]
            ]
          },
          "Scrape leads": {
            "main": [
              [
                {
                  "node": "Function",
                  "type": "main",
                  "index": 0
                }
              ]
            ]
          },
          "Function": {
            "main": [
              [
                {
                  "node": "Save to sheet",
                  "type": "main",
                  "index": 0
                }
              ]
            ]
          }
        },
        "settings": {}
      }
    ]
  },
  "workflowUrls": [],
  "workflowIds": [],
  "activeOnly": false,
  "ruleSet": "all",
  "minSeverity": "low",
  "ignoreRules": [],
  "includeReport": true
}
```

## Output

```json
{
  "score": {
    "label": "Score / 100",
    "format": "integer"
  },
  "workflowName": {
    "label": "Workflow",
    "format": "string"
  },
  "workflowSource": {
    "label": "Source",
    "format": "string"
  },
  "active": {
    "label": "Active",
    "format": "boolean"
  },
  "nodeCount": {
    "label": "Nodes",
    "format": "integer"
  },
  "credentialCount": {
    "label": "Credentials",
    "format": "integer"
  },
  "findingCount": {
    "label": "Findings",
    "format": "integer"
  },
  "criticalCount": {
    "label": "Critical",
    "format": "integer"
  },
  "highCount": {
    "label": "High",
    "format": "integer"
  },
  "mediumCount": {
    "label": "Medium",
    "format": "integer"
  },
  "lowCount": {
    "label": "Low",
    "format": "integer"
  },
  "infoCount": {
    "label": "Info",
    "format": "integer"
  },
  "topRule": {
    "label": "Top rule",
    "format": "string"
  },
  "auditedAt": {
    "label": "Audited",
    "format": "string"
  },
  "runId": {
    "label": "Run",
    "format": "string"
  }
}
```

## About this Actor

This example demonstrates how to use [n8n Workflow Auditor - Linter & Security Review](https://apify.com/mediocre_interest/n8n-workflow-auditor.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/mediocre_interest/n8n-workflow-auditor.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
This Task's input is already configured above — use it as-is rather than inventing a new one.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/mediocre_interest/n8n-workflow-auditor.md

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).
