Guides/How to Build Customer Journeys/Building Customer Journeys with Courier

Chapter 2

Building Customer Journeys with Courier

Hands-on walkthrough of Courier's Journeys platform from Segment integration to production deployment. Covers trigger configuration, visual workflow design, conditional branching, delays, fetch data nodes, throttling, and channel-specific template creation within send nodes. Includes code examples and testing workflows.

How to Build Customer Journeys

Courier's Journeys combines visual workflow design with deep CDP integrations and omnichannel orchestration, enabling cross-functional teams to ship sophisticated customer journeys without custom infrastructure.

Journey Anatomy: Triggers, Logic, and Actions

Customer journeys consist of three fundamental components:

Triggers determine when journeys begin. You have two options: Segment event triggers respond when Twilio Segment forwards behavioral events automatically. API triggers invoke journeys directly from application code.

Journey Triggers configuration panel

Logic controls journey flow through branching and data enrichment. Branch nodes evaluate conditions and route users. Delay nodes pause execution. Fetch nodes pull information from external APIs. Throttle nodes control messaging frequency.

Actions execute operations within journeys. Send nodes deliver notifications through configured channels. Each includes an integrated template designer with personalization and send time configuration.

Journey Triggers: Starting Workflows

API Triggers

API triggers let you invoke journeys directly from application code by calling Courier's Send API:

Copied!

await courier.send({
message: {
to: { user_id: "user_123" },
template: "trial-onboarding",
data: {
trial_duration: 14,
plan_type: "enterprise",
user_name: "Sarah"
}
}
});

CDP Integration Triggers

CDP integrations through Segment or RudderStack forward behavioral events automatically. Your application instruments the CDP once with track, identify, and group calls. The CDP handles routing to Courier. When you add new journeys, you configure triggers for existing events rather than instrumenting new API calls.

Choosing Your Trigger Approach

  • Segment event triggers work best for behavioral journeys responding to product usage
  • API triggers work best for transactional workflows tightly coupled to application logic

Most products use both. For this guide, we focus primarily on Segment event triggers because they provide the richest behavioral foundation.

Setting Up Segment Integration

Twilio Segment operates as the central nervous system for customer data. It collects behavioral events, unifies them with profile data, and routes everything to your tools.

Twilio Segment Automation in Courier for event-driven notifications

Configure Courier as a Segment destination:

  1. Log into Segment, navigate to Destinations catalog, search for Courier
  2. Select which Source should send data (typically your production JavaScript source or server-side source)
  3. Add your Courier API key from API Keys section
  4. Enable the destination

Verify in Courier: Navigate to Integrations and select Segment. Learn more about configuring integrations.

Event Types

Track events capture user actions like trial_started, feature_activated, or payment_failed. The event name becomes available as a trigger option. Properties become data variables.

Identify events update user profiles with traits like name, email, company, plan type.

Group events establish relationships between users and organizations, useful for B2B multi-tenant applications.

For open-source alternatives, RudderStack provides identical capabilities through the Courier destination.

Designing Your First Journey

Journey design happens through Journeys, a visual canvas where you drag nodes to build multi-step workflows. Navigate to Journeys in Courier Studio and click "Create Journey."

Configure Your Trigger

Click the trigger placeholder and select "Segment" from trigger types. Type the event name (like trial_started) and add filters to match specific events (like data.plan_type = "enterprise").

Add Your First Send

Click the + button below the trigger and select "Send." Configure:

  • Template: Select existing or create new
  • Recipient: Use ${profile.user_id} to target the user who triggered the journey
  • Data: Pass journey-specific variables like ${data.trial_duration}

Connect nodes by dragging from the connection point at the bottom of one node to the top of another. Save with a descriptive name. Test before publishing to production.

Creating Omnichannel Send Steps

Send nodes deliver messages to users through specific channels. To create omnichannel delivery, combine multiple send nodes with conditional branching.

Omnichannel notification routing configuration

Channel-Specific Templates

When you add a send node, select which channel it targets. The template editor provides channel-appropriate controls: email editors include subject lines and HTML, SMS editors have character counting, Slack editors use Block Kit formatting.

Conditional Channel Routing

Use if/then nodes to check channel availability:

  1. Check if profile.slack_token exists → If yes, send via Slack
  2. If no, check if profile.push_token exists → If yes, send via push
  3. If no, send via email as fallback

Variable Substitution

Use Handlebars syntax for dynamic content:

  • {{profile.name}} for user's name from profile
  • {{data.feature_name}} for event properties

For developers preferring code:

Copied!

await courier.send({
message: {
to: { user_id: "user_123" },
template: "trial-welcome-email",
data: {
trial_duration: 14,
features_included: ["reporting", "integrations", "api_access"]
}
}
});

Building Conditional Logic with Branch Nodes

Branch nodes create decision points where journeys evaluate conditions and route users accordingly.

Condition Types

  • Data conditions evaluate properties from triggering events: data.setup_completed === true
  • Profile conditions evaluate user attributes: profile.company_size > 500
  • Step reference conditions evaluate results from previous sends: refs.welcome_email.status === "CLICKED"

Example: Onboarding Branch

After sending a welcome email and waiting three days, check setup completion:

  • True branch: Send advanced feature education
  • False branch: Send setup assistance

