HomeBlogAboutPricingContact🌐 δΈ­ζ–‡
← Back to HomeDialogflow
Dialogflow CX Tutorial: Complete Guide from Beginner to Advanced

Dialogflow CX Tutorial: Complete Guide from Beginner to Advanced

πŸ“‘ Table of Contents

Dialogflow CX Tutorial: Complete Guide from Beginner to AdvancedDialogflow CX Tutorial: Complete Guide from Beginner to Advanced

Dialogflow CX is Google's platform designed specifically for enterprise-grade conversational AI. If you need to handle complex multi-turn conversations, multi-person collaborative development, or rigorous version control, CX is a better choice than ES.

However, CX has a steeper learning curve than ES. Flow, Page, Route... these new concepts might be confusing at first. This article takes you from zero to complete mastery of Dialogflow CX's core features and advanced techniques.

If you're still deciding between CX and ES, first refer to Dialogflow CX vs ES Complete Comparison. For Dialogflow basic concepts, refer to Dialogflow Complete Guide.



CX Console Getting Started

Interface Tour

Enter the Dialogflow CX Console, and you'll see a completely different interface from ES.

Main Areas:

AreaFunction
Left NavigationAgent settings, Flow list, Intent, Entity, etc.
Central EditorVisual flow editor (most important workspace)
Right PanelSelected object property settings
Bottom-Right Test PanelConversation simulation testing

CX vs ES Interface Differences:

FeatureESCX
Conversation DesignIntent listVisual flowchart
Context ManagementContext stringsPage states
TestingRight panelBottom-right panel
Version ControlExport/ImportBuilt-in version system

Creating Your First Agent

  1. Enter Dialogflow CX Console
  2. Click "Create agent"
  3. Fill in basic information:
    • Display name: Agent name (e.g., my-cx-agent)
    • Location: asia-northeast1 (Japan, lower latency)
    • Time zone: Asia/Taipei
    • Default language: Chinese (Traditional)
  4. Click "Create"

After creation, the system automatically creates a "Default Start Flow"β€”this is the conversation starting point.

Using the Test Panel

CX's test panel is much more powerful than ES.

Basic Testing:

  1. Click the "Test Agent" button in bottom-right
  2. Enter messages to test conversation
  3. Observe responses and triggered Intents

Advanced Features:



Flow Design

Flow is CX's most core concept and its biggest difference from ES.

What Is a Flow

Flow = An independent conversation topic

Think of Flow like "chapters" in a book. Each Flow handles a specific business scenario:

Flow Components:

Default Flows:

Visual Editor Operations

CX's visual editor makes complex conversations intuitive.

Creating New Flow:

  1. Click the "+" on the left "Flows" section
  2. Enter Flow name (e.g., Booking)
  3. Click "Create"

Creating Pages in a Flow:

  1. Right-click in empty space of the flowchart
  2. Select "Add Page"
  3. Enter Page name (e.g., Ask Date)

Connecting Pages:

  1. Click the starting Page
  2. Click the "+" icon that appears on the right
  3. Drag to target Page
  4. Set transition conditions (Route)

Multi-Flow Architecture Design

Large projects should use multi-Flow architecture, with benefits:

  1. Modular: Each business logic developed independently
  2. Team Collaboration: Different people responsible for different Flows
  3. Easy Maintenance: Changing one Flow doesn't affect others

Example Architecture: Restaurant Bot

Default Start Flow
    β”‚
    β”œβ”€β†’ Booking Flow (Reservations)
    β”‚       β”œβ”€β”€ Ask Date
    β”‚       β”œβ”€β”€ Ask Time
    β”‚       β”œβ”€β”€ Ask Party Size
    β”‚       └── Confirm
    β”‚
    β”œβ”€β†’ Menu Flow (Menu Queries)
    β”‚       β”œβ”€β”€ Category Selection
    β”‚       └── Item Details
    β”‚
    β”œβ”€β†’ Order Flow (Delivery Ordering)
    β”‚       β”œβ”€β”€ Add Items
    β”‚       β”œβ”€β”€ Review Cart
    β”‚       └── Checkout
    β”‚
    └─→ Support Flow (Customer Service)
            β”œβ”€β”€ FAQ
            └── Transfer to Human

Flow Switching:


Stuck on flow design? Multi-Flow architecture planning requires experienceβ€”poor design causes pain later. Book an architecture consultation, let experienced people help you get the architecture right.



Page and State Management

Pages are "states" within a Flow, representing a certain stage of conversation.

Page Components

Each Page contains:

ElementFunction
Entry FulfillmentActions executed when entering Page (e.g., send message)
ParametersInformation this Page needs to collect
RoutesConditions for leaving this Page

Parameter Collection

CX's Parameter collection is more powerful than ES's Slot Filling.

Setting Parameters:

  1. Click "Parameters" in the Page
  2. Click "+ Add parameter"
  3. Configure:
    • Parameter name: Parameter name (e.g., date)
    • Entity type: Entity type (e.g., @sys.date)
    • Required: Whether mandatory

Automatic Prompting:

If a parameter is Required, CX will automatically prompt until collected.

Settings:
- Parameter: date
- Entity: @sys.date
- Required: Yes
- Prompt: "What date would you like to dine?"

Conversation:
Bot: What date would you like to dine?
User: Tomorrow
Bot: [Collected date = 2025-01-16]

Route Condition Design

Routes define when to leave the current Page.

Route Types:

TypeTrigger Condition
Intent routeSpecific Intent detected
Condition routeConfigured condition met
Event routeSpecific event occurs (e.g., no-match)

Condition Examples:

// All required parameters collected
$page.params.status = "FINAL"

// Specific parameter has value
$session.params.date != null

// Numeric comparison
$session.params.party_size > 10

Route Priority Order:

  1. Intent routes (highest priority)
  2. Condition routes
  3. Event handlers


Route and Condition Design

Routes are the core of CX flow control and need thorough understanding.

Intent Routes

When what the user says matches a certain Intent, the corresponding Route triggers.

Example:

Current Page: Booking.AskDate

Intent Route:
- Intent: cancel_booking
- Transition: End Flow
- Response: "OK, booking cancelled."

Effect:
User: "Never mind"
Bot: "OK, booking cancelled." [Ends Booking Flow]

Condition Routes

Based on parameter values or state judgments, can trigger without user input.

Example: Large party reservations need special handling

Condition: $session.params.party_size > 10
Transition: Booking.LargePartyConfirm
Response: "Reservations for more than 10 people require a deposit. Let me transfer you to a specialist."

Event Handlers

Handle special events to ensure conversations don't get stuck.

Common Events:

EventTrigger TimingSuggested Handling
sys.no-matchCan't understand what user saidProvide guided options
sys.no-inputUser didn't respond (voice)Prompt again
webhook.errorWebhook call failedProvide alternative

Setting Event Handlers:

  1. Click "Event handlers" in the Page
  2. Select the Event to handle
  3. Set response or transition


Advanced Webhook Development

Webhooks (also called Fulfillment) let CX call external APIs for dynamic responses.

Fulfillment Setup

Creating Webhook:

  1. Click "Manage" > "Webhooks" on the left
  2. Click "Create"
  3. Configure:
    • Display name: Webhook name
    • Webhook URL: Your API endpoint
    • Timeout: Timeout duration (recommend 5-10 seconds)

Using in Page:

Cloud Functions Integration

Google Cloud Functions is the most convenient way to deploy Webhooks.

Creating Cloud Function:

  1. Go to Google Cloud Console > Cloud Functions
  2. Click "Create Function"
  3. Configure:
    • Function name: dialogflow-cx-webhook
    • Region: Same region as Agent
    • Trigger: HTTP
    • Authentication: Allow unauthenticated (or use service account)

Basic Code (Node.js):

exports.cxWebhook = (req, res) => {
  const tag = req.body.fulfillmentInfo?.tag;
  const params = req.body.sessionInfo?.parameters;

  let response = {};

  switch (tag) {
    case 'check-availability':
      response = checkAvailability(params);
      break;
    case 'confirm-booking':
      response = confirmBooking(params);
      break;
    default:
      response = { fulfillmentResponse: { messages: [] } };
  }

  res.json(response);
};

function checkAvailability(params) {
  const { date, time, party_size } = params;

  // Call your reservation system API here
  const available = checkYourSystem(date, time, party_size);

  return {
    fulfillmentResponse: {
      messages: [
        {
          text: {
            text: [available
              ? `${date} ${time} is available. What name for the reservation?`
              : `Sorry, ${date} ${time} is full. Please choose another time.`
            ]
          }
        }
      ]
    },
    sessionInfo: {
      parameters: {
        availability_checked: true,
        is_available: available
      }
    }
  };
}

Request/Response Format

CX Webhook Request:

{
  "detectIntentResponseId": "xxx",
  "intentInfo": {
    "lastMatchedIntent": "projects/.../intents/xxx",
    "displayName": "make_booking",
    "confidence": 0.95
  },
  "pageInfo": {
    "currentPage": "projects/.../pages/xxx",
    "displayName": "Confirm Booking"
  },
  "sessionInfo": {
    "session": "projects/.../sessions/xxx",
    "parameters": {
      "date": "2025-01-20",
      "time": "19:00",
      "party_size": 4
    }
  },
  "fulfillmentInfo": {
    "tag": "confirm-booking"
  }
}

CX Webhook Response:

{
  "fulfillmentResponse": {
    "messages": [
      {
        "text": {
          "text": ["Booking confirmed!"]
        }
      }
    ]
  },
  "sessionInfo": {
    "parameters": {
      "booking_id": "B12345"
    }
  },
  "targetPage": "projects/.../pages/end-page"
}

Error Handling

Possible Webhook Errors:

ErrorCauseSolution
TimeoutAPI response too slowOptimize API or increase timeout
500 ErrorCode errorCheck Cloud Functions logs
Auth ErrorPermission issueCheck service account settings

Setting Fallback:

  1. In Page's Event handlers
  2. Add webhook.error handling
  3. Set alternative response: "System is temporarily busy, please try again later"

For more Webhook development details, refer to Dialogflow Fulfillment and API Integration Tutorial.



RAG Integration (Knowledge Base Q&A)

CX supports Data Store integration for generative Q&A based on knowledge bases (RAG).

Data Store Setup

Creating Data Store:

  1. Go to Google Cloud Console > Vertex AI Search
  2. Click "Create Data Store"
  3. Choose data source:
    • Website: Crawl website content
    • Unstructured documents: Upload PDFs, Word docs, etc.
    • Structured data: CSV, JSON, etc.

