This workflow automatically checks if the local n8n version is outdated and, if so, creates a file to signal an update is needed.
n8n/
├── check_update.txt
├── check-update.sh
├── compose.yml
├── update_n8n.cron
check_update.txt
Contains a single word:
true
: Update is neededfalse
: No update requiredcheck-update.sh
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
if grep -q "true" /home/sysadmin/n8n/check_update.txt; then
# Place your update logic here
echo "Update needed - please insert update logic"
echo true > /home/sysadmin/n8n/check_update.txt
fi
Purpose:
check_update.txt
true
, executes update logic (currently a placeholder)check_update.txt
to true
update_n8n.cron
SHELL=/bin/sh
10 5 * * * /bin/sh /home/sysadmin/n8n/check-update.sh
Purpose:
check-update.sh
script daily at 5:10 AM/bin/sh
as the shell environmenthttps://registry.npmjs.org/n8n/latest
http://192.168.100.18:5678/rest/settings
echo "{{ $('If').params.conditions ? 'false' : 'true' }}" > check_update.txt
Effect: Updates check_update.txt
with "true"
if an update is needed, "false"
otherwise.
crontab update_n8n.cron
crontab -l
check_update.txt
check-update.sh
to respond to update flag