# 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 1. Receives an optimization request via a POST webhook containing a target workflow ID and optional time range and focus. 2. Validates the request and prepares context (request ID, workflow details, and analysis parameters) used by downstream API calls. 3. Calls an HTTP endpoint to fetch node-level performance metrics such as durations, execution counts, and success rates. 4. Calls a second HTTP endpoint to fetch cost and resource usage data such as AI token spend, compute time, and external API costs. 5. Sends the collected context to an AI HTTP endpoint to rank slow and/or expensive nodes and generate optimization recommendations. 6. Sends the optimization report metadata to a storage/notifi

- **Domain**: `n8n-workflow-21442.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/21442
- Page (HTML): https://agenstry.com/agents/n8n-workflow-21442.n8n.io
- Documentation: https://n8n.io/workflows/21442
