# Workflows for Marketers

This guide walks through the workflow a marketer follows inside Treasure AI Studio — from a campaign brief to a live customer journey with email activations. You describe what you want in plain language, and the AI handles the YAML, validation, and deployment commands so you can focus on strategy.

Note
The AI generates CDP configurations (segments, journeys, activations) in the exact YAML format your Treasure AI platform expects. Every definition it produces is validated before you push it to production. You see a visual preview of the journey and can open each step to verify the logic before anything goes live.

## Objective

Enable marketers to go from "We need a re-engagement campaign for lapsed customers" to a live, validated customer journey with email activations — in one conversation, instead of clicking through separate console screens, handing work between teams, or waiting on engineering.

## A Day in the Life

The head of marketing drops a brief in your project channel: "We're seeing churn in the 30-60 day inactive segment. Build a 3-touch re-engagement journey — offer a discount on the second touch, escalate to a personal outreach on the third. I need it live by Thursday."

Normally this means: request a segment from the data team and wait for it, build the journey in the console, configure each activation, set up the email templates in Engage, and QA the result. Pieces owned by different teams, stitched together over days.

In Studio, it's one conversation. You describe the campaign strategy, the AI builds the segment, designs the journey flow, generates the email templates, configures the activations, and gives you visual previews at each step. You steer the strategy — the AI handles the implementation.

## Recommended Setup

Before starting the workflow, configure your environment:

| Setup Step | How | Why |
|  --- | --- | --- |
| **Create a work folder** | Create a work folder for campaign work and add an instruction describing your conventions — for example, the parent segment and connections you usually use | The instruction is saved as the folder's `CLAUDE.md` and applied to every chat inside it |
| **Install CDP skills** | From the Skills page, install **segment**, **journey**, **engage**, and **connector-config** | Gives the AI your CDP's YAML schemas and validation rules to follow |
| **Choose a model tier** | Use **Balanced** for most campaign work; switch to **Pro** for complex branching logic | Balances speed with reasoning quality on multi-step tasks |


### Mobile

The work folders you set up on Web or Desktop are available on Mobile too, since they're tied to your account. You can review journey previews, check on campaign status, and send follow-up instructions from your phone — useful for quick approvals or adjustments when you're away from your desk.

## Step-by-Step Workflow: Lapsed Customer Re-Engagement

### Step 1: Define the Audience

Start by describing the audience in business terms:

```
Create a segment for customers who haven't made a purchase in 30 to 60 days
but were active in the last 90 days. Call it "lapsed_reengagement".
```

**What the AI does behind the scenes:**

1. Runs `tdx ps desc` to inspect your parent segment's available attributes and behaviors
2. Determines the correct operators (`TimeWithinPast`, `Between`) and field names
3. Generates the segment YAML with proper rule structure (guided by the **segment** skill)
4. Validates the YAML with `tdx sg validate`
5. Renders a visual segment preview


Every command runs as an expandable tool call in the chat. When it finishes, the file panel shows an interactive segment preview — the rule tree, condition operators, and attribute sources — so you can verify the logic matches your intent.

Pro Tip
If the segment looks right, you can push immediately: "Push this segment." The AI runs `tdx sg push` and reports the result. But for this workflow, we'll continue to the journey first.

### Step 2: Design the Customer Journey

Now describe the journey flow in conversational terms:

```
Build a re-engagement journey with 3 stages:

Stage 1 (Awareness): Wait 1 day after entry, then send a "We miss you" email.

Stage 2 (Incentive): Wait 5 days. If they haven't purchased, send a 15%
discount email. If they purchased, end the journey.

Stage 3 (Escalation): Wait 7 days. If still no purchase, trigger a personal
outreach via a Salesforce task. If purchased, end.

Entry: the lapsed_reengagement segment we just created.
Goal: any purchase event.
```

**What the AI does:**

1. Structures the journey YAML with three stages, each containing wait steps, decision points, and activation steps (guided by the **journey** skill)
2. References the `lapsed_reengagement` segment for entry criteria
3. Defines the goal as a purchase behavior
4. Validates the YAML with `tdx journey validate`
5. Opens the journey in the journey viewer


