mvp-factory-openhands/TROUBLESHOOTING_UNKNOWN.md

107 lines
2.7 KiB
Markdown

# 🎯 Workflow Complete! But Data Shows "unknown"
## ✅ Current Status
The workflow is **working perfectly**:
- All nodes execute
- No errors
- Completes successfully
- Returns proper structure
## ❌ Issue: Data Shows "unknown"
**Current output:**
```json
{
"status": "SUCCESS",
"repo": "unknown", Should be: "gitadmin/test-repo"
"branch": "main",
"commit": "N/A", Should be: "abc123"
"message": "Build completed successfully",
"timestamp": "2025-12-01T19:02:06.631Z",
"retry_count": 0,
"emoji": "✅"
}
```
## 🔍 Root Cause
Node 7 tries to reference Node 2 data using:
```javascript
const repoInfo = $('Extract Repo Info').item.json;
```
**The issue:**
- `$('Node Name')` syntax doesn't work in n8n v2
- Should use: `$node["Extract Repo Info"].json` or `$json`
## 🛠️ Fix: Update Node 7 to Use Current Item Data
In Node 7 **"Format Build Response"**, replace the code with:
```javascript
// Use $json to get data from previous node (Node 6)
const buildStatus = $json;
// The repo/branch/commit data comes from Node 2 "Extract Repo Info"
// We need to get it from the workflow data flow
const repoInfo = $node["Extract Repo Info"].json;
const result = {
status: buildStatus.status,
repo: repoInfo.repo_full_name,
branch: repoInfo.branch,
commit: repoInfo.commit_sha ? repoInfo.commit_sha.substring(0, 8) : 'N/A',
message: buildStatus.message,
timestamp: new Date().toISOString(),
retry_count: ($workflow.staticData && $workflow.staticData.retry_count) || 0
};
if (result.status === 'SUCCESS') {
result.emoji = '✅';
} else if (result.status === 'FAILED') {
result.emoji = '❌';
} else {
result.emoji = '⚠️';
}
return result;
```
### Alternative (Simpler): Use Test Webhook
The easiest way to see the full data flow is to use the **Test Webhook** from n8n editor:
1. Open workflow in n8n
2. Click **"Execute Workflow"** button
3. Send test payload
4. Check each node's output - you'll see the actual data flowing through
### Alternative: Check Node Outputs
In n8n execution view:
1. Click on **Node 2 "Extract Repo Info"**
2. See output: Should show actual repo_full_name, commit_sha, etc.
3. Click on **Node 6 "Check Build Status"**
4. See output: Shows status and message
5. Node 7 should read from both of these
## ✅ Expected After Fix
```json
{
"status": "SUCCESS",
"repo": "gitadmin/test-repo", Actual repo name
"branch": "main",
"commit": "abc12345", First 8 chars of commit
"message": "Build completed successfully",
"timestamp": "2025-12-01T19:02:06.631Z",
"retry_count": 0,
"emoji": "✅"
}
```
## 🎯 Bottom Line
**Your workflow IS WORKING!**
The "unknown" values are just a data reference issue, not a functional problem.