Complete workflow to set up RT 2.0 triggers (RT journeys) from scratch - validates parent segment RT status, discovers event tables and attributes, configures RT infrastructure (events, attributes, ID stitching), creates RT journey with activations. Use when user wants to "create realtime triggers" or "set up RT journey end-to-end".
66
83%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Orchestrates the complete RT triggers/journey setup: parent segment validation → use case discovery → data exploration → RT config → journey creation → activation deployment.
tdxtdx auth setupexport TD_API_KEY=your_keyComplete workflow with checkpoints at each step.
Step 1-7: RT Infrastructure Configuration ✓ (SHARED with rt-setup-personalization)
Step 8: Create RT Journey ✓
Step 9: Create Activation ✓
Step 10: Configure Journey Stage & Entry Criteria ✓
Step 11: Wait for RT Infrastructure Ready ✓
Step 12: Launch Journey ✓
Step 13: Verify & Test ✓SHARED STEPS - See steps/01-07-shared-rt-config.md which references:
Step 1: Validate parent segment RT status
tdx ps rt list --json | jq '.[] | select(.id=="<ps_id>") | {id, name, rt_status: .status}'Step 2: Use case discovery (Welcome Journey, Cart Abandonment, High-Value Purchase, etc.)
Steps 3-6: Data exploration (batch attributes, event tables, ID stitching, RT attributes)
Step 7: Configure RT infrastructure
# Configure event tables, key events, RT attributes, ID stitching
# Wait for RT status "ok"
while [ "$(tdx ps rt list --json | jq -r --arg ps '<ps_id>' '.[] | select(.id==$ps) | .status')" != "ok" ]; do
sleep 10
doneCheckpoints:
See steps/08-journey-creation.md for detailed implementation.
Ask user about journey trigger use case:
Create journey:
# Get folder
FOLDER_ID=$(curl -s "https://api-cdp.treasuredata.com/tree/audiences/<ps_id>/segment_folders?page%5Bsize%5D=100" \
-H "Authorization: TD1 ${TD_API_KEY}" | jq -r '.data[0].id')
# Create journey in draft state
curl -X POST "https://api-cdp.treasuredata.com/entities/realtime_journeys" \
-H "Authorization: TD1 ${TD_API_KEY}" \
-H 'Content-Type: application/vnd.treasuredata.v1+json' \
--data "{
\"attributes\": {
\"audienceId\": \"<ps_id>\",
\"segmentFolderId\": \"$FOLDER_ID\",
\"name\": \"<use_case>_journey\",
\"reentryMode\": \"reentry_unless_goal_achieved\",
\"realtimeJourneyStages\": [{\"name\": \"Stage 1\"}],
\"state\": \"draft\"
}
}"Checkpoint: Journey created in draft state.
See steps/09-activation.md for detailed implementation.
Ask user: "What activation should this journey trigger?" (Webhook, Salesforce, SendGrid, Braze)
Create authentication and activation:
# Create webhook connection
curl -X POST "https://api.treasuredata.com/v4/streaming_task_auths" \
-H "Authorization: TD1 ${TD_API_KEY}" \
--data "{\"auth_type\": \"td_webhook_out\", \"auth\": {\"url_prefix\": \"$WEBHOOK_URL\"}}"
# Create activation step
STEP_UUID=$(uuidgen | tr '[:upper:]' '[:lower:]')
curl -X POST "https://api-cdp.treasuredata.com/entities/realtime_journeys/$JOURNEY_ID/activations" \
-H "Authorization: TD1 ${TD_API_KEY}" \
--data "{
\"attributes\": {
\"stepUuid\": \"$STEP_UUID\",
\"connectionId\": \"$CONNECTION_ID\",
\"connectorType\": \"td_webhook_out\"
}
}"Checkpoint: Activation created and linked to journey.
See steps/10-journey-config.md for detailed implementation.
Link activation to journey stage with entry criteria:
# Get trigger event ID
KEY_EVENT_ID=$(tdx api "/audiences/<ps_id>/realtime_key_events" --type cdp | \
jq -r '.data[] | select(.name=="<trigger_event>") | .id')
# Configure stage
curl -X PATCH "https://api-cdp.treasuredata.com/entities/realtime_journeys/$JOURNEY_ID" \
-H "Authorization: TD1 ${TD_API_KEY}" \
--data "{
\"attributes\": {
\"realtimeJourneyStages\": [{
\"id\": \"$STAGE_ID\",
\"steps\": {
\"$STEP_UUID\": {
\"type\": \"TriggeredActivation\",
\"journeyActivationStepId\": \"$ACTIVATION_ID\"
}
},
\"entryCriteria\": {
\"keyEventCriteria\": {
\"keyEventId\": \"$KEY_EVENT_ID\",
\"keyEventFilters\": {\"type\": \"And\", \"conditions\": []}
}
}
}]
}
}"Checkpoint: Journey stage configured with entry criteria.
See steps/11-13-launch-verify.md for detailed implementation.
Step 11: Wait for RT infrastructure ready
while [ "$(tdx ps rt list --json | jq -r --arg ps '<ps_id>' '.[] | select(.id==$ps) | .status')" != "ok" ]; do
sleep 10
doneStep 12: Launch journey
curl -X PATCH "https://api-cdp.treasuredata.com/entities/realtime_journeys/$JOURNEY_ID" \
-H "Authorization: TD1 ${TD_API_KEY}" \
--data '{"attributes": {"state": "launched"}}'Step 13: Verify and test
# Verify journey launched
curl "https://api-cdp.treasuredata.com/entities/realtime_journeys/$JOURNEY_ID" \
-H "Authorization: TD1 ${TD_API_KEY}" | jq '.data.attributes.state'
# Expected: "launched"Console URL:
https://console-next.${REGION}.treasuredata.com/app/ps/<ps_id>/e/<journey_id>/rtj/da/jeCheckpoints:
This orchestrator ensures all checkpoints are met:
For RT Personalization instead, use the rt-setup-personalization skill which shares Steps 1-7.
Use RT Journeys when:
Use RT Personalization when:
Can use both together:
treasure-data/td-skills
9f8ee16
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.