Workflow stats
Configured with Aggregate, Execute Workflow, Execute Workflow Trigger, Html, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Trigger
- Code
- Transform
- Web / API
- Integration
- Subworkflow
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| When clicking "Test workflow" | Trigger | Manual Trigger | See node parameters |
| nodes-section | Code | Code | See node parameters |
| workflows-section | Transform | Edit Fields | See node parameters |
| tags-section | Code | Code | See node parameters |
| globals-section | Transform | Edit Fields | See node parameters |
| Execute Workflow Trigger | Trigger | Execute Workflow Trigger | See node parameters |
| Convert to XML | Transform | Xml | See node parameters |
| Create HTML | Transform | Html | See node parameters |
| Move Binary Data | Transform | Move Binary Data | See node parameters |
| Respond to Webhook | Web / API | Respond To Webhook | See node parameters |
| Respond to Webhook2 | Web / API | Respond To Webhook | See node parameters |
| Final template | Transform | Edit Fields | See node parameters |
| Template elements | Transform | Edit Fields | See node parameters |
| Sort-workflows | Transform | Sort | See node parameters |
| Sort-nodes | Transform | Sort | See node parameters |
| Sort-tags | Transform | Sort | See node parameters |
| Aggregate-workflows | Transform | Aggregate | See node parameters |
| Aggregate-nodes | Transform | Aggregate | See node parameters |
| Aggregate-tags | Transform | Aggregate | See node parameters |
| n8n-get-workflows | Integration | N8N | See node parameters |
| Prepare JSON object | Subworkflow | Execute Workflow | See node parameters |
| get-nodes-via-jmespath | Transform | Edit Fields | See node parameters |
| Request HTML dashboard | Trigger | Webhook | See node parameters |
| Request xsl template | Trigger | Webhook | See node parameters |
| Final-json | Transform | Merge | See node parameters |
| webhook-section | Code | Code | See node parameters |
| Sort-whooks | Transform | Sort | See node parameters |
| Aggregate-whooks | Transform | Aggregate | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
n8nApi
Workflow notes
Create the main JSON object with the workflow statistics
Create the main JSON object with the workflow statistics
globals- general information (# of workflows, active workflows, total trigger count)wf_stats- summary per workflow (number or nodes, unique nodes, list of nodes and tags)nodes-section- summary per node (number of workflows that use a node and their URLs)tags-section- summary per tag (number of workflows that use a node and their URLs)webhook-section- lists all webhook endpoints of the instance and shows the workflow URLs
You can use this JSON in BI tools to create a custom dashboard
Learn JS tips & tricks
Instead of just using one Code node, the workflow contains several nodes with useful advanced tricks.
JMESPath
- Make a simple array of strings out of a complex array:
$jmespath($json,'nodes[*].type') - Extract values based on condition:
$jmespath($input.all(),'[?json.wf_stats.wf_active ==true]')
Map and arrow functions
- Perform operation on each array element:
.map(item => (item.split('.').pop().toUpperCase() )) - Calculate sum of values from an array:
.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
Create an array with only unique values
[...new Set($json.nodes_array)]
Date-time conversions with the Luxon library:
DateTime.fromISO($json.createdAt).toFormat('yyyy-MM-dd HH:mm:ss')
Template literals (Template strings) for creating strings in JS
wf-${$json.id}
DO NOT RUN THIS
DO NOT RUN THIS
This webhook is needed to comply with the CORS policy of modern browsers.
It generates XML template and serves it using your n8n URL
XSLT template is created with 2 Set nodes:
Template elementsnode defines each section of the DashboardFinal templatenode puts everything together- Bootstrap 5.3 styling is added. You can save the .css and .js files on your server. Right now a CDN version of the librarly is used.
Additional section to create a standalone dashboard via XLM templates
Additional section to create a standalone dashboard via XLM templates
This section is not required if you only need a JSON
IMPORTANT!
This webhook is not protected. Everyone who knows the URL endpoint can get access to the Dashboard. Please consider adding authentication.
Request HTML dashboardnode runs that main section of the workflow- It converts the JSON into an XML structure
- A final HTML page is created with the link to an XML stylesheet (this stylesheet controls the look of the dashboard)
- The resulting page is returned via
Respond to Webhooknode
IMPORTANT NOTE FOR CLOUD USERS
IMPORTANT NOTE FOR CLOUD USERS
Since the cloud version doesn't support environmental variables, please make the following changes:
- get-nodes-via-jmespath node. Update the
instance_urlvariable: enter your n8n URL instead of{{$env["N8N_PROTOCOL"]}}://{{$env["N8N_HOST"]}} - Create HTML node. Please provide the n8n instance URL instead of
{{ $env.WEBHOOK_URL }}
Workflow stats
Workflow stats
Purpose and structure
This folder contains the Workflow stats workflow. Its executable nodes use aggregate, code, executeWorkflow, executeWorkflowTrigger, html, manualTrigger, merge, moveBinaryData, n8n, respondToWebhook, set, sort, webhook, xml. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
When clicking "Test workflow", Execute Workflow Trigger, Request HTML dashboard, Request xsl template
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/1401_Code_Webhook_Automate_Webhook.json MIT; preserve source notices.
Canvas section labels
These name areas of the original canvas; they do not include explanatory instructions.
- ​