# 🎯 STEP-BY-STEP: Fix Node 7 Data (Follow Exactly) ## The Problem: ``` Node 2 has: repo_full_name = "gitadmin/test-repo" Node 7 wants: repo_full_name BUT: Node 3 loses the data! ❌ ``` ## The Solution: **Store data in a "shared box" (staticData) that all nodes can access** --- ## STEP 1: Fix Node 2 1. Open **Node 2 "Extract Repo Info"** 2. Find this line in the code: ```javascript return { repo_name: repoName, repo_full_name: repoFullName, ... }; ``` 3. **ADD THESE LINES BEFORE the return statement:** ```javascript // NEW: Store data in shared storage $workflow.staticData = $workflow.staticData || {}; $workflow.staticData.repo_info = { repo_name: repoName, repo_full_name: repoFullName, repo_clone_url: repoCloneUrl, branch: branch, commit_sha: commitSha, commit_message: commitMessage, pusher: pusher }; ``` 4. **Keep the existing return statement too** (don't delete it) --- ## STEP 2: Fix Node 7 1. Open **Node 7 "Format Build Response"** 2. **REPLACE ALL CODE** with: ```javascript // NEW: Read from shared storage const repoInfo = $workflow.staticData.repo_info || {}; const buildStatus = $json; const result = { status: buildStatus.status || 'SUCCESS', repo: repoInfo.repo_full_name || 'unknown', branch: repoInfo.branch || 'main', commit: repoInfo.commit_sha ? repoInfo.commit_sha.substring(0, 8) : 'N/A', message: buildStatus.message || 'Build completed', 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; ``` --- ## STEP 3: Save and Test 1. Click **Save** (top-right) 2. Test with curl: ```bash curl -X POST https://n8n.oky.sh/webhook/openhands-enhanced \ -H "Content-Type: application/json" \ -d '{"repository": {"full_name": "gitadmin/test-repo"}, "commits": [{"message": "Test"}]}' ``` 3. Check n8n Executions → Node 7 output --- ## Expected Result: ```json { "status": "SUCCESS", "repo": "gitadmin/test-repo", ← NOW SHOWS ACTUAL NAME! "branch": "main", "commit": "abc12345", ← NOW SHOWS ACTUAL COMMIT! "message": "Build completed successfully", "emoji": "✅" } ``` --- ## Visual Summary: ``` Node 2: Creates data → Saves to "shared box" ($workflow.staticData) ↓ Node 3: SSH runs → (data stays in shared box) ↓ Node 7: Reads from "shared box" → Has all data! ✅ ``` The "shared box" (staticData) persists across all nodes!