The original docs described two n8n workflows but the repository only ever shipped one (return-processing); the sketched second workflow (knowledge sync) depends on RAGcore, which isn't connected here, so it stays deferred. Add POST /api/v1/integrations/n8n/scheduled-scan (X-Service-Token protected, same pattern as the return callback), calling the same run_scan() the manual "Run quality scan" UI action uses and recording a service-actor data_quality_scan_run audit event. run_scan() already only creates an issue for a condition without one open, so overlapping triggers do no duplicate domain work. n8n/mobilityops-scheduled-quality-scan.json (hourly schedule + manual test trigger, both feeding the same HTTP call) ships "active": false so it can't fire anywhere until deliberately published. Verified live against the local n8n instance via the Manual test trigger: full green execution, and the resulting data_quality_scan_run audit event (actor_type=service, actor_label="n8n scheduled scan") confirms the real round trip, not just a contract test. deploy/unraid/setup-scheduled-scan.sh mirrors the existing return-workflow publish script for the shared Unraid n8n.
48 lines
1.5 KiB
Makefile
48 lines
1.5 KiB
Makefile
.PHONY: up down logs test lint seed reset n8n-setup n8n-setup-scan demo e2e
|
|
|
|
up:
|
|
docker compose up --build -d
|
|
|
|
down:
|
|
docker compose down
|
|
|
|
logs:
|
|
docker compose logs -f --tail=200
|
|
|
|
test:
|
|
docker compose run --rm api pytest
|
|
|
|
lint:
|
|
docker compose run --rm api ruff check .
|
|
docker compose run --rm api mypy app
|
|
|
|
seed:
|
|
docker compose exec api python -m app.cli seed --reset
|
|
|
|
reset:
|
|
docker compose down -v
|
|
docker compose up --build -d
|
|
|
|
# One-time per environment: imports and activates the n8n return-processing workflow.
|
|
# The n8n owner account itself cannot be scripted safely and must be created once at
|
|
# http://localhost:5678/setup (any email/password, no verification required) before
|
|
# this target's activation takes effect. See docs/17-runbook.md.
|
|
n8n-setup:
|
|
docker compose exec n8n n8n import:workflow --input=//imports/mobilityops-return-processing.json
|
|
docker compose exec n8n n8n publish:workflow --id=mobilityops-return-processing
|
|
docker compose restart n8n
|
|
|
|
# One-time per environment: imports and activates the scheduled quality-scan workflow.
|
|
# Same owner-account precondition as n8n-setup above.
|
|
n8n-setup-scan:
|
|
docker compose exec n8n n8n import:workflow --input=//imports/mobilityops-scheduled-quality-scan.json
|
|
docker compose exec n8n n8n publish:workflow --id=mobilityops-scheduled-quality-scan
|
|
docker compose restart n8n
|
|
|
|
# Full deterministic demo bootstrap: build, migrate (automatic on api startup), seed.
|
|
demo: up
|
|
docker compose exec api python -m app.cli seed --reset
|
|
|
|
e2e:
|
|
cd frontend && npx playwright test
|