Add production webhook response behavior documentation
This commit is contained in:
parent
3d3ba744f9
commit
1e5a179c34
|
|
@ -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!
|
||||
Loading…
Reference in New Issue