Identify slow and expensive workflow nodes via webhook and HTTP APIs
Quick overview This workflow receives a webhook request to optimize an n8n workflow, fetches performance and cost metrics via HTTP, sends the data to an AI analysis endpoint to identify bottlenecks, optionally stores the report, and returns a ranked optimization report to the caller.
How it works Receives an optimization request via a POST webhook containing a target workflow ID and optional time range and focus. Validates the request and prepares context (request ID, workflow details, and analysis parameters) used by downstream API calls. Calls an HTTP endpoint to fetch node-level performance metrics such as durations, execution counts, and success rates. Calls a second HTTP endpoint to fetch cost and resource usage data such as AI token spend, compute time, and external API costs. Sends the collected context to an AI HTTP endpoint to rank slow and/or expensive nodes and generate optimization recommendations. Sends the optimization report metadata to a storage/notification HTTP endpoint. Aggregates the collected results into a final report with status flags, bottleneck rankings, and next steps, then returns it in the webhook response.
Setup Configure the webhook endpoint path (default: /optimize-workflow) and provide the generated webhook URL to the system that will call this optimizer. Replace the placeholder HTTP endpoints (currently httpbin.org) with your real performance metrics, cost tracking, AI analysis, and report storage/notification API URLs. If your endpoints require authentication, add the needed credentials/headers to the HTTP Request nodes and align request payloads with your APIs. Ensure the webhook request body includes workflowId (required) and optionally from/to, focus (slow|expensive|both), and minExecutions to control the analysis window and thresholds.
Related Templates
AI Weather Forecasts with MCP Integration
Real-time Weather Forecasts with MCP Tools This n8n workflow demonstrates how to integrate real-time weather intelligen...
Extract Named Entities from Web Pages with Google Natural Language API
Who is this for? Content strategists analyzing web page semantic content SEO professionals conducting entity-based anal...
Demo Workflow - How to use workflowStaticData()
This workflow demonstrates how to use the workflowStaticData() function to set any type of variable that will persist wi...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments