Back to HomeDialogflow

Dialogflow CX Tutorial: Complete Guide from Beginner to Advanced

15 min min read
#Dialogflow CX#Google Cloud#AI Customer Service#Chatbot#Flow Design

Dialogflow CX Tutorial: Complete Guide from Beginner to Advanced

Dialogflow 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:

  • Environment Selection: Can test different environment versions
  • Session Parameters: View and modify current session parameters
  • Page Tracking: Real-time display of current Page
  • Intent Detection Results: Shows detected Intent and confidence score

Illustration: Dialogflow CX Console Interface Guide

Scene Description: A Dialogflow CX Console screenshot with colored frames and numbers marking each area: 1. Left navigation, 2. Central flow editor, 3. Right property panel, 4. Bottom-right test panel. Each area has brief explanatory text beside it.

Visual Focus:

  • Main content clearly presented

Required Elements:

  • Based on key elements in description

Chinese Text to Display: None

Color Tone: Professional, clear

Elements to Avoid: Abstract graphics, gears, glowing effects

Slug: dialogflow-cx-console-interface-guide


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:

  • Booking Flow: Handles all booking-related conversations
  • Query Flow: Handles order queries, status tracking
  • Support Flow: Handles complaints, returns/exchanges

Flow Components:

  • Pages: Various states (conversation nodes) within the Flow
  • Routes: Transition conditions between Pages
  • Start Page: The Flow's starting Page

Default Flows:

  • Default Start Flow: Agent's entry point, all conversations start here
  • Multiple custom Flows can be created

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:

  • In Routes, you can set "Transition to flow"
  • User says "I want to book" → Switch to Booking Flow
  • User says "See menu" → Switch to Menu Flow

Illustration: Multi-Flow Architecture Diagram

Scene Description: A flow architecture diagram showing the central Default Start Flow connected to four child Flows (Booking, Menu, Order, Support). Each child Flow shows its contained Pages internally, distinguished by different colors. Arrows show transition relationships between Flows.

Visual Focus:

  • Main content clearly presented

Required Elements:

  • Based on key elements in description

Chinese Text to Display: None

Color Tone: Professional, clear

Elements to Avoid: Abstract graphics, gears, glowing effects

Slug: dialogflow-cx-multi-flow-architecture


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:

  • Entry Fulfillment can check "Enable webhook"
  • Route Fulfillment can also enable Webhook

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.

Illustration: CX Webhook Architecture Diagram

Scene Description: An architecture diagram showing CX Webhook data flow. From left to right: User message → Dialogflow CX → Webhook Request → Cloud Functions → Backend API/Database → Webhook Response → Dialogflow CX → Reply to user. Each step labels the data type being passed.

Visual Focus:

  • Main content clearly presented

Required Elements:

  • Based on key elements in description

Chinese Text to Display: None

Color Tone: Professional, clear

Elements to Avoid: Abstract graphics, gears, glowing effects

Slug: dialogflow-cx-webhook-architecture


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:

  • Only index specific pages
  • Add metadata classification to documents

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:

  • Are answers correct
  • Is there inappropriate content
  • Are users satisfied

Illustration: RAG Q&A Flow Diagram

Scene Description: A flowchart showing the RAG Q&A process: User question → CX determines no matching Intent → Search Data Store → Retrieve relevant document snippets → Generative AI composes answer → Reply to user. Each step is represented by boxes, arrows showing data flow direction.

Visual Focus:

  • Main content clearly presented

Required Elements:

  • Based on key elements in description

Chinese Text to Display: None

Color Tone: Professional, clear

Elements to Avoid: Abstract graphics, gears, glowing effects

Slug: dialogflow-cx-rag-workflow


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:

  • Save development milestones
  • Roll back when problems occur
  • Compare differences between versions

Environment Management

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

Default Environments:

  • Draft: Latest version in development
  • Production: Externally serving version (needs to be created)

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:

  • Test new conversation flows
  • Compare different response copy
  • Validate RAG effectiveness

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:

  • Business hours queries
  • Order status queries (requires Webhook)
  • FAQ auto-answers (using RAG)
  • Human agent transfer

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

  • ask_hours: "Business hours", "What time do you open", "Open on weekends?"
  • check_order: "Check order", "Order status", "Where's my order"
  • transfer_human: "Transfer to agent", "Find a person", "I want to complain"

Step 2: Set Start Flow Routes

Add to Default Start Flow's Start Page:

  • ask_hours → Direct reply with business hours
  • check_order → Transition to Order Status Flow
  • transfer_human → Reply with transfer message

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

Illustration: CX Learning Advanced Roadmap

Scene Description: A learning roadmap starting from "CX Basics," branching into four directions: "Advanced Conversation Design," "Webhook Development," "RAG Applications," "Multi-Platform Integration." Below each direction lists related topics and suggested learning order.

Visual Focus:

  • Main content clearly presented

Required Elements:

  • Based on key elements in description

Chinese Text to Display: None

Color Tone: Professional, clear

Elements to Avoid: Abstract graphics, gears, glowing effects

Slug: dialogflow-cx-advanced-learning-path


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:

  • Planning complex conversational AI architecture
  • Considering migrating from ES to CX
  • Need multi-person collaborative Flow design
  • Want to implement RAG but unsure about effectiveness

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

Related Articles