干货!用coze工作流自动生产谷歌seo文章

之前写了一篇利用扣子自动生产百度seo的文章:

今天利用coze海外版做一个自动生产谷歌seo文章的工作流。大致架构和原来那条工作流相同,所以不逐步讲解怎么建立这条工作流,有兴趣的朋友可以看前面那篇文章。

由于本次做的是全球seo,本工作流的一大特色是支持多语言。所以在工作流中,首先需要判断用户输入的语言:

拖入一个大模型节点,取名“分析语言”,输入参数则是开始节点的输入参数,系统提示词则输入:

# Role
You are a language identifier that determines the language of user input.

## Skills
### Skill 1: Language Detection
- Analyze the user's input to determine whether it is in Chinese or English or other languages.
- If the input is in Chinese, output "zh".
- If the input is in English, output "en".
- other languages code...

## Constraints:
- Only focus on identifying the language of the input.
- Output only the code in the detected language, ensuring that no extra content is included.

用户提示词输入:

user input:{{input}} 

这个大模型节点会分析用户输入的文本,而决定接下来用哪种语言撰写seo文章。

然后拖入一个插件,用于搜索新闻,这里用的coze官方开发的getNews插件:

插件有两个参数:

  1. language,也就是搜索新闻用的语言,这里调用“分析语言”节点的输出参数。
  2. 就是用户输入的文本,也就是要撰写文章的关键词。

利用插件搜索与关键词匹配的相关新闻热点,作为写作文章的素材。于是接下来的大模型节点就是对搜到的新闻做一个整理总结:

该节点包含三个参数:

  1. news:即新闻插件的输出,是一个数组
  2. 用户输入的关键词
  3. “分析语言”节点输出的语言代码。

系统提示词输入:

请根据提供的资料撰写一篇简明的新闻报道,遵循以下结构: 
标题:简明扼要地概括主要信息。
导语:用一到两句话总结报道的核心事件,包含5W1H(何时、何地、何事、何人、为何、如何)。
正文:
第一段:详细描述事件发生的背景和主要细节,引用关键数据或资料。
第二段:提供相关方的评论或观点,确保信息来源的可信度。
第三段:引入更广泛的背景信息或相关事件,以提供更多的上下文支持。
结尾段落:总结事件的重要性,并对未来可能的后续发展进行预测。

请确保语言简洁流畅,报道内容具有逻辑性和连贯性,避免冗长。写作指定语言:{{lang}} 

用户提示词输入:

标题:{{BOT_USER_INPUT}} 
参考资料:对{{news}}进行遍历,取出每个summary,结合成参考资料 

该节点的输出为string。

接下来是一个大模型节点,用于将前面整理的新闻学习消化,然后将关键词作为文章标题,撰写文章大纲:

该节点有三个输入参数:

  1. 用户输入关键词
  2. “新闻总结”节点整理总结的稿件
  3. “分析语言”节点输出的语言代码。

系统提示词如下:

请根据以下提供的{文本}和{关键词},撰写一篇包含7个段落的文章大纲,且输出格式为JSON数组。文章结构合理清晰,采用简洁的段落和小标题,避免使用可能违反谷歌SEO政策的内容,如隐性文字、过度堆砌关键词等。大纲要求如下:
引言段落:简要介绍文章的主题,嵌入主要关键词,吸引读者的注意。
第二段:展开核心内容,解释与关键词相关的背景或基本概念。
第三段:详细描述文本中的主要论点或信息点,合理融入关键词。
第四段:举例说明或提供案例分析,支持前述论点,关键词自然出现。
第五段:扩展信息或对比分析,进一步深化读者对主题的理解,关键词继续分布。
第六段:总结文章中的关键观点,讨论未来的趋势或潜在问题,嵌入关键词。
结论段落:总结全文,呼应开头,强调关键词的重要性,引导读者采取行动。

请确保输出为JSON数组格式,数组中的每个对象需包含“title”和“content”字段,具体要求如下:
“title”字段为段落的标题
“content”字段为段落的内容,包含关键词的合理分布
输出示例:

[
  {
    "title": "Introduction: Overview of the Article Topic",
    "description": "Briefly introduce the topic of the article and naturally incorporate the main keywords, such as **{keywords}**, to grab the reader's attention and guide them to continue reading."
  },
  {
    "title": "Section 2: Core Background and Concepts",
    "description": "Expand on the core content of the article by explaining the background or fundamental concepts related to the keywords, helping readers better understand the topic."
  },
  {
    "title": "Section 3: Key Arguments Description",
    "description": "Describe in detail the main arguments or informational points related to the text **{text content}**, seamlessly integrating the keywords while ensuring accuracy and relevance."
  },
  {
    "title": "Section 4: Case Studies and Support",
    "description": "Provide examples or case studies to support the arguments mentioned earlier, ensuring the keywords appear naturally in the analysis."
  },
  {
    "title": "Section 5: Extended Information or Comparative Analysis",
    "description": "Offer additional relevant information or conduct a comparative analysis to deepen understanding of the topic, while ensuring appropriate keyword placement."
  },
  {
    "title": "Section 6: Summary and Outlook",
    "description": "Summarize the key points of the article and discuss future trends or potential challenges, naturally embedding the keywords."
  },
  {
    "title": "Conclusion: Recap and Summary",
    "description": "Conclude the article by echoing the introduction, emphasizing the importance of the keywords, and encouraging readers to take the next steps, such as further reading or sharing."
  }
]

输出语言:{{lang}}

用户提示词如下:

提供的{文本}:{{content}}  
提供的{关键词}:{{keyword}} 

因为撰写的是大纲,所以节点输出的是数组,方便后续拆解大纲。

由于规定了大纲一共7节,因此后续拖入7个代码节点,分别将大纲的7个部分插件出来:

节点的输入是上个节点输出的大纲,输出则是一个object类型,节点代码如下:

async function main({ params }: Args): Promise<Output> {
    // 示例数组
    const output = params.input

    // 提取数组的第一项
    const item = output[0];
    // 返回结果
    const ret = {
        "item": item
    };

    return ret;
}

代码的作用是将大纲的第一部分提取出来输出。然后将该代码节点复制六份,用于提取大纲的其他部分。只需要改动output[索引]里的索引值即可。

接下来就是撰写大纲的每个部分了:

拖入7个大模型节点,这7个大模型节点的所有配置一模一样。节点有4个输入参数:

  1. 上个代码节点输出的大纲单部分。
  2. 用户输入的关键词。
  3. “新闻总结”节点整理的新闻资料。
  4. “分析语言”节点输出的语言代码。

系统提示词如下:

Character
你是一个seo专家,基于用户提供的{关键词}以及{大纲}撰写优化文章的引言部分,确保内容符合谷歌SEO规则并具有高可读性和用户体验。
Skills
技能 1: 长尾关键词策略
文章中至少完整提及3-5次目标长尾关键词,并将关键词自然分布在文章各部分,以保证文案的流畅性。
使用关键词的拆分和灵活组合,避免堆砌关键词。

技能 2: 字数和结构要求
不少于200字,确保足够的内容深度和信息丰富度。

技能 3: 谷歌SEO规则优化
文章结构合理清晰,采用简洁的段落和小标题,避免使用可能违反谷歌SEO政策的内容,如隐性文字、过度堆砌关键词等。
确保内容具备原创性、可读性和信息价值。

技能 4: 长尾词多样性
根据文章情境,灵活使用长尾词的不同变体或同义词,确保关键词的自然过渡。
通过多种方式嵌入长尾词来提升SEO表现。

技能 5: {热点话题}融入
结合最新的新闻事件或行业热点,将相关内容与文章主题自然结合,增强文章的时效性和吸引力。
保持内容的权威性和专业性。

技能 6: 用户体验和可读性
注重用户体验,提供实用的资讯和有效的解答,使读者获得明确的价值。

Constraints
注意只是撰写整篇文章的引言部分
写作指定语言:{{lang}}。

节点输出则是string。

到此整条工作流做完了,最后运行测试一下,工作流洋洋洒洒帮我写了1万多字的英文文章,感觉还不错。我已经将工作流包装成智能体发布到coze商店,搜索“google seo master”即可。