微信公众号文章全流程生成

创建时间: 2026-07-01 13:55 | 步骤: 14 个

工作流描述

根据用户提供的主题文本和具体要求,深度解析意图并衍生配色体系,自动规划正文内容、配图与SVG动画,生成头条/次条封面图,最终深度融合拼装为符合公众号渲染规范的纯HTML片段,支持直接粘贴到第三方编辑器。

工作流输出

流程步骤 共 14 步

1深度意图解析
2配色体系衍生生成
3封面图提示词生成
4正文内容与配图规划
5生成头条封面图(16:9)
6轮询头条封面图状态
7生成次条封面图(1:1)
8轮询次条封面图状态
9批量生成正文配图
10批量轮询正文配图状态
11缩放头条封面图
12缩放次条封面图
13批量缩放正文配图至750px宽
14HTML与SVG深度融合拼装
工作流定义 (JSON)370 行
{
  "workflow_id": "wechat_article_full_generation",
  "input": {
    "img_num": {
      "field_name": "img_num",
      "default": 1,
      "description": "生成文章配图数量,范围0-4",
      "example": 1,
      "required": false,
      "type": "integer"
    },
    "img_ratio": {
      "field_name": "img_ratio",
      "default": "1:1",
      "description": "生成配图的画面比例,可选1:1、3:4、4:3、16:9、9:16",
      "example": "1:1",
      "required": false,
      "type": "string"
    },
    "reference": {
      "field_name": "reference",
      "default": "",
      "description": "生成公众号文章的主题或原文文本",
      "example": "2024年AI发展趋势深度解读",
      "required": true,
      "type": "string"
    },
    "key_point": {
      "field_name": "key_point",
      "default": "",
      "description": "生成公众号的具体要求,如主题色号、不改原文、段数限制、SVG动画要求、封面要求等",
      "example": "主题色#3a7bd5,原文不改直接用,生成3个段落,封面要有科技感",
      "required": false,
      "type": "string"
    }
  },
  "steps": [
    {
      "id": "step_1_intent_analyzer",
      "point_code": "",
      "result": [],
      "backend_type": "prompt_api",
      "api_code": "wechat_intent_analyzer",
      "status": "PENDING",
      "name": "深度意图解析",
      "action": "run",
      "params": {
        "key_point": "{{@input.key_point}}",
        "reference": "{{@input.reference}}"
      },
      "depends_on": []
    },
    {
      "id": "step_2_theme_system_generate",
      "point_code": "",
      "result": [],
      "backend_type": "prompt_api",
      "api_code": "wechat_theme_system_generate",
      "status": "PENDING",
      "name": "配色体系衍生生成",
      "action": "run",
      "params": {
        "structured_intent": "{{@step_1_intent_analyzer.result.data.structured_intent}}"
      },
      "depends_on": [
        "step_1_intent_analyzer"
      ]
    },
    {
      "id": "step_3_cover_prompt_generate",
      "point_code": "",
      "result": [],
      "backend_type": "prompt_api",
      "api_code": "wechat_cover_prompt_generate",
      "status": "PENDING",
      "name": "封面图提示词生成",
      "action": "run",
      "params": {
        "structured_intent": "{{@step_1_intent_analyzer.result.data.structured_intent}}",
        "theme_colors": "{{@step_2_theme_system_generate.result.data.theme_colors}}"
      },
      "depends_on": [
        "step_1_intent_analyzer",
        "step_2_theme_system_generate"
      ]
    },
    {
      "id": "step_4_content_and_image_plan",
      "point_code": "",
      "result": [],
      "backend_type": "prompt_api",
      "api_code": "wechat_content_and_image_plan",
      "status": "PENDING",
      "name": "正文内容与配图规划",
      "action": "run",
      "params": {
        "structured_intent": "{{@step_1_intent_analyzer.result.data.structured_intent}}",
        "theme_colors": "{{@step_2_theme_system_generate.result.data.theme_colors}}",
        "reference": "{{@input.reference}}"
      },
      "depends_on": [
        "step_1_intent_analyzer",
        "step_2_theme_system_generate"
      ]
    },
    {
      "id": "step_5_generate_cover_head",
      "point_code": "1",
      "result": [],
      "backend_type": "sys_api",
      "api_code": "3373",
      "status": "PENDING",
      "name": "生成头条封面图(16:9)",
      "action": "run",
      "params": {
        "prompt": "{{@step_3_cover_prompt_generate.result.data.cover_head_prompt}}",
        "aspect_ratio": "16:9"
      },
      "depends_on": [
        "step_3_cover_prompt_generate"
      ]
    },
    {
      "id": "step_6_poll_cover_head",
      "point_code": "",
      "result": [],
      "backend_type": "sys_api",
      "api_code": "polling",
      "status": "PENDING",
      "name": "轮询头条封面图状态",
      "action": "run",
      "params": {
        "result_url": "{{@step_5_generate_cover_head.result.data.result_url}}"
      },
      "depends_on": [
        "step_5_generate_cover_head"
      ],
      "polling": {
        "interval_seconds": 5,
        "timeout_seconds": 600,
        "success_condition": "{{@step_6_poll_cover_head.result.data.task_status}} === 'SUCCEEDED'"
      }
    },
    {
      "id": "step_7_generate_cover_sub",
      "point_code": "1",
      "result": [],
      "backend_type": "sys_api",
      "api_code": "3373",
      "status": "PENDING",
      "name": "生成次条封面图(1:1)",
      "action": "run",
      "params": {
        "prompt": "{{@step_3_cover_prompt_generate.result.data.cover_sub_prompt}}",
        "aspect_ratio": "1:1"
      },
      "depends_on": [
        "step_3_cover_prompt_generate"
      ]
    },
    {
      "id": "step_8_poll_cover_sub",
      "point_code": "",
      "result": [],
      "backend_type": "sys_api",
      "api_code": "polling",
      "status": "PENDING",
      "name": "轮询次条封面图状态",
      "action": "run",
      "params": {
        "result_url": "{{@step_7_generate_cover_sub.result.data.result_url}}"
      },
      "depends_on": [
        "step_7_generate_cover_sub"
      ],
      "polling": {
        "interval_seconds": 5,
        "timeout_seconds": 600,
        "success_condition": "{{@step_8_poll_cover_sub.result.data.task_status}} === 'SUCCEEDED'"
      }
    },
    {
      "result": [],
      "iterator": "{{@step_4_content_and_image_plan.result.data.image_plans}}",
      "status": "PENDING",
      "aggregates": [
        {
          "field": "data.result_url",
          "into": "content_image_urls"
        },
        {
          "field": "data.task_id",
          "into": "content_image_task_ids"
        }
      ],
      "params": {
        "prompt": "{{@image_plan.prompt}}",
        "aspect_ratio": "{{@input.img_ratio}}"
      },
      "depends_on": [
        "step_4_content_and_image_plan"
      ],
      "point_code": "1",
      "id": "step_9_generate_content_images",
      "api_code": "3373",
      "backend_type": "sys_api",
      "item_name": "image_plan",
      "name": "批量生成正文配图",
      "action": "foreach"
    },
    {
      "result": [],
      "iterator": "{{@step_9_generate_content_images.result.data.aggregated.content_image_task_ids}}",
      "status": "PENDING",
      "aggregates": [
        {
          "field": "data.result_url",
          "into": "content_image_final_urls"
        }
      ],
      "params": {
        "result_url": "https://promptimg.showapi.com/tasks/{{@task_id}}.png"
      },
      "depends_on": [
        "step_9_generate_content_images"
      ],
      "polling": {
        "interval_seconds": 5,
        "timeout_seconds": 600,
        "success_condition": "{{@step_10_poll_content_images.result.data.task_status}} === 'SUCCEEDED'"
      },
      "point_code": "",
      "id": "step_10_poll_content_images",
      "api_code": "polling",
      "backend_type": "sys_api",
      "item_name": "task_id",
      "name": "批量轮询正文配图状态",
      "action": "foreach"
    },
    {
      "id": "step_11_resize_cover_head",
      "point_code": "8",
      "result": [],
      "backend_type": "sys_api",
      "api_code": "1",
      "status": "PENDING",
      "name": "缩放头条封面图",
      "action": "run",
      "params": {
        "rate": "0.5",
        "src_img_url": "{{@step_6_poll_cover_head.result.data.result_url}}",
        "type": "rate"
      },
      "depends_on": [
        "step_6_poll_cover_head"
      ]
    },
    {
      "id": "step_12_resize_cover_sub",
      "point_code": "8",
      "result": [],
      "backend_type": "sys_api",
      "api_code": "1",
      "status": "PENDING",
      "name": "缩放次条封面图",
      "action": "run",
      "params": {
        "rate": "0.5",
        "src_img_url": "{{@step_8_poll_cover_sub.result.data.result_url}}",
        "type": "rate"
      },
      "depends_on": [
        "step_8_poll_cover_sub"
      ]
    },
    {
      "result": [],
      "iterator": "{{@step_10_poll_content_images.result.data.aggregated.content_image_final_urls}}",
      "status": "PENDING",
      "aggregates": [
        {
          "field": "data.des_pic_url",
          "into": "content_image_resized_urls"
        }
      ],
      "params": {
        "width": "750",
        "src_img_url": "{{@final_url}}",
        "type": "size",
        "keepRate": "1"
      },
      "depends_on": [
        "step_10_poll_content_images"
      ],
      "point_code": "8",
      "id": "step_13_resize_content_images",
      "api_code": "1",
      "backend_type": "sys_api",
      "item_name": "final_url",
      "name": "批量缩放正文配图至750px宽",
      "action": "foreach"
    },
    {
      "id": "step_14_html_svg_assembler",
      "point_code": "",
      "result": [],
      "backend_type": "prompt_api",
      "api_code": "wechat_html_svg_assembler",
      "status": "PENDING",
      "name": "HTML与SVG深度融合拼装",
      "action": "run",
      "params": {
        "cover_head_url": "{{@step_11_resize_cover_head.result.data.des_pic_url}}",
        "cover_sub_url": "{{@step_12_resize_cover_sub.result.data.des_pic_url}}",
        "title_suggestion": "{{@step_4_content_and_image_plan.result.data.title_suggestion}}",
        "svg_suggestions": "{{@step_4_content_and_image_plan.result.data.svg_suggestions}}",
        "image_urls": "{{@step_13_resize_content_images.result.data.aggregated.content_image_resized_urls}}",
        "paragraphs": "{{@step_4_content_and_image_plan.result.data.paragraphs}}",
        "theme_colors": "{{@step_2_theme_system_generate.result.data.theme_colors}}",
        "key_point_constraints": "{{@step_1_intent_analyzer.result.data.structured_intent.key_point_constraints}}"
      },
      "depends_on": [
        "step_4_content_and_image_plan",
        "step_2_theme_system_generate",
        "step_1_intent_analyzer",
        "step_11_resize_cover_head",
        "step_12_resize_cover_sub",
        "step_13_resize_content_images"
      ]
    }
  ],
  "output": {
    "cover_head_url": {
      "field_name": "cover_head_url",
      "description": "缩放后的头条封面图URL(16:9)",
      "value": "{{@step_11_resize_cover_head.result.data.des_pic_url}}",
      "type": "string"
    },
    "title_suggestion": {
      "field_name": "title_suggestion",
      "description": "短标题建议,确保一行显示",
      "value": "{{@step_4_content_and_image_plan.result.data.title_suggestion}}",
      "type": "string"
    },
    "cover_sub_url": {
      "field_name": "cover_sub_url",
      "description": "缩放后的次条封面图URL(1:1)",
      "value": "{{@step_12_resize_cover_sub.result.data.des_pic_url}}",
      "type": "string"
    },
    "key_point_check_report": {
      "field_name": "key_point_check_report",
      "description": "用户所有要求落实情况的逐项校验报告",
      "value": "{{@step_14_html_svg_assembler.result.data.key_point_check_report}}",
      "type": "object"
    },
    "final_html": {
      "field_name": "final_html",
      "description": "可直接粘贴到第三方编辑器的纯HTML片段(无html/head/body外壳)",
      "value": "{{@step_14_html_svg_assembler.result.data.final_html}}",
      "type": "string"
    },
    "usage_guide": {
      "field_name": "usage_guide",
      "description": "详细使用说明,包含导入方法、第三方工具推荐、注意事项",
      "value": "{{@step_14_html_svg_assembler.result.data.usage_guide}}",
      "type": "string"
    }
  }
}