Agent skill

journey

Load when the client wants to create, edit, or manage a CDP customer journey. Use for building journey YAML with segments, activations, and stage steps, modifying journey stages or flow logic (decision points, condition waits, A/B tests), or pushing journey changes to Treasure Data. Also load when the client wants to analyze journey performance, query journey tables, create journey dashboards, or generate journey action reports.

Stars 16
Forks 23

Install this agent skill to your Project

npx add-skill https://github.com/treasure-data/td-skills/tree/main/tdx-skills/journey

SKILL.md

tdx Journey - CDP Journey Orchestration

Quick Reference

Task Guide
Build journey YAML Follow the 5 steps below
Analyze journey performance Follow the analysis workflow below
Create a new journey version Follow the version creation below

Analysis Workflow

You MUST read the reference files using the Read tool before doing anything else. These contain domain-specific data models and workflows that are NOT guessable.

  1. Read references/analyze.md (MANDATORY) — 5-phase analysis workflow
  2. Read references/journey-table.md (MANDATORY) — journey table data model, column naming, state logic
  3. Follow the phases in references/analyze.md in order

Version Creation

You MUST read references/version-create.md using the Read tool before doing anything else. Version creation clones the existing journey — do NOT rebuild from scratch, but refer to Build Process templates for correct YAML syntax.

Build Process

Build journey YAML incrementally through 5 steps.

FIRST: Create a TODO list with one task per step before starting any work. This ensures you follow the step-by-step process and do not skip ahead. Mark each task as in_progress when you start it and completed when done.

CRITICAL RULES:

  • You MUST read the template file for each step using the Read tool before doing anything else. The templates contain required discovery commands and instructions. Do NOT write YAML from memory.
  • Complete steps in order, one at a time. NEVER skip or combine steps.

Workflow for EACH step:

  1. Read the template file (MANDATORY — use Read tool on the template path)
  2. Run the discovery commands listed in the template (MANDATORY — do NOT guess values)
  3. Ask the client for the required information (if not already provided)
  4. Show the design/plan and get client confirmation — this is the ONE confirmation point per step
  5. Write the updated YAML to the journey file
  6. Immediately proceed to the next step — do NOT ask "shall we proceed?" or "please review". The client already confirmed in step 4.

File location: ./segments/(parent-segment-name)/journey-name.yml

Prerequisites

bash
tdx sg pull "Parent Segment Name"   # Pull parent segment data (sets context)

Commands

bash
tdx journey pull                             # Pull all journeys to YAML
tdx journey pull path/to/journey.yml         # Pull specific journey
tdx journey validate path/to/journey.yml     # Validate YAML locally (offline)
tdx journey push --dry-run                   # Preview changes against API
tdx journey push --yes                       # Push journey
tdx journey push path/to/journey.yml --yes   # Push specific journey
tdx journey pause "Journey Name"             # Pause running journey
tdx journey resume "Journey Name"            # Resume paused journey
tdx journey view "Journey Name" --include-stats

The 5 Steps

Step What to do Template
1 Criteria segments (goal, entry/exit, milestone) templates/step1-criteria.yml
2 Decision point branches + condition wait segments templates/step2-decisions.yml
3 Activations templates/step3-activations.yml
4 Journey structure + stage steps (one stage at a time) templates/step4-journey.yml
5 Validate and push (see below)

Start with Step 1: Read templates/step1-criteria.yml and follow the instructions inside.

Step 5: Validate, Preview, and Push

After completing Step 4:

1. Validate

bash
tdx journey validate path/to/journey.yml   # Local validation
tdx journey push --dry-run                 # API validation

Fix any errors before proceeding.

2. Preview (MANDATORY before push)

Call preview_journey with the YAML file path. Ask the client to verify the visual flow structure (stage names, branch paths, merge and end points) before pushing. Do NOT skip this step.

3. Push

bash
tdx journey push path/to/journey.yml --yes

Use TD Console "Simulation Mode" to validate before launching.

Segment References

  • Embedded (recommended): segment: my-segment (defined in segments: section — always create new segments this way)
  • External ref: segment: ref:Segment Name (references a journey-type segment from another journey)

ref: limitations

