> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/chinese/gao-ji-gong-neng-yu-gong-ju/docbits-operator/triggering-prompts-with-a-workflow.md).

# 使用工作流触发提示

本指南介绍如何配置 DocBits 工作流，以自动触发已保存的提示。这样，您无需手动输入，即可将 Operator 提示集成到文档处理流程中。

### 步骤 1：创建提示

将提示关联到工作流之前：

* 确保已创建提示
* 在提示正文中包含所有必需的**变量**。

如需了解如何编写或保存提示，请参阅[提示编写指南](/chinese/gao-ji-gong-neng-yu-gong-ju/docbits-operator/prompt-writing-guide.md)和[Operator 界面概览](/chinese/gao-ji-gong-neng-yu-gong-ju/docbits-operator.md)。

### 步骤 2：设置工作流

配置 Operator Prompt 卡片之前，请确保已正确创建工作流。

1. 在 DocBits 界面中进入**工作流构建器**（Workflow Builder）。
2. 创建新工作流，或打开现有工作流。
3. 定义**触发条件**——这些条件决定工作流何时启动（例如，文档类型、状态、字段是否存在等）。
4. 根据需要向工作流添加必要的**操作步骤**。

<div align="left"><figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-511197651474c81729c39cdf663984de73bd2815%2Fworkflow_setup_example.png?alt=media" alt="工作流设置示例"><figcaption></figcaption></figure></div>

### 步骤 3：在工作流中配置 Operator Prompt 卡片

在工作流构建器中，使用**Operator Prompt 卡片**配置提示。满足工作流条件时，该提示将执行。

<div align="left"><figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-e0a02167c565107b57dcd2d3a26386011c8a8a12%2Foperator_prompt_card_configuration.png?alt=media" alt="Operator Prompt 卡片配置"><figcaption></figcaption></figure></div>

#### 主要配置选项

* **Script：** 选择要执行的已保存**组织提示**（Organization Prompt）。
* **Script Data（变量）：** 如果所选提示包含变量，请在此处使用键值对定义变量的值。
  * 如果此处的变量值留空，系统将尝试**从文档中**自动填充。
  * 要实现此功能，提示中的变量名称必须与文档属性的**字段 ID 完全一致**。
* **Max Steps：** 定义允许 Operator 在执行此提示期间执行的最大步骤数。
* **Max Retries：** 设置提示失败时系统应重试的次数。
* **Execution Mode：** 选择提示的运行位置：
  * **In the Cloud（云端）**
  * **On-Premises（本地部署）**（如果 ERP 或目标系统托管在本地，则必须选择此项）


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docbits.com/chinese/gao-ji-gong-neng-yu-gong-ju/docbits-operator/triggering-prompts-with-a-workflow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
