← All N8N workflows
Automation & utilitiesAggregateCodeExecute WorkflowExecute Workflow TriggerHtml

Workflow stats

Configured with Aggregate, Execute Workflow, Execute Workflow Trigger, Html, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
TriggerWhen clicking "Testworkflow"Manual TriggerCodenodes-sectionCodeTransformworkflows-sectionEdit FieldsCodetags-sectionCodeTransformglobals-sectionEdit FieldsTriggerExecute WorkflowTriggerExecute Workflow TriggerTransformConvert to XMLXmlTransformCreate HTMLHtmlTransformMove Binary DataMove Binary DataWeb / APIRespond to WebhookRespond To WebhookWeb / APIRespond to Webhook2Respond To WebhookTransformFinal templateEdit FieldsTransformTemplate elementsEdit FieldsTransformSort-workflowsSortTransformSort-nodesSortTransformSort-tagsSortTransformAggregate-workflowsAggregateTransformAggregate-nodesAggregateTransformAggregate-tagsAggregateIntegrationn8n-get-workflowsN8NSubworkflowPrepare JSON objectExecute WorkflowTransformget-nodes-via-jmespathEdit FieldsTriggerRequest HTML dashboardWebhookTriggerRequest xsl templateWebhookTransformFinal-jsonMergeCodewebhook-sectionCodeTransformSort-whooksSortTransformAggregate-whooksAggregate

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.

Workflow node names, types, and operations
NodeCategoryTypeOperation
When clicking "Test workflow"TriggerManual TriggerSee node parameters
nodes-sectionCodeCodeSee node parameters
workflows-sectionTransformEdit FieldsSee node parameters
tags-sectionCodeCodeSee node parameters
globals-sectionTransformEdit FieldsSee node parameters
Execute Workflow TriggerTriggerExecute Workflow TriggerSee node parameters
Convert to XMLTransformXmlSee node parameters
Create HTMLTransformHtmlSee node parameters
Move Binary DataTransformMove Binary DataSee node parameters
Respond to WebhookWeb / APIRespond To WebhookSee node parameters
Respond to Webhook2Web / APIRespond To WebhookSee node parameters
Final templateTransformEdit FieldsSee node parameters
Template elementsTransformEdit FieldsSee node parameters
Sort-workflowsTransformSortSee node parameters
Sort-nodesTransformSortSee node parameters
Sort-tagsTransformSortSee node parameters
Aggregate-workflowsTransformAggregateSee node parameters
Aggregate-nodesTransformAggregateSee node parameters
Aggregate-tagsTransformAggregateSee node parameters
n8n-get-workflowsIntegrationN8NSee node parameters
Prepare JSON objectSubworkflowExecute WorkflowSee node parameters
get-nodes-via-jmespathTransformEdit FieldsSee node parameters
Request HTML dashboardTriggerWebhookSee node parameters
Request xsl templateTriggerWebhookSee node parameters
Final-jsonTransformMergeSee node parameters
webhook-sectionCodeCodeSee node parameters
Sort-whooksTransformSortSee node parameters
Aggregate-whooksTransformAggregateSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. 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:

  1. Template elements node defines each section of the Dashboard
  2. Final template node puts everything together
  3. 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.

  1. Request HTML dashboard node runs that main section of the workflow
  2. It converts the JSON into an XML structure
  3. A final HTML page is created with the link to an XML stylesheet (this stylesheet controls the look of the dashboard)
  4. The resulting page is returned via Respond to Webhook node
IMPORTANT NOTE FOR CLOUD USERS

IMPORTANT NOTE FOR CLOUD USERS

Since the cloud version doesn't support environmental variables, please make the following changes:

  1. get-nodes-via-jmespath node. Update the instance_url variable: enter your n8n URL instead of {{$env["N8N_PROTOCOL"]}}://{{$env["N8N_HOST"]}}
  2. 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.

  • ​

More in Automation & utilities