ref: can ONLY reference journey-type segments (kind=3) — segments that were created by another journey's push. It does NOT work with regular child segments created via tdx sg push.

Valid workflow for ref::

  1. tdx journey pull "Existing Journey" → segments appear as ref:SegmentName
  2. Create a new journey YAML referencing those same segments via ref:
  3. tdx journey push → works because the referenced segments are already journey-type

Do NOT search for existing batch segments with tdx sg list and reference them with ref:. This will resolve the ID but the journey API will reject it.

When in doubt, use embedded segments. They are always safe and give you full control over the rule definition.

Goal Target (Optional)

Goal is defined per version entry inside journeys. When met, optionally route users to another journey:

yaml
journeys:
  - state: draft
    goal:
      name: Made Purchase
      segment: purchasers
      target:                    # Optional: jump when goal met
        journey: Post-Purchase Journey
        stage: Thank You
    stages:
      # ...

Wait Step Options

yaml
# Duration wait
- type: wait
  name: Wait 7 Days
  next: Next Step
  with:
    duration: 7
    unit: day                          # day | week

# Condition wait (NO top-level next: — paths inside condition)
- type: wait
  name: Wait for Purchase
  with:
    condition:
      segment: made-purchase
      next: Thank You Path
      timeout:
        duration: 14
        unit: day
        next: Timeout Path

Other wait options: wait_until: "2025-04-01" | days_of_week: ["monday", "wednesday", "friday"]

API constraint: A wait step must follow every activation step (place after merge if activation → merge).

Limits: Max 8 stages (local), 120 events/journey, 70 events/stage, 30 versions (API)

Best Practices

  • Frequency capping: Use wait steps between activations to control message frequency. Avoid sending more than 1 message per day per channel.
  • Consent management: Include opt-in/subscription status in entry_criteria or exit_criteria segments (e.g., email_opt_in = true).
  • Suppression: Use exit_criteria to remove users who should stop receiving messages (e.g., recent purchasers, open support tickets).
  • Reentry mode: Use no_reentry for one-time campaigns, reentry_unless_goal_achieved for ongoing programs, reentry_always for recurring triggers.

Related Skills

  • connector-config - connector_config fields for activations
  • validate-journey - Validation rules reference
  • segment / validate-segment - Segment rule syntax
  • parent-segment - Parent segment management

Expand your agent's capabilities with these related and highly-rated skills.

treasure-data/td-skills

email-campaign

This skill should be used when the user asks to "create an email", "build an email campaign", "design an email template", "generate an email for a segment", "preview an email", or "push an email to Engage". Generates enterprise-grade HTML email templates with live preview in Treasure Studio and natural language editing, then pushes the final version to Treasure Engage.

16 23
Explore
treasure-data/td-skills

action-report

YAML format reference for action reports rendered via preview_action_report. MUST be read before writing any action report YAML — defines the report structure (title, summary, actions array) and action item fields (as_is, to_be, reason, priority, category, impact) with incremental build workflow. Required by seo-analysis and any skill that produces prioritized recommendations.

16 23
Explore
treasure-data/td-skills

grid-dashboard

YAML format reference for grid dashboards rendered via preview_grid_dashboard. MUST be read before writing any dashboard YAML — defines the page structure, 6 cell types (kpi, gauge, scores, table, chart, markdown), grid layout rules, cell merging syntax, and incremental build workflow. Required by seo-analysis and any skill that produces visual data dashboards.

16 23
Explore
treasure-data/td-skills

seo-analysis

Runs SEO and AEO (Answer Engine Optimization) analysis on websites or specific pages. Use when the user mentions SEO, AEO, search rankings, search optimization, or wants to analyze how their pages perform in search engines and AI answers. Produces a data dashboard and action report with before/after recommendations.

16 23
Explore
treasure-data/td-skills

aps-doc-core

Core documentation generation patterns and framework for Treasure Data pipeline layers. Provides shared templates, quality validation, testing framework, and Confluence integration used by all layer-specific documentation skills.

16 23
Explore
treasure-data/td-skills

aps-doc-id-unification

Expert documentation generation for ID unification layers. Documents identity resolution algorithms, merge strategies, match rules, entity graphs, and multi-workflow orchestration. Use when documenting ID unification processes.

16 23
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results