# Trigger चुनना — n8n के साथ AI Automation

Source: https://www.geekswithgeeks.com/hi/n8n-ai-automation/core-triggers

> Manual, schedule, webhook और app triggers की तुलना करें और test बनाम production URL का अंतर जानें।

## Workflow कैसे शुरू होता है

**Schedule** trigger timer (cron जैसा) पर चलता है। **Webhook** trigger दूसरे system के HTTP अनुरोध का इंतज़ार करता है। **App triggers** (जैसे Gmail या GitHub) उस app की घटनाओं पर चलते हैं। **Chat** trigger AI chat शुरू करता है। **Manual** trigger परीक्षण के लिए है। वही चुनें जो असली घटना के होने के तरीक़े से मेल खाए: timer पर polling सरल है, पर webhook तुरंत प्रतिक्रिया देता है।

## शुरू करें, जोड़ें, शाखा बनाएँ

सही trigger चुनें, बाहरी services सुरक्षित रूप से बुलाएँ और items को अलग रास्तों पर भेजें।

![तीन चरण: trigger, call, रास्ता।](assets/figures/n8n-ai-automation/section-2-map.svg) — चित्र 2.1 — Trigger, call और रास्ता।

## Test बनाम production webhook URLs

Webhook node दो URLs दिखाता है। Test URL सिर्फ़ तब सुनता है जब आप "Listen for test event" दबाते हैं। Production URL तभी चलता है जब workflow **activate** हो। ग़लत URL उपयोग करना webhook के "कुछ न करने" का पुराना कारण है।

```bash
# while testing in the editor
curl -X POST http://localhost:5678/webhook-test/new-lead \
  -H "Content-Type: application/json" -d '{"name":"Asha","email":"asha@example.com"}'

# after activating the workflow
curl -X POST http://localhost:5678/webhook/new-lead \
  -H "Content-Type: application/json" -d '{"name":"Asha","email":"asha@example.com"}'
```

## Live जाने को activate करें

Schedule और webhook triggers production में तभी चलते हैं जब workflow Active हो। यह भूलना तैयार workflow के कभी न चलने का सबसे आम कारण है।

**Quiz:** कौन-सा URL तभी चलता है जब आप workflow activate करें?

- [ ] Test webhook URL
- [x] Production webhook URL
- [ ] दोनों
- [ ] कोई नहीं

*Answer:* Production webhook URL. Production webhooks activate होने पर दर्ज होते हैं; test URLs सिर्फ़ manual परीक्षण में सुनते हैं।
