> 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/on-premise-execution-flow.md).

# On‑Premise Execution Flow

For customers running DocBits Operator on‑premises, the following sequence describes how a processed document triggers and executes an Operator prompt via the local DocBits Agent.

1. **Document Uploade & Processing**\
   A document is uploaded into DocBits and goes through the standard processing (Extraction, validation, etc.).
2. **Workflow Trigger**\
   Once processing completes, a configured Workflow in DocBits evaluates its trigger conditions. When those conditions are met, the Workflow creates a new **Operator Task**.
3. **Task Creation & Dispatch**
   * The workflow sends the script text, variables, max‑steps, max‑retries as a task payload to the shared Work Pool.
4. **Agent Polling Loop**
   * An on‑prem DocBits Agent (installed in the customer environment) polls the Work Pool every 5 minutes. If no tasks are found, the agent remains idle and retries after the interval.
5. **Task Execution**
   * When a task appears in the Work Pool, the Agent retrieves it and begins execution.
6. **Log Generation**
   * For each step—success or failure—the agent records detailed logs (actions, statuses, timestamps). Upon completion, it compiles the full log and final status.
7. **Result Return & Display**
   * The agent sends the logs and status back to DocBits. The originating workflow’s run history is updated, and users can review details in the **Workflow Logs** tab.


---

# 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/on-premise-execution-flow.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.
