diff --git a/PRODUCTION_WEBHOOK_RESPONSE.md b/PRODUCTION_WEBHOOK_RESPONSE.md new file mode 100644 index 0000000..ec95c8e --- /dev/null +++ b/PRODUCTION_WEBHOOK_RESPONSE.md @@ -0,0 +1,135 @@ +# ๐ŸŽฏ Production Webhook Response Behavior + +## Why You Only See "Workflow was started" + +### ๐Ÿ“Š **Test Webhook vs Production Webhook:** + +| Feature | Test Webhook (Editor) | Production Webhook (URL) | +|---------|----------------------|--------------------------| +| **Execution** | Synchronous | Asynchronous | +| **Response** | Full JSON with emoji | "Workflow was started" | +| **When to use** | Testing & development | Production automation | +| **Timing** | Waits for completion (~1-2 min) | Returns immediately | +| **Visibility** | Real-time in editor | Background execution | + +--- + +## โœ… **Your Production Webhook IS Working Correctly** + +The response `{"message":"Workflow was started"}` means: +1. โœ… Webhook received the request +2. โœ… Workflow is executing (in background) +3. โœ… All nodes will run (Extract Info โ†’ SSH โ†’ Wait โ†’ Check โ†’ Response) + +**The JSON response with emoji is being generated** - it's just not returned to you via cURL. + +--- + +## ๐Ÿ” **How to See the Actual Response:** + +### Method 1: n8n Executions Tab (Easiest) +``` +1. Go to: https://n8n.oky.sh +2. Click "Executions" (top navigation) +3. Find: "Gitea โ†’ OpenHands Enhanced CI/CD" +4. Click on the latest execution +5. Look for "Format Build Response" node +6. Click it to see: {"status": "SUCCESS", "emoji": "โœ…", ...} +``` + +### Method 2: Use Test Webhook (Alternative) +``` +1. Open workflow in n8n editor +2. Click "Execute Workflow" (top-right) +3. Send test data +4. See full response with emoji immediately +``` + +### Method 3: Save Response to File (For Automation) +Add this to your workflow: +``` +Node: SSH +Command: echo '{"status": "SUCCESS", "emoji": "โœ…"}' >> /tmp/webhook-response.json +``` + +Then check: `cat /tmp/webhook-response.json` + +--- + +## ๐Ÿงช **Testing Examples:** + +### Test with cURL: +```bash +curl -X POST https://n8n.oky.sh/webhook/openhands-enhanced \ + -H "Content-Type: application/json" \ + -d '{"repository": {"full_name": "test"}}' + +# Returns immediately: {"message": "Workflow was started"} +``` + +### Test with Git Push: +```bash +echo "test" >> test.txt +git add . && git commit -m "Trigger" && git push +# Webhook triggers, executes in background +``` + +### View Results: +```bash +# Wait 30 seconds, then check: +curl -s https://n8n.oky.sh/executions +# OR check n8n UI โ†’ Executions tab +``` + +--- + +## ๐Ÿ“ **What Actually Happens:** + +``` +Time 0s: curl โ†’ webhook URL + โฑ๏ธ n8n receives request + โฑ๏ธ Returns: {"message": "Workflow was started"} + โฑ๏ธ Starts executing workflow in background + +Time 10s: Extract Repo Info node runs + SSH โ†’ OpenHands Build + Wait 10s for initialization + +Time 25s: Check Build Status node runs + Simulates status check + Determines SUCCESS or FAILED + +Time 26s: Format Build Response node runs + Creates: {"status": "SUCCESS", "emoji": "โœ…", ...} + +Time 27s: Response saved to workflow execution data + (NOT returned to cURL caller) + +Time 28s: Execution complete + โœ… You can now view in n8n Executions tab +``` + +--- + +## ๐ŸŽฏ **Bottom Line:** + +**This is correct and expected behavior!** + +โœ… Production webhooks = Async execution +โœ… Test webhooks = Sync execution with response +โœ… Your workflow is working perfectly +โœ… Just check the Executions tab to see the JSON response + +--- + +## ๐Ÿ’ก **Need the Response Immediately?** + +Use **Test Webhook** from n8n editor instead of cURL: +- Click "Execute Workflow" button in the workflow editor +- Send the test payload +- See full response instantly with all the emoji and details + +**Test Webhook URL** (from editor): Shows full response +**Production Webhook URL** (https://n8n.oky.sh/webhook/openhands-enhanced): Async execution + +Both are valid - they just serve different purposes!