Example: Import Company FAQ Website

  1. Select "Website"
  2. Enter website URL (e.g., https://example.com/faq)
  3. Set crawl depth
  4. Click "Create"
  5. Wait for indexing to complete (may take several hours)

Generative Answer Configuration

Enable in CX Agent:

  1. Enter Agent Settings
  2. Find "Generative AI" section
  3. Enable "Generative AI agent"
  4. Connect the newly created Data Store

Set Fallback Behavior:

When no regular Intent matches, CX searches the Data Store for relevant information and uses generative AI to compose answers.

Example Conversation:

User: What's your return policy?
[Data Store finds return-related pages]
Bot: According to our policy, items can be returned unconditionally within 7 days of purchase.
     Please keep the product in its original packaging and bring your purchase receipt.
     To return, visit any store or contact customer service at 02-1234-5678.

Quality Tuning Tips

1. Adjust Search Scope

If answers are too scattered, limit Data Store scope:

2. Set Grounding

Grounding makes AI only answer based on knowledge base content, avoiding "hallucinations."

Settings:
- Grounding: Required
- No match behavior: "Sorry, I couldn't find relevant information. Please contact customer service."

3. Monitor Quality

Regularly review conversation logs:


Want to build smart customer service with RAG? RAG effectiveness depends on knowledge base quality and configuration. Book AI implementation consultation, let us help you design the best solution.



Version Control and Publishing

CX has a built-in complete version control systemβ€”essential for enterprise development.

Version Management

Creating Version:

  1. Enter Flow
  2. Click "Versions" in top-right
  3. Click "Create version"
  4. Enter version description (e.g., v1.0 - Basic booking functionality)

Version Uses:

Environment Management

Environments let you distinguish development, testing, and production environments.

Default Environments:

Creating Environment:

  1. Click "Manage" > "Environments" on the left
  2. Click "Create"
  3. Configure:
    • Display name: Environment name (e.g., production)
    • Flow versions: Select version for each Flow to use

Publishing Process:

  1. Develop and test in Draft environment
  2. After feature confirmation, create Version for each Flow
  3. Point Production environment to new Version
  4. External service updates without interruption

Traffic Split (A/B Testing)

Can split traffic to different versions to test which design works better.

Configuration:

  1. In Environment settings
  2. Assign multiple Versions for the same Flow
  3. Set traffic ratio (e.g., 80% v1.0, 20% v1.1)

Use Cases:



Practical Project: Customer Service FAQ Bot

Let's build a complete practical project integrating all concepts learned.

Project Goals

Build a customer service bot that can answer:

Architecture Design

Default Start Flow
    β”‚
    β”œβ”€ [Intent: ask_hours] β†’ Reply with business hours
    β”‚
    β”œβ”€ [Intent: check_order] β†’ Order Status Flow
    β”‚       β”œβ”€β”€ Ask Order ID (collect order number)
    β”‚       └── Show Status (call API to query)
    β”‚
    β”œβ”€ [Intent: transfer_human] β†’ Transfer to human
    β”‚
    └─ [No match] β†’ RAG knowledge base search

Implementation Steps

Step 1: Create Intents

Step 2: Set Start Flow Routes

Add to Default Start Flow's Start Page:

Step 3: Create Order Status Flow

  1. Create Flow: Order Status
  2. Start Page: Set Entry Fulfillment "Please provide your order number"
  3. Create Page: Ask Order ID
    • Parameter: order_id (Required)
    • Prompt: "Please enter order number, format is letters plus numbers"
  4. Create Route: When order_id collected
    • Enable Webhook (tag: check-order-status)
    • Transition to: Show Status Page

Step 4: Set RAG Fallback

  1. Enable Generative AI agent
  2. Connect company FAQ Data Store
  3. Set No match to use knowledge base for answers

For more detailed Intent design, refer to Dialogflow Intent and Context Complete Tutorial. For cost estimation, refer to Dialogflow Pricing Complete Analysis.



Next Steps

After completing this tutorial, you've mastered Dialogflow CX's core features. Next you can:

  1. Deep Dive into Conversation Design: Dialogflow Intent and Context Complete Tutorial
  2. Develop Backend Integration: Dialogflow Fulfillment and API Integration Tutorial
  3. Understand Pricing: Dialogflow Pricing Complete Analysis
  4. Integrate with LINE: Dialogflow LINE Bot Integration Tutorial


Need Dialogflow CX Architecture Advice?

Good architecture design can reduce maintenance costs by halfβ€”poor design can turn projects into unmaintainable "spaghetti."

If you are:

Book an architecture consultation, let experienced people help you design scalable, maintainable architecture.

Consultation is completely freeβ€”we'll reply within 24 hours.


Need Professional Cloud Advice?

Whether you're evaluating cloud platforms, optimizing existing architecture, or looking for cost-saving solutions, we can help

Book Free Consultation

DialogflowAzure
← Previous
Dialogflow CX vs ES Complete Comparison: 2026 Version Selection Guide
Next β†’
DevOpsDays Taipei 2025: Taiwan DevOps Community Activities and Learning Resources Complete Guide