Library / Code, Git & Developer Tools
Code, Git & Developer Tools
Update and roll back WordPress plugins and themes via SSH with Groq analysis
When you run it, it automates developer work with Groq and OpenAI / ChatGPT using Groq, SMTP Email, SSH.
What it does
## Update WordPress plugins and themes via SSH with automatic rollback Plugin updates break WordPress sites. This workflow updates every plugin and theme one at a time, checks the site after each update and rolls back automatically if something breaks. ### Who's it for Freelancers, agencies and site owners who manage WordPress sites with SSH access and want safe, unattended updates. ### How it works 1. Every Monday at 4 AM (or manually), the workflow connects via SSH, backs up the database and lists all available updates. If the site is already broken, it stops without changing anything. 2. For each plugin and theme: back up the folder, update it with WP-CLI, then check HTTP status, the WordPress error page, WordPress boot and new PHP fatal errors in the debug log. 3. If a check fails, the backup is restored and the site is verified again. Rolled-back items get one more attempt at the end. 4. Groq analyzes every failure and suggests a next step. 5. You receive an HTML email report. If a rollback fails, an emergency email goes out instead. ### How to set up 1. Copy selfheal.sh from the GitHub repository (link below) to ~/wp-selfheal/selfheal.sh on your server. 2. Open Configuration and set siteUrl, wpPath and the mail addresses. 3. Add your SSH (private key) credential to all 6 SSH nodes, plus SMTP and Groq. 4. Run it manually against a staging site first, then activate it. ### Requirements - SSH access with WP-CLI, PHP-CLI, curl and tar on the server - SMTP account - Groq API key (free tier works) ### How to customize the workflow - Change checkPaths to test more pages after each update. - Adjust keepDays and maxAttempts, or the schedule in Every Monday 4 AM. - Swap the Groq node for any other chat model. Full documentation: https://github.com/Christianzimpel/n8n-wp-self-healing-update-agent
The steps
- Manual start
- Configuration
- Prepare (DB backup, debug log, update list)
- Parse preparation
- Preparation result
- Update list
- Finish round
- Retries left?
- Process updates one by one
- Clean up
- Prepare analysis
- Failures to analyze?
- AI log analysis
- Groq
31 steps in total.
Similar automations
Monitoring, Ops & IncidentsEmail Daily Server Package Update Reports over SSH14 stepsData Sync & ETLJoin Product and Roll Data from Postgres and MySQL6 stepsData Sync & ETLPrint Product Roll Labels from MySQL and Postgres7 stepsEmail AutomationReview and approve pending WordPress posts with Gemini and Slack22 steps