2.7 KiB
2.7 KiB
🎯 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:
{
"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:
const repoInfo = $('Extract Repo Info').item.json;
The issue:
$('Node Name')syntax doesn't work in n8n v2- Should use:
$node["Extract Repo Info"].jsonor$json
🛠️ Fix: Update Node 7 to Use Current Item Data
In Node 7 "Format Build Response", replace the code with:
// 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:
- Open workflow in n8n
- Click "Execute Workflow" button
- Send test payload
- Check each node's output - you'll see the actual data flowing through
Alternative: Check Node Outputs
In n8n execution view:
- Click on Node 2 "Extract Repo Info"
- See output: Should show actual repo_full_name, commit_sha, etc.
- Click on Node 6 "Check Build Status"
- See output: Shows status and message
- Node 7 should read from both of these
✅ Expected After Fix
{
"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.