Files
FarmaFinder/n8n/init-import.sh
T
Antoni Nuñez Romeu cc77783b7d
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
N8N first run script
2026-07-17 11:28:14 +02:00

23 lines
584 B
Bash
Executable File

#!/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."