chore: add more health info for n8n, refs NOISSUE
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user