The file panel opens the **journey viewer** — a flow diagram of the three stages, showing each wait, decision point, and activation, along with the entry segment and the goal. Review it to confirm the flow matches your brief before continuing.

### Step 3: Inspect and Adjust the Journey

Work through the journey viewer to verify each step. Activation and wait steps, the entry node, and each branch badge open a detail panel when you select them:

- A **decision** node shows the segment condition that determines the branch
- An **activation** node shows the connector configuration and field mappings
- A **wait** node shows the duration and any early-exit conditions


```
Change the Stage 2 wait from 5 days to 3 days, and make the discount 20%
instead of 15%.
```

The AI updates the YAML, re-validates, and re-renders the canvas — you see the changes reflected immediately.

### Step 4: Create the Email Templates

With the journey structure validated, create the email content:

```
Create the email templates for this journey:

Touch 1 — "We miss you" email: warm, personal tone.
Subject: "It's been a while, {{first_name}}"

Touch 2 — Discount email: urgency tone with a clear CTA.
Subject: "{{first_name}}, here's 20% off — just for you"
```

**What the AI does:**

1. Generates email template YAML with HTML content, merge tags (`{{first_name}}`), subject lines, and preheader text (guided by the **engage** skill)
2. Renders a live email preview


The file panel shows rendered email previews — full HTML with merge tags in place — so you can see how each email will look before deploying.

```
The discount email needs a bigger CTA button and a countdown timer mention
in the preheader. Fix those.
```

The AI updates the HTML template and re-renders the preview.

### Step 5: Configure Activations

With templates and journey validated, configure the activation connectors:

```
Configure the email activations to use our SendGrid connector, and the
Stage 3 Salesforce activation to create a task assigned to the account owner.
```

**What the AI does:**

1. Runs `tdx connection schema sendgrid` to discover available fields (guided by the **connector-config** skill)
2. Runs `tdx connection schema salesforce` for the Salesforce activation
3. Updates the journey YAML with `connector_config` blocks that map customer attributes to connector fields
4. Re-validates the complete configuration


The updated YAML and each schema lookup are visible in their tool calls, so you can confirm the field mappings before pushing.

### Step 6: Preview and Push

Final review before going live:

```
Show me the final journey one more time, then push everything.
```

**What the AI does:**

1. Opens the final journey in the journey viewer for one last review
2. Shows the `tdx sg push "<parent segment>"` command on an approval card, then — once you approve — runs it to deploy the segment and its journey together
3. Reports what was created and confirms the journey is live


Once pushed, customers who match the segment begin entering the journey on the next refresh cycle.

