N8N LLM Workflow Bulk Updater
Backend script for applying bulk model updates to workflows (use-case: updating LLMs in nodes)
About This Project
The N8N LLM Workflow Bulk Updater is a Python script that programmatically replaces outdated OpenRouter model identifiers in N8N workflows with a newer target model. It was created to address the operational burden of migrating many automations when a language model is superseded, using the case of moving dozens of workflows from GPT-4.1 Mini to GPT-5 Mini as its motivating example. The script connects to an N8N instance through its API, retrieves all workflows, scans their JSON for configured model IDs such as openai/gpt-3.5-turbo, openai/gpt-4o-mini, openai/gpt-4.1-mini, and openai/gpt-4.1-nano, and writes back updated workflows containing the replacement model.
The tool defaults to a dry run that previews affected workflows in a formatted console table before any changes are applied, and changes are only written when the --live flag is supplied. It also supports overriding the target model at runtime, authenticates using the N8N X-N8N-API-KEY header, and includes optional Cloudflare Access client credentials for instances behind Cloudflare. Configuration is handled through a .env file, and the project uses Python with a rich-based console output and standard environment-variable management.
The project is most relevant to automation engineers, consultants, and organizations that maintain large numbers of N8N workflows calling LLM providers through OpenRouter and need to standardize on newer models consistently. It may also serve as a reference for scripting bulk operations against the N8N REST API.