> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langdock.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Workflow

> Read a workflow draft, published graph, version history, and limits

Returns a workflow the API key user can view. The response includes the draft graph, the published graph when one exists, version history, and execution limits.

## Base URL

```
https://api.langdock.com/workflows/v1/get
```

> [!WARNING]
>
> **Dedicated deployments**
>
> Replace `api.langdock.com` with `<your-deployment-url>/api/public` in all requests.

## Required scopes

This endpoint requires the `WORKFLOW_API` scope (**Workflow Read API**).

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `workflowId` | string | Yes | UUID of the workflow. Passed as a query parameter. |

## Example

```javascript theme={null}
const axios = require("axios");

async function getWorkflow(workflowId) {
  const response = await axios.get(
    "https://api.langdock.com/workflows/v1/get",
    {
      params: { workflowId },
      headers: {
        Authorization: "Bearer YOUR_API_KEY"
      }
    }
  );

  console.log("Draft version:", response.data.workflow.version);
  return response.data.workflow;
}

getWorkflow("550e8400-e29b-41d4-a716-446655440000");
```

## Response format

### Success response (200 OK)

```typescript theme={null}
{
  workflow: object;
}
```

`workflow` matches the object on [Workflow API Overview](/en/developer/workflow-api/workflows-overview.md). Secret-like fields are redacted. Sending that redacted graph back through [update](/en/developer/workflow-api/update-workflow.md) keeps the stored secrets.

## Error handling

| Status code | Description |
| - | - |
| 400 | Invalid workflow ID |
| 401 | Invalid or missing API key |
| 403 | Missing `WORKFLOW_API` scope |
| 404 | Workflow not found, or the key user cannot view it |
| 429 | Rate limit exceeded |
| 500 | Internal server error |

> [!NOTE]
>
> Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on [API Key Best Practices](/en/admin/ai-adoption-and-rollout/best-practices/api-key-best-practices.md).


## OpenAPI

````yaml GET /workflows/v1/get
openapi: 3.0.0
info:
  title: Langdock API
  version: 3.0.0
servers:
  - url: https://api.langdock.com
    description: Production
security:
  - bearerAuth: []
paths:
  /workflows/v1/get:
    get:
      tags:
        - Workflows
      summary: Get a workflow
      description: >-
        Returns a workflow the API key user can view, including the draft graph,
        published graph, version history, and execution limits.
      operationId: getWorkflow
      parameters:
        - name: workflowId
          in: query
          required: true
          schema:
            type: string
            format: uuid
          description: UUID of the workflow.
      responses:
        '200':
          description: Workflow returned successfully
        '400':
          description: Invalid workflow ID
        '401':
          description: Invalid or missing API key
        '403':
          description: Missing WORKFLOW_API scope
        '404':
          description: Workflow not found, or the key user cannot view it
        '429':
          description: Rate limit exceeded
        '500':
          description: Internal server error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key as Bearer token. Format "Bearer YOUR_API_KEY"

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.