The agent normally asks for approval before every `tdx` command, not only the push, so expect cards at earlier steps too — including read-only lookups such as `tdx ps desc`. Read the command on each card before approving it; see [Approval Before tdx Commands](/products/ai-studio/security#approval-before-tdx-commands).

### Step 7: Check Status from Mobile

Later that evening, you want to verify the journey is running. Open Studio on your phone:

```
How is the re-engagement journey performing so far?
```

The AI runs a journey stats check and reports how the journey is performing — stage populations and conversion so far. Because commands run server-side, this works the same from your phone; you can keep asking follow-up questions from Mobile.

## Workflow Variations

The re-engagement campaign is one pattern. Here are other common marketer workflows:

### Quick segment for ad targeting

```
Build a segment of high-value customers (>$500 lifetime spend) in the US
who visited the pricing page in the last 7 days. Push it so I can use it
for a Google Ads audience.
```

The AI inspects the parent segment with `tdx ps desc`, writes the segment YAML (spend, geo, and recency rules), validates it with `tdx sg validate`, renders a visual rule preview, and pushes it with `tdx sg push`.

### A/B test journey

```
Create a journey that A/B tests two subject lines for our welcome email —
split 50/50, and measure by open rate after 3 days.
```

The AI writes a journey YAML with a 50/50 A/B-test step, two activation branches using different email templates, and a wait-then-decision step to measure opens, renders the canvas, then validates and pushes the journey.

### Email campaign with preview

```
Create a product launch email campaign. Use our brand template and target
the "engaged_users" segment.
```

The AI writes the template YAML with HTML content and shows an email preview, then writes the campaign YAML (audience and UTM parameters), shows a campaign preview, and deploys with `tdx engage campaign push`.

## AI Transparency: How the Orchestrator Works

Throughout this workflow, the AI is making decisions you can see and override:

| AI Decision | What You See | How to Override |
|  --- | --- | --- |
| **Segment rule operators** | YAML visible in the Write tool call | "Use `GreaterThan` instead of `Between` for the spend filter" |
| **Journey stage structure** | Canvas preview with clickable nodes | "Add a merge step before Stage 3" or "Remove the decision point" |
| **Email content and tone** | HTML preview in the file panel | "Make the CTA button red and bigger" or "Rewrite in a more urgent tone" |
| **Connector field mappings** | Config visible in the updated YAML | "Map `account_owner_email` to the Salesforce `owner_id` field instead" |
| **Push target** | CLI command visible in the Bash tool call | "Push to staging first" or "Do a dry run" |


The AI follows active skills (**segment**, **journey**, **engage**, **connector-config**) for your CDP's exact YAML schemas and validation rules. Every generated file is validated before push, and every push command supports `--dry-run` for safe testing.

## Platform-Specific Notes

| Capability | Web | Desktop (Mac) | Mobile |
|  --- | --- | --- | --- |
| Describe segments and journeys in natural language | Yes | Yes | Yes |
| Visual segment preview | Yes | Yes | No (segment YAML is shown as code) |
| Journey viewer with per-step detail panels | Yes | Yes | Yes |
| Email template preview | Yes | Yes | Yes |
| Push segments and journeys to production | Yes | Yes | Yes |


Pro Tip
Set up your campaign work folders on Desktop, then use Mobile for quick reviews, status checks, and approvals throughout the day. Your work folders are tied to your account, so they're available on every platform.

## Success Criteria: The Business Result

At the end of this workflow, you have:

- **A validated audience segment** — Targeting rules verified against the parent segment schema
- **A live customer journey** — 3-stage flow with wait steps, decision branches, and activations, visually confirmed on the canvas
- **Email templates** — HTML content previewed inline with merge tags resolved
- **Configured activations** — SendGrid for email and Salesforce for personal outreach, with field mappings verified against connector schemas
- **A record of the session** — The full conversation captures every decision and the exact commands run, from segment criteria to journey branching logic


All produced in a single session — instead of coordinating across teams and clicking through separate console UIs.

## Verification

After following this workflow, you can:

- [ ] Describe a target audience in business terms and receive a validated segment YAML
- [ ] Design a multi-stage journey with decision points and A/B tests using natural language
- [ ] Preview the journey in the journey viewer and open each step to verify logic
- [ ] Generate and preview email templates with merge tags
- [ ] Configure activation connectors using schema discovery
- [ ] Push the complete campaign to production and verify deployment


## Troubleshooting

| Issue | Solution |
|  --- | --- |
| Segment validation fails | Expand the error details from `tdx sg validate`. Common causes: referencing attributes not in the parent segment, or using an incorrect operator for the attribute type |
| The journey viewer does not render | Make sure the file uses the `.journey.yaml` (or `.journey.yml`) extension — a plain `.yaml` file opens as code, not a canvas. Then confirm the YAML is valid with `tdx journey validate` |
| Email template preview shows broken HTML | Check the HTML in the template YAML for unclosed tags or missing merge-tag syntax. Ask the AI to "fix the HTML in the email template" |
| `tdx sg push` reports a conflict | Another user may have modified the segment. Run `tdx ps desc` to check the current state, then reconcile changes before pushing again |


## Next Steps

- [Journey Viewer](/products/ai-studio/files/file-viewers#journey-viewer) — Reading a journey definition before you push it
- [Skills & Marketplace](/products/ai-studio/skills/skills) — Configure segment, journey, and engage skills
- [Agent Orchestrator](/products/ai-studio/concepts/orchestrator) — Understand how the AI chains tools together
- [AI-Generated Files](/products/ai-studio/files/artifacts) — Ask the AI to export campaign documentation as PPTX or PDF
- [Core Concepts](/products/ai-studio/concepts) — Set up work folders and install skills for campaign work