{
  "schema_version": "1.0",
  "journey": {
    "key": "product_search",
    "name": "جست‌وجوی محصول در فروشگاه",
    "description": "نمونه آماده فاز ۳.۱؛ محصول موجود را از کاتالوگ زنده فروشگاه نشان می‌دهد.",
    "start": "start"
  },
  "variables": {"product_query": {"type": "string"}},
  "nodes": [
    {"id": "start", "type": "start", "next": "ask_product"},
    {"id": "ask_product", "type": "question", "text": "دنبال چه محصولی هستید؟ نام یا ویژگی آن را بنویسید.", "save_to": "product_query", "next": "lookup"},
    {"id": "lookup", "type": "product_finder", "text": "این محصولات موجود را ببینید:", "filters": {"q": "{{product_query}}", "orderby": "popularity"}, "save_result": "products", "on_success": "found", "on_empty": "empty", "on_error": "error"},
    {"id": "found", "type": "message", "text": "برای دیدن جزئیات یا خرید، روی محصول موردنظرتان بزنید.", "next": "end"},
    {"id": "empty", "type": "message", "text": "در حال حاضر محصول موجودی با این مشخصات پیدا نکردم. نام دیگری امتحان کنید.", "next": "retry"},
    {"id": "error", "type": "message", "text": "فعلاً دریافت محصولات ممکن نیست. لطفاً کمی بعد دوباره تلاش کنید.", "next": "end"},
    {"id": "retry", "type": "buttons", "text": "جست‌وجوی دیگری انجام دهیم؟", "options": [{"label": "بله، دوباره جست‌وجو کن", "value": "retry", "next": "ask_product"}, {"label": "خیر", "value": "end", "next": "end"}]},
    {"id": "end", "type": "end"}
  ]
}
