Skip to main content

Save, Export, and AI Generation

Once audience rules are validated and estimated, DriveMetaData provides persistence actions to save the definition, clone variants, export verification samples, or rapidly bootstrap new rule sets using natural-language AI generation.


1. Module Overview & Business Outcomes​

This module governs the transition from experimentation to production deployment:

  • Permanent Persistence: Commit audience definitions for automated campaign and ad network synchronization.
  • Drafts & Variants: Save work-in-progress drafts or duplicate existing definitions to create A/B test variations without altering baseline logic.
  • Natural-Language AI Rule Builder: Describe marketing criteria in plain English and automatically translate it into structured Boolean condition cards.
  • Technical Interoperability: Export row samples to CSV or copy the canonical JSON query payload for developer debugging.

2. Prerequisites, Entitlements & RBAC​

ActionMinimum RoleOperational Precondition
Save AudienceEditor, AdminAudience must be in Valid or Estimated state. Cannot have blocking errors.
Save as DraftEditor, AdminCan be saved at any stage, even with incomplete conditions.
Export Sample (CSV)Editor, AdminPreview rows and at least one output attribute must be loaded.
Generate with AIEditor, AdminAI Gateway integration enabled in workspace settings.

3. Audience Status Lifecycle State Machine​

The status badge in the header communicates the exact health and execution state of your audience:

Status BadgeMeaningPermitted Actions
DraftInitial unfinalized state.Edit rules, Validate, Save Draft.
Needs fixes / InvalidValidation detected missing fields, bad operators, or illegal dates.Fix flagged conditions. (Save blocked).
ValidRules passed syntax and integrity checks.Estimate, Save Audience, Save Draft.
EstimatedLive reach calculated against ClickHouse.Preview rows, Save Audience, Export CSV.
Estimate staleRules or date filters changed after last estimate.Re-run Estimate, Save Audience.
SavedDefinition successfully written to Postgres.Activate, Export, View Insights, Duplicate.
Unsaved changesExisting saved audience was edited on canvas.Validate, Estimate, Update Audience.

4. Canonical Step-by-Step Workflows​

Workflow A: Saving an Audience for Production Use​

  1. Verify that the audience name adheres to the standard naming taxonomy:
    [Lifecycle Stage] - [Behavioral Intent] - [Window] - [Target Channel]
    Example: Retention - Churn Risk High LTV - 30D - Meta Lookalike
  2. Confirm the status badge reads Valid or Estimated.
  3. Click Save Audience in the header.
  4. Select whether to create a New Audience or Update Existing Definition.
  5. Once confirmed, the audience ID is registered, and the status transitions to Saved.

Workflow B: Duplicating an Audience Variant​

  1. Open an existing saved audience from the left catalog.
  2. Click the More actions (⋮) menu in the header and select Duplicate locally.
  3. The system generates a clone with (Copy) appended to the name, resetting the audience ID.
  4. Adjust specific conditions (e.g., changing lookback from 14 days to 30 days) and save as a new audience.

Workflow C: Natural-Language AI Rule Generation​

ai audience generate

If you want to quickly build rules from an idea without manually navigating the field catalog:

  1. Click Generate with AI in the top action bar.
  2. In the modal prompt, write a clear, descriptive request:
    Find all customers in India who viewed pricing in the last 14 days
    and added items to cart, but exclude anyone who completed a purchase
    in the last 30 days.
  3. Click Generate Rules.
  4. The AI Gateway parses the intent, selects the corresponding catalog member paths, configures operators, and populates the Visual Builder canvas.
  5. Review the generated conditions, run Validate, and execute Estimate before saving.
warning

AI-generated conditions are drafts. Always inspect generated operator types, values, and time windows against actual business goals before deploying.

Workflow D: Exporting Sample CSV or Copying Query JSON​

  • Export Sample (CSV): Click Export Sample (CSV) above the preview table to download a spreadsheet of current preview rows for stakeholder sign-off.
  • Copy Query JSON (handleCopyJson): Toggle the editor view to JSON or click Copy JSON from the utility menu. The canonical query.filters payload is copied to your clipboard for use in Postman, automated tests, or developer debugging.

5. Troubleshooting & Error Playbook​

SymptomProbable Root CauseActionable Resolution
Save Audience button is disabledAudience status is Needs fixes, Invalid, or validation has not been run.Fix all condition errors and click Validate until the status turns Valid.
AI Generation returns error "Cannot map field"Prompt references an attribute not present in the workspace data catalog.Rephrase prompt using standard terms (e.g., "cart additions" instead of proprietary jargon).
Export Sample (CSV) is disabledNo preview rows have been loaded, or preview columns are empty.Select preview attributes in the right drawer and run an estimate.
"Save failed: Network error"Authentication token expired or database connection dropped.Refresh authentication session; verify Client-ID and Workspace-ID headers are valid.

6. Downstream Handoff & Next Steps​