---
# System prepended metadata

title: 【Claude CLI/Gemini CLI  debug n8n Workflow】

---

# **【Claude CLI/Gemini CLI 操作 debug Workflow】**

:::info
- n8n API KEY
- 抓取 Workflow id
- debug
:::

<br/>

之前安裝了 Claude CLI、Gemini CLI
這次我想試試使用 CLI 介面有沒有辦法幫我 debug n8n workflow

##  n8n API KEY
先到 n8n setting 介面申請 api key
![截圖 2025-07-15 23.20.05](https://hackmd.io/_uploads/Bk24zl4Ile.png)

![截圖 2025-07-15 23.20.16](https://hackmd.io/_uploads/ByRXMx48xe.png)


進到 CLI 介面
```=
# 看自己想用哪一個
gemini
claude
```

指令介面輸入
(授權我選 always)
```=
# Zeabur
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
     https://catalinakuowork.zeabur.app/api/v1/workflows \
     | jq '.[] | {id, name}'
     
# localhost 
curl -H "X-N8N-API-KEY: your_api_key_here" \
     http://localhost:5678/api/v1/workflows
```
![1752592441034](https://hackmd.io/_uploads/HJ8-ZlVLle.jpg)


列出所有 Ｗorkflows

```=
# Zeabur
curl -s -H "X-N8N-API-KEY: YOUR_API_KEY" \
     https://https://catalinakuowork.zeabur.app/api/v1/workflows
     
# localhost 
curl -s -H "X-N8N-API-KEY: YOUR_API_KEY" \
     http://localhost:5678/api/v1/workflows
     
```

在 n8n UI介面複製一個 Workflow 用來測試
![截圖 2025-07-15 23.31.43](https://hackmd.io/_uploads/ry8OVl4Ixg.png)

<br/>

## 抓取 Workflow id

只抓特定的 Workflow

```=
# Zeabur
curl -s -H "X-N8N-API-KEY: eyJh..." \
  https://catalinakuowork.zeabur.app/api/v1/workflows \
  | jq '.[] | select(.name == "Spending Tracker copy") | {id, name}'
  
# Localhost
curl -s -H "X-N8N-API-KEY: YOUR_API_KEY" \
  http://localhost:5678/api/v1/workflows \
  | jq '.[] | select(.name == "stock copy") | {id, name}'

```
這樣會顯示 workflow 的 id（觸發/匯出時要用）
![1752593737692](https://hackmd.io/_uploads/HkewSxELee.jpg)

分析剛剛抓到id的 workflow，寫到本機端json
```=
# Zeabur
curl -s -H "X-N8N-API-KEY: YOUR_API_KEY" \
  https://catalinakuowork.zeabur.app/api/v1/workflows/抓到的id \
  > stock-copy.json
  
# localhost
curl -s -H "X-N8N-API-KEY: YOUR_API_KEY" \
  https://catalinakuowork.zeabur.app/api/v1/workflows/抓到的id \
  > stock-copy.json
```
![截圖 2025-07-17 14.58.46](https://hackmd.io/_uploads/H1bBkmLLll.png)

<br/>

## debug

發現 Zeabur 可能有限制，沒辦法更動
![截圖 2025-07-17 15.11.07](https://hackmd.io/_uploads/Sy-7f78Ixl.png)

改用 localhost debug
![1752756840320](https://hackmd.io/_uploads/Bk0tfOULel.jpg)


過了幾分鐘，直接幫我改好，其實只是誤用節點，但我自己不知道，甚至連 prompt 都修改得更完整
![截圖 2025-07-17 17.26.40](https://hackmd.io/_uploads/B1l1GrUUlg.png)
![截圖 2025-07-17 17.27.08](https://hackmd.io/_uploads/HJLGGBLIlx.png)

<br/>

你也想試試 Claude CLI? 看這篇～
[【Vscode Vide Coding 助手：Continue 插件、終端機官方 Claude CLI 安裝】](https://hackmd.io/@workcata/BJ93LK7Uxl)