EmailCampaignTask
Generate complete, multi-stage email marketing sequences with strategic planning, A/B tested subject lines, and automated revision passes.
{
"campaign_goal": "Re-engage inactive users",
"subject_matter": "New AI-powered bento grids",
"num_emails": 3,
"campaign_type": "re_engagement",
"brand_voice": "friendly",
"generate_subject_variants": true
}
[B] Your dashboard just got an upgrade.
Hi {{first_name}},
It's been a while since you logged into Cognotik. We've been busy building the "Industrial" design system...
Live Results Showcase
Explore actual email campaign artifacts and markdown reports generated by this task.
Configuration Parameters
| Field | Type | Description |
|---|---|---|
campaign_goal* |
String | The primary objective (e.g., "Launch new API features"). |
subject_matter* |
String | The product, service, or topic being promoted. |
target_audience |
String | Description of demographics, roles, or pain points. |
num_emails |
Int | Number of emails in sequence (1-10). Default: 3. |
campaign_type |
String | welcome_series, nurture, sales, re_engagement, newsletter. |
primary_cta |
String | The main action (e.g., schedule_demo, make_purchase). |
brand_voice |
String | Tone (e.g., professional, friendly, authoritative). |
body_length |
String | short (<150 words), medium, or long. |
send_intervals |
List<Int> | Days between emails (e.g., [1, 3, 7]). |
revision_passes |
Int | Number of automated quality improvement passes (0-5). |
input_files |
List<String> | File patterns (e.g. **/*.md) to use as brand context. |
generate_subject_variants |
Boolean | Whether to generate multiple A/B test options. |
Dependencies
None. Operates as a standalone generator or can ingest input_files for brand context.
Token Usage
High ConsumptionUses multiple LLM calls: Strategy (1), Outlines (1 per email), Generation (1 per email), Revisions (N per email).
Task Execution Lifecycle
Analyzes audience and subject matter to create a progression logic and key messaging map.
Plans the specific purpose, emotional tone, and CTA for every email in the sequence.
Writes the copy, generates A/B subject variants, and injects personalization tokens.
Performs N passes of editing for clarity, conciseness, and brand consistency.
Embedded Invocation (Headless)
Use the UnifiedHarness to run this task programmatically in CI/CD or CLI tools.
val harness = UnifiedHarness(serverless = true)
harness.start()
val executionConfig = EmailCampaignTaskExecutionConfigData(
campaign_goal = "Onboard new developers",
subject_matter = "Cognotik SDK",
num_emails = 5,
brand_voice = "technical",
revision_passes = 2
)
harness.runTask(
taskType = EmailCampaignTask.EmailCampaign,
executionConfig = executionConfig,
workspace = File("./my-project")
)
Direct Instantiation
val task = EmailCampaignTask(
orchestrationConfig = config,
planTask = EmailCampaignTaskExecutionConfigData(
campaign_goal = "Re-engage churned users",
subject_matter = "New Feature Launch",
campaign_type = "re_engagement"
)
)
Test Case Example
Example of a validated configuration for testing:
{ "campaign_goal": "Test Goal", "subject_matter": "Test Subject", "num_emails": 1 }
Prompt Segment
The following logic is injected into the LLM context:
EmailCampaign - Generate multi-email marketing or outreach sequences.
- campaign_goal: Primary objective.
- subject_matter: Product or topic.
- target_audience: Who is receiving the emails.
- campaign_type: welcome_series, nurture, sales, etc.
- num_emails: Length of sequence (1-10).
- brand_voice: professional, friendly, etc.
- primary_cta: Main action desired.
- related_files: Brand guidelines or context.