N8N first run script
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
Run Tests on Branches / Detect Changes (push) Successful in 13s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / PIP Platform Tests (push) Has been skipped

This commit is contained in:
Antoni Nuñez Romeu
2026-07-17 11:28:14 +02:00
parent 418694cb08
commit cc77783b7d
3 changed files with 62 additions and 7 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh
# One-shot init: import workflows into n8n on first deploy.
# Skips if already imported (flag file in shared volume).
set -e
FLAG="/home/node/.n8n/.workflows-imported"
if [ -f "$FLAG" ]; then
echo "[n8n-init] Workflows already imported, skipping."
exit 0
fi
echo "[n8n-init] Waiting for n8n to be ready..."
until wget -qO /dev/null http://n8n:5678/healthz 2>/dev/null; do
sleep 2
done
echo "[n8n-init] Importing workflows from /home/node/workflows/..."
n8n import:workflow --separate --input=/home/node/workflows/
touch "$FLAG"
echo "[n8n-init] Import complete."