Nested branches create sophisticated routing. After checking setup completion, check engagement level. Route high-engagement users to expansion conversations, low-engagement users to reactivation.

Adding Delays and Timing Controls

Delay nodes pause journey execution for specified durations or until specific times.

Duration Delays

Set delays like "3 days", "24 hours", or "1 week" between steps to space out communication naturally.

Time-Specific Delays

Delay until "9am in user's timezone tomorrow" ensures follow-ups arrive during business hours regardless of signup time.

Timezone Handling

Courier handles timezone logic based on user profile. If you set profile.timezone = "America/New_York", delays use that timezone. Without explicit timezone, Courier defaults to UTC.

time windows

Fetching External Data with API Calls

Fetch data nodes pull contextual information from your APIs into journey context.

Configuration

  • URL: Use variable interpolation like https://api.yourcompany.com/accounts/${profile.account_id}/health
  • Method: GET for retrieving data, POST for triggering actions
  • Authentication: Bearer tokens, API keys, or basic auth (store credentials in Courier settings)

Merge Strategies

  • Replace: Overwrites all journey data with API response
  • Overwrite: Merges response, overwriting existing properties
  • Soft-merge: Only adds properties that don't already exist
  • None: Stores response separately

Error Handling

Add conditional logic to check whether fetch succeeded: data.health_score exists routes users with data one way, failed fetches another way.

Creating Dynamic Audience Segments

Audiences automatically include or exclude users based on rules you define, evaluated in real-time.

Building Audience Rules

Create conditions like:

  • profile.plan_type EQUALS "enterprise_trial"
  • profile.features_activated LESS THAN 3

Combine with AND/OR logic for precise segments.

Operators by Data Type

  • Equality: is, is not
  • String: includes, does not include, starts with, ends with
  • Numeric: greater than, less than, greater than or equal to
  • Date: after, before

Segment profile data from your CDP integration powers audience rules. When Segment sends identify events with traits, these become profile attributes available for audience rules.

Controlling Notification Frequency with Throttle

Throttle nodes control how frequently journeys send to prevent notification fatigue.

Configuration

  • Throttle window: Time period during which sends are limited (1 hour, 1 day, etc.)
  • Per-user throttling: Limits sends to individual users
  • Global throttling: Limits total sends across all users

Example: A collaboration platform with 1-hour throttling on comment notifications. Users receive the first comment immediately, additional comments within the hour get suppressed, next comment after an hour triggers a new notification.

Designing Templates in Journeys

Templates are channel-specific, created directly within send nodes as you build journeys.

Template design for notification content creation

Content Blocks

Drag-and-drop text, image, and action blocks. Blocks adapt to channel capabilities: buttons work in email and Slack, become text links in SMS.

Handlebars Personalization

Handlebars personalization makes templates dynamic:

Copied!

{{#if (condition (var "profile.plan_type") "==" "enterprise")}}
Your enterprise features are now active.
{{else}}
Upgrade to enterprise for advanced capabilities.
{{/if}}

Template Conditions

Apply conditions to content blocks to show/hide based on user data. Show premium features block only when profile.plan_type === "enterprise". One template serves multiple segments through conditional rendering.

Configuring Send Times

Timezone-Aware Delivery

Configure "9am in user's timezone" so New York users receive at 9am EST while London users receive at 9am GMT.

Quiet Hours

Configure quiet hours like "7pm-9am weekdays" for non-urgent messages. Critical alerts can override.

Optimal Windows

Configure send windows like "9am-11am" and Courier delivers when users historically engage most.

Testing and Debugging

Test mode verifies journey logic before production. Click Test and provide sample event data. Watch execution in real-time as each node highlights during execution.

Testing Scenarios

  • Test with users who completed setup and users who didn't
  • Test different plan types for audience filtering
  • Test different engagement levels for routing logic

Message Logs

View delivery history and logs to see delivery status, channels attempted, and any errors. Search by user ID, template name, or journey name.

Message logging and analytics dashboard

Common Errors

  • "Recipient has no contact information": User profile lacks email, phone, or device tokens
  • "Message filtered by user preferences": User opted out of notification category
  • "Template not found": Journey references deleted template
  • "Rate limit exceeded": Provider rate limits hit

Analytics

View journey analytics for completion rates, drop-off points, and engagement metrics.

Template analytics for notification performance

  • Channel-level: Email open rates, SMS delivery rates, push engagement
  • Journey-level: Overall flow performance, drop-offs, branch usage
  • Template-level: Message variation performance, subject line testing

Ready to build your first journey? Start free or request a demo.


Previous chapter

Understanding B2B Customer Journey Management

Why linear messaging automation fails product-led companies and what behavior-based journey building actually requires. This chapter covers the platform choice between marketing automation, developer-first tools, and cross-functional infrastructure. Explains how CDPs like Segment enable behavior-driven workflows and why omnichannel delivery matters beyond email.

Next chapter

Advanced Capabilities and Use Cases

Sophisticated orchestration patterns including event-driven triggers, multi-journey coordination, and Handlebars personalization tied to CDP data. Features detailed industry implementations for SaaS trial onboarding, healthcare patient engagement, HR tech employee lifecycle, and marketplace transaction coordination with expected outcomes.

Multichannel Notifications Platform for SaaS

Products

Platform

Integrations

Customers

Blog

API Status

Subprocessors


© 2025 Courier. All rights reserved.