Библиотека / Отчёты, аналитика и дашборды
Отчёты, аналитика и дашборды
Сбор статистики рабочих процессов n8n
При запуске или вызове запрашивает API n8n и собирает статистику по узлам, рабочим процессам, тегам и глобальным переменным в один объект JSON.
Что делает
## 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}
Шаги
- When clicking "Test workflow"
- nodes-section
- workflows-section
- tags-section
- globals-section
- Execute Workflow Trigger
- Convert to XML
- Create HTML
- Move Binary Data
- Respond to Webhook
- Respond to Webhook2
- Final template
- Template elements
- Sort-workflows
Всего шагов: 28.
Похожие автоматизации
Код, Git и инструменты разработчикаКлонирование рабочих процессов n8n между экземплярами через API n8nШагов: 33Отчёты, аналитика и дашбордыСоздание отчёта со статистикой воркфлоу n8nШагов: 65Отчёты, аналитика и дашбордыАудит ИИ-моделей, используемых каждым рабочим процессом n8nШагов: 12Отчёты, аналитика и дашбордыОтчёт о затронутых воркфлоу n8n в виде HTML-страницыШагов: 24