> For the complete documentation index, see [llms.txt](https://morphic.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://morphic.com/docs/zh/gong-zuo-liu/nested-workflows.md).

# 嵌套工作流

一个工作流可以把另一个工作流作为其步骤之一来运行。你已经在某项任务中信任的工作流，会变成一个可直接嵌入更大任务的构建块，而不必每次都重新描述那项任务。

下面是一个关于如何在 Morphic 中嵌套工作流的简短教程：

{% embed url="<https://youtu.be/64El3CVzg4c>" %}

### 嵌套工作流

你可以在创建工作流时，或在编辑现有工作流时，通过向 Copilot 提出这个需求来设置。

1. 打开 [工作流](https://studio.morphic.com/workflows) 并开始一个新工作流，或在现有工作流上打开“···”菜单并点击“编辑”
2. 像描述其他步骤一样描述这个步骤，并写出你希望它运行的工作流名称，例如“对于第 2 步，运行我的角色参考表工作流”
3. Copilot 会将它添加为一个步骤，并在工作流中与其他步骤一起显示出来

当父工作流运行到该步骤时，它会执行你指定的工作流，然后将其输出传递给后续步骤。

### 它为什么有帮助

* 在一个地方改进它。向某个构建块发布更改，所有调用它的工作流都会自动获取更新，因此你只需修一次，而不是在六个地方都修。
* 让每个工作流都保持可读。一个同时处理四项任务的长工作流很难编辑。四个工作流中有一个调用其他几个，会更容易理解，也更容易修正。

### 哪些场景下效果很好

* 保持角色或风格一致。先在独立的工作流中确定角色，然后在每个场景的工作流中调用它。这样每个场景都从同一个角色开始，而不是重新尝试。
* 适用于所有内容的收尾步骤。字幕样式、调色、交付格式：把它放在一个工作流里，并让其他工作流以它作为结尾，这样最后一环每次都一样。
* 具有不同阶段的长任务。先写脚本，再做分镜，然后拍镜头。每个阶段都是一个可以单独运行和修正的工作流，由一个工作流按顺序执行它们。
* 团队共享的工作内容。当一个人把某个步骤做对时，其他人就直接调用那个工作流，而不是再描述一遍该步骤并得到略有不同的结果。

### 如何从中获得更好的结果

* 让每个构建块只做一件事。一个把一件事做好 的工作流，比一个把三件事都做得还行的工作流更容易复用。
* 在嵌套之前，先单独运行一个构建块。把它放在更长的运行中修复，花费的时间会比单独修复更多。
* 按它的产出命名，比如“角色参考表”，这样就一目了然该调用哪个工作流。
* 让外层工作流负责顺序，让内层工作流负责细节。这样更改流程顺序时，就不需要重写这些步骤。

### 注意事项

* 你可以引用在 Morphic 上公开共享的工作流，不仅限于自己的，因此社区工作流也可以成为你工作流中的一个步骤。
* 每个嵌套工作流都会保留自己的版本历史，因此你可以单独追踪并撤销对某个构建块的更改。参见 [版本历史](/docs/zh/gong-zuo-liu/version-history.md).
* 在删除某个工作流之前，先检查是否有任何内容在调用它。调用它的工作流会留下一个没有可运行内容的步骤。

这就是 Morphic 中嵌套工作流的工作方式。当相同步骤出现在多个工作流中时，就使用它们。

***

如果您遇到任何问题或有任何疑问，欢迎随时联系我们。我们很乐意为您提供帮助。请写信至 [**support@morphic.com**](mailto:support@morphic.com)**.**


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://morphic.com/docs/zh/gong-zuo-liu/nested-workflows.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
