> 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/advanced-functions-and-tools/docbits-operator/triggering-prompts-with-a-workflow.md).

# Triggering Prompts with a Workflow

This guide explains how to configure a DocBits workflow to automatically trigger a saved prompt. This allows you to integrate Operator prompts into document processing flows without manual input.

### Step 1: Create a Prompt

Before linking a prompt to a workflow:

* Ensure your prompt is already created
* Include all necessary **variables** in the prompt body.

If you need help writing or saving prompts, refer to the [Prompt Writing Guide](https://docs.docbits.com/advanced-functions-and-tools/docbits-operator/prompt-writing-guide.md) and [Operator Interface Overview](https://docs.docbits.com/advanced-functions-and-tools/docbits-operator.md).

### Step 2: Set Up the Workflow

Before configuring the Operator Prompt card, make sure your workflow is properly created.

1. Navigate to the **Workflow Builder** in the DocBits interface.
2. Create a new workflow or open an existing one.
3. Define the **trigger conditions**—these determine when the workflow will start (e.g., document type, status, field presence, etc.).
4. Add the necessary **action steps** to your workflow as needed.

<div align="left"><figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-511197651474c81729c39cdf663984de73bd2815%2Fworkflow_setup_example.png?alt=media" alt="Workflow Setup Example"><figcaption></figcaption></figure></div>

### Step 3: Configure the Operator Prompt Card in the Workflow

In the Workflow Builder, use the **Operator Prompt card** to configure a prompt that should execute when the workflow's conditions are met.

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

#### Key Configuration Options

* **Script:** Select the saved **Organization Prompt** to be executed.
* **Script Data (Variables):** If the selected prompt contains variables, define their values here using key-value pairs.
  * If a variable is left empty here, the system will attempt to automatically populate it **from the document**.
  * For this to work, the variable name in the prompt must **exactly match** the **field ID** of the document attribute.
* **Max Steps:** Define the maximum number of steps the operator is allowed to execute during this prompt.
* **Max Retries:** Set how many times the system should retry the prompt in case of failure.
* **Execution Mode:** Choose whether the prompt should run:
  * **In the Cloud**
  * **On-Premises** (required if your ERP or target system is hosted locally)


---

# 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/advanced-functions-and-tools/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.
