chore: add more health info for n8n, refs NOISSUE

This commit is contained in:
2026-04-10 20:55:43 +02:00
parent ebfcfb969a
commit 4b9eb2f359
4 changed files with 315 additions and 27 deletions

View File

@@ -323,10 +323,16 @@ async def get_n8n_health():
"""Check whether the configured n8n instance is reachable."""
api_url = _resolve_n8n_api_url()
if not api_url:
return {'status': 'error', 'message': 'N8N_API_URL or N8N_WEBHOOK_URL is not configured'}
return {
'status': 'error',
'message': 'N8N_API_URL or N8N_WEBHOOK_URL is not configured.',
'api_url': '',
'auth_configured': bool(database_module.settings.n8n_api_key),
'checks': [],
'suggestion': 'Set N8N_API_URL to the base n8n address before provisioning workflows.',
}
agent = N8NSetupAgent(api_url=api_url, webhook_token=database_module.settings.n8n_api_key)
result = await agent.health_check()
return {'status': 'ok' if not result.get('error') else 'error', 'data': result}
return await agent.health_check()
@app.post('/n8n/setup')