> 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-mcp/docflow-mcp/workflow-tools.md). Agents can also search and read this documentation through its [MCP server](https://docs.docbits.com/~gitbook/mcp).

# Workflow Tools

DocFlow MCP exposes tools for managing and testing advanced workflows, plus tools for reading workflow logs and managing workflow variables.

{% hint style="info" %}
**Tool names through the DocBits MCP gateway.** When you connect through the unified DocBits MCP (`api.docbits.com/v3/mcp`), every DocFlow tool carries the prefix `docflow_`: `list_workflows` is called `docflow_list_workflows`, `run_workflow_with_assertions` is `docflow_run_workflow_with_assertions`. The parameters are identical. The names below are the bare DocFlow names.

Workflows are **created and edited in the DocFlow designer** in the web app. The MCP reads, tests, runs and deletes them; it does not create or modify workflow graphs.
{% endhint %}

The Card SDK tools live in their own page, see [Card SDK Tools](https://docs.docbits.com/advanced-functions-and-tools/docbits-mcp/docflow-mcp/card-sdk-tools.md).

## list\_workflows

List all workflows for the current organization.

**Parameters:** None

## get\_workflow

Get details of a specific workflow including its node and edge structure.

**Parameters:**

| Parameter     | Type   | Required | Description          |
| ------------- | ------ | -------- | -------------------- |
| `workflow_id` | string | Yes      | UUID of the workflow |

## delete\_workflow

Delete a workflow by ID (soft delete).

**Parameters:**

| Parameter     | Type   | Required | Description                |
| ------------- | ------ | -------- | -------------------------- |
| `workflow_id` | string | Yes      | UUID of workflow to delete |

## test\_advanced\_workflow

Test an advanced workflow execution. Optionally provide a document ID to test with a real document.

**Parameters:**

| Parameter     | Type   | Required | Description                     |
| ------------- | ------ | -------- | ------------------------------- |
| `workflow_id` | string | Yes      | UUID of the advanced workflow   |
| `doc_id`      | string | No       | UUID of a document to test with |

## list\_test\_scenarios

List all workflow test scenarios for the organization.

**Parameters:** None

## list\_cards

List all available workflow cards with their conditions and configuration.

**Parameters:** None

{% hint style="info" %}
Cards have role flags: `when_condition` (trigger), `and_condition` (additional condition), and `then_condition` (action). Use these to determine which node types a card can be used in.
{% endhint %}

## list\_workflow\_variables

List all workflow variables of the organization with name, type and current value.

**Parameters:** None

## set\_workflow\_variable

Create a workflow variable or update its value. Document-type variables have no value of their own; they are set by the workflow at run time.

**Parameters:**

| Parameter  | Type   | Required | Description                                                              |
| ---------- | ------ | -------- | ------------------------------------------------------------------------ |
| `name`     | string | Yes      | Variable name                                                            |
| `value`    | string | No       | New value                                                                |
| `var_type` | string | No       | Variable type when creating (for example `string`, `number`, `document`) |

## search\_workflow\_logs

Search workflow execution logs to find out why runs failed, succeeded or hit a condition mismatch.

**Parameters:**

| Parameter               | Type    | Required | Description                                      |
| ----------------------- | ------- | -------- | ------------------------------------------------ |
| `workflow_id`           | string  | No       | Limit to one workflow                            |
| `doc_id`                | string  | No       | Limit to runs for one document                   |
| `status`                | string  | No       | Run status to filter by                          |
| `keyword`               | string  | No       | Free-text filter on the log                      |
| `include_workflow_data` | boolean | No       | Include the workflow definition snapshot per run |
| `limit` / `offset`      | integer | No       | Paging                                           |

## get\_workflow\_log\_detail

Full detail of one run: the raw card execution logs and the workflow definition as it was at run time.

**Parameters:**

| Parameter | Type   | Required | Description                              |
| --------- | ------ | -------- | ---------------------------------------- |
| `log_id`  | string | Yes      | Log entry id from `search_workflow_logs` |

## run\_workflow\_with\_assertions

Seed workflow variables, run an advanced workflow with the real executor and check the outcome against the database. Variables are real writes, not mocks, use it to integration-test a workflow from an assistant.

**Parameters:**

| Parameter        | Type   | Required | Description                                                                                               |
| ---------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------- |
| `workflow_id`    | string | Yes      | UUID of the workflow to run                                                                               |
| `doc_id`         | string | No       | Document to run the workflow against                                                                      |
| `seed_variables` | array  | No       | Variables to create or update before the run; document-type variables can point at a `doc_id` via `value` |


---

# 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-mcp/docflow-mcp/workflow-tools.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.
