feat(pipeline): implement Pipeline DSL system for automated workflows
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Add complete Pipeline DSL system including:
- Rust backend (zclaw-pipeline crate) with parser, executor, and state management
- Frontend components: PipelinesPanel, PipelineResultPreview, ClassroomPreviewer
- Pipeline recommender for Agent conversation integration
- 5 pipeline templates: education, marketing, legal, research, productivity
- Documentation for Pipeline DSL architecture
Pipeline DSL enables declarative workflow definitions with:
- YAML-based configuration
- Expression resolution (${inputs.topic}, ${steps.step1.output})
- LLM integration, parallel execution, file export
- Agent smart recommendations in conversations
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
292
pipelines/marketing/campaign.yaml
Normal file
292
pipelines/marketing/campaign.yaml
Normal file
@@ -0,0 +1,292 @@
|
||||
# ZCLAW Pipeline - Marketing Campaign Generator
|
||||
# 营销方案生成器:输入产品信息,自动生成完整营销策略
|
||||
|
||||
apiVersion: zclaw/v1
|
||||
kind: Pipeline
|
||||
metadata:
|
||||
name: marketing-campaign
|
||||
displayName: 营销方案生成器
|
||||
category: marketing
|
||||
description: 输入产品/服务信息,自动生成目标受众分析、渠道策略、内容计划和执行时间表
|
||||
tags:
|
||||
- 营销
|
||||
- 推广
|
||||
- 策略
|
||||
- 内容
|
||||
icon: 📢
|
||||
author: ZCLAW
|
||||
version: 1.0.0
|
||||
|
||||
spec:
|
||||
# 输入参数定义
|
||||
inputs:
|
||||
- name: product_name
|
||||
type: string
|
||||
required: true
|
||||
label: 产品/服务名称
|
||||
placeholder: 例如:智能健康手环
|
||||
validation:
|
||||
min_length: 2
|
||||
max_length: 100
|
||||
|
||||
- name: product_description
|
||||
type: text
|
||||
required: true
|
||||
label: 产品描述
|
||||
placeholder: 请简要描述您的产品/服务特点、核心价值和竞争优势
|
||||
|
||||
- name: target_market
|
||||
type: string
|
||||
required: false
|
||||
label: 目标市场
|
||||
placeholder: 例如:一二线城市年轻白领
|
||||
|
||||
- name: budget_level
|
||||
type: select
|
||||
required: false
|
||||
label: 预算级别
|
||||
default: 中等
|
||||
options:
|
||||
- 低预算
|
||||
- 中等
|
||||
- 高预算
|
||||
|
||||
- name: campaign_goals
|
||||
type: multi-select
|
||||
required: false
|
||||
label: 营销目标
|
||||
default: [品牌曝光, 用户增长]
|
||||
options:
|
||||
- 品牌曝光
|
||||
- 用户增长
|
||||
- 销售转化
|
||||
- 用户留存
|
||||
- 口碑传播
|
||||
|
||||
- name: export_formats
|
||||
type: multi-select
|
||||
required: false
|
||||
label: 导出格式
|
||||
default: [html, markdown]
|
||||
options:
|
||||
- html
|
||||
- markdown
|
||||
- json
|
||||
|
||||
# 执行步骤
|
||||
steps:
|
||||
# Step 1: 分析产品和目标受众
|
||||
- id: analyze_product
|
||||
description: 分析产品特点和目标受众
|
||||
action:
|
||||
type: llm_generate
|
||||
template: |
|
||||
你是一位资深的营销策略专家。请分析以下产品/服务,并生成目标受众画像。
|
||||
|
||||
产品/服务: {{product_name}}
|
||||
产品描述: {{product_description}}
|
||||
目标市场: {{target_market}}
|
||||
营销目标: {{campaign_goals}}
|
||||
|
||||
请生成 JSON 格式的分析结果:
|
||||
{
|
||||
"product_analysis": {
|
||||
"core_value": "核心价值主张",
|
||||
"unique_selling_points": ["卖点1", "卖点2", "卖点3"],
|
||||
"competitive_advantages": ["优势1", "优势2"]
|
||||
},
|
||||
"target_audience": {
|
||||
"primary": {
|
||||
"demographics": "人口统计特征",
|
||||
"psychographics": "心理特征",
|
||||
"pain_points": ["痛点1", "痛点2"],
|
||||
"desires": ["需求1", "需求2"]
|
||||
},
|
||||
"secondary": {
|
||||
"demographics": "人口统计特征",
|
||||
"psychographics": "心理特征"
|
||||
}
|
||||
},
|
||||
"market_positioning": "市场定位建议"
|
||||
}
|
||||
input:
|
||||
product_name: ${inputs.product_name}
|
||||
product_description: ${inputs.product_description}
|
||||
target_market: ${inputs.target_market}
|
||||
campaign_goals: ${inputs.campaign_goals}
|
||||
json_mode: true
|
||||
temperature: 0.7
|
||||
max_tokens: 2500
|
||||
|
||||
# Step 2: 生成渠道策略
|
||||
- id: generate_channel_strategy
|
||||
description: 根据预算和目标生成渠道策略
|
||||
action:
|
||||
type: llm_generate
|
||||
template: |
|
||||
基于以下信息,制定营销渠道策略:
|
||||
|
||||
产品分析: ${steps.analyze_product.output.product_analysis}
|
||||
目标受众: ${steps.analyze_product.output.target_audience}
|
||||
预算级别: {{budget_level}}
|
||||
营销目标: {{campaign_goals}}
|
||||
|
||||
请生成 JSON 格式的渠道策略:
|
||||
{
|
||||
"recommended_channels": [
|
||||
{
|
||||
"name": "渠道名称",
|
||||
"priority": "high|medium|low",
|
||||
"budget_allocation": "预算占比%",
|
||||
"rationale": "选择理由",
|
||||
"tactics": ["具体策略1", "具体策略2"]
|
||||
}
|
||||
],
|
||||
"channel_mix_strategy": "渠道组合策略说明",
|
||||
"measurement_metrics": ["指标1", "指标2", "指标3"]
|
||||
}
|
||||
input:
|
||||
product_analysis: ${steps.analyze_product.output.product_analysis}
|
||||
target_audience: ${steps.analyze_product.output.target_audience}
|
||||
budget_level: ${inputs.budget_level}
|
||||
campaign_goals: ${inputs.campaign_goals}
|
||||
json_mode: true
|
||||
temperature: 0.8
|
||||
max_tokens: 2000
|
||||
|
||||
# Step 3: 生成内容计划
|
||||
- id: generate_content_plan
|
||||
description: 生成内容营销计划
|
||||
action:
|
||||
type: llm_generate
|
||||
template: |
|
||||
为以下营销活动制定内容计划:
|
||||
|
||||
产品: ${inputs.product_name}
|
||||
目标受众: ${steps.analyze_product.output.target_audience.primary}
|
||||
渠道策略: ${steps.generate_channel_strategy.output.recommended_channels}
|
||||
营销目标: {{campaign_goals}}
|
||||
|
||||
请生成 JSON 格式的内容计划:
|
||||
{
|
||||
"content_pillars": [
|
||||
{
|
||||
"theme": "内容主题",
|
||||
"description": "主题描述",
|
||||
"content_types": ["内容类型1", "内容类型2"]
|
||||
}
|
||||
],
|
||||
"content_calendar": [
|
||||
{
|
||||
"week": 1,
|
||||
"content_pieces": [
|
||||
{
|
||||
"type": "内容类型",
|
||||
"channel": "发布渠道",
|
||||
"topic": "内容主题",
|
||||
"call_to_action": "行动号召"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"key_messages": ["核心信息1", "核心信息2", "核心信息3"],
|
||||
"hashtag_strategy": ["话题标签1", "话题标签2"]
|
||||
}
|
||||
input:
|
||||
product_name: ${inputs.product_name}
|
||||
target_audience: ${steps.analyze_product.output.target_audience}
|
||||
channel_strategy: ${steps.generate_channel_strategy.output}
|
||||
campaign_goals: ${inputs.campaign_goals}
|
||||
json_mode: true
|
||||
temperature: 0.75
|
||||
max_tokens: 2500
|
||||
|
||||
# Step 4: 生成执行时间表
|
||||
- id: generate_timeline
|
||||
description: 生成营销活动执行时间表
|
||||
action:
|
||||
type: llm_generate
|
||||
template: |
|
||||
为以下营销活动制定4周执行时间表:
|
||||
|
||||
产品: ${inputs.product_name}
|
||||
渠道策略: ${steps.generate_channel_strategy.output}
|
||||
内容计划: ${steps.generate_content_plan.output}
|
||||
|
||||
请生成 JSON 格式的执行时间表:
|
||||
{
|
||||
"phases": [
|
||||
{
|
||||
"name": "阶段名称",
|
||||
"duration": "持续时间",
|
||||
"objectives": ["目标1", "目标2"],
|
||||
"key_activities": ["活动1", "活动2"],
|
||||
"milestones": ["里程碑1", "里程碑2"]
|
||||
}
|
||||
],
|
||||
"weekly_schedule": [
|
||||
{
|
||||
"week": 1,
|
||||
"focus": "本周重点",
|
||||
"tasks": ["任务1", "任务2", "任务3"],
|
||||
"deliverables": ["产出物1", "产出物2"]
|
||||
}
|
||||
],
|
||||
"kpis": {
|
||||
"awareness": ["KPI1", "KPI2"],
|
||||
"engagement": ["KPI1", "KPI2"],
|
||||
"conversion": ["KPI1", "KPI2"]
|
||||
}
|
||||
}
|
||||
input:
|
||||
product_name: ${inputs.product_name}
|
||||
channel_strategy: ${steps.generate_channel_strategy.output}
|
||||
content_plan: ${steps.generate_content_plan.output}
|
||||
json_mode: true
|
||||
temperature: 0.7
|
||||
max_tokens: 2000
|
||||
|
||||
# Step 5: 组装营销方案
|
||||
- id: assemble_campaign
|
||||
description: 组装完整营销方案
|
||||
action:
|
||||
type: set_var
|
||||
name: campaign_data
|
||||
value: |
|
||||
{
|
||||
"title": "${inputs.product_name} 营销方案",
|
||||
"product_name": "${inputs.product_name}",
|
||||
"product_analysis": ${steps.analyze_product.output.product_analysis},
|
||||
"target_audience": ${steps.analyze_product.output.target_audience},
|
||||
"channel_strategy": ${steps.generate_channel_strategy.output},
|
||||
"content_plan": ${steps.generate_content_plan.output},
|
||||
"timeline": ${steps.generate_timeline.output},
|
||||
"created_at": "${chrono::Utc::now().to_rfc3339()}"
|
||||
}
|
||||
|
||||
# Step 6: 导出文件
|
||||
- id: export_files
|
||||
description: 导出营销方案文件
|
||||
action:
|
||||
type: file_export
|
||||
formats: ${inputs.export_formats}
|
||||
input: ${vars.campaign_data}
|
||||
|
||||
# 输出映射
|
||||
outputs:
|
||||
campaign_title: ${vars.campaign_data.title}
|
||||
product_analysis: ${vars.campaign_data.product_analysis}
|
||||
target_audience: ${vars.campaign_data.target_audience}
|
||||
channel_strategy: ${vars.campaign_data.channel_strategy}
|
||||
content_plan: ${vars.campaign_data.content_plan}
|
||||
timeline: ${vars.campaign_data.timeline}
|
||||
export_files: ${steps.export_files.output}
|
||||
|
||||
# 错误处理
|
||||
on_error: stop
|
||||
|
||||
# 超时设置
|
||||
timeout_secs: 300
|
||||
|
||||
# 并行工作线程上限
|
||||
max_workers: 4
|
||||
Reference in New Issue
Block a user