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

# Read workflow source

> Read the editable source behind one workflow before changing it; returns the workflow source document with its source text, edit mode and the reasons it can only be edited as source.

`veryfront__read_workflow_source`

Requires project.runs.read.

## Access

No external-service connection is required. Use a Veryfront credential with access to the requested resources.

**Call type:** Read-only.

## Arguments

| Field | Type | Required | Description and constraints |
| - | - | - | - |
| `project_reference` | `string` | No | Project ID or slug |
| `workflow_id` | `string` | Yes | Workflow ID from [`list_workflows`](https://veryfront.com/docs/cloud/mcp/tools/list-workflows) |
| `runtime_target_kind` | `string or null` | No | Provide the runtime target kind. |
| `target_environment_id` | `string or null` | No | Provide the target environment id. |
| `target_branch_id` | `string or null` | No | Provide the target branch id. |
| `source_target_kind` | `string` | No | Provide the source target kind. Values: `"project"`, `"main_branch"`, `"environment"`, `"preview_branch"`. |

## Example request

Send this JSON-RPC request through an initialized MCP client. Replace sample identifiers and values before calling the tool. See [MCP client setup](https://veryfront.com/docs/cloud/getting-started/connect-mcp.md).

```json title="request.json" theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "veryfront__read_workflow_source",
    "arguments": {
      "workflow_id": "example"
    }
  }
}
```

## Result

The published output shape is summarized below. Inspect both the MCP response content and `isError` when handling a call.

| Field | Type | Required | Description and constraints |
| - | - | - | - |
| `id` | `string` | Yes | Workflow identifier. |
| `name` | `string` | Yes | Human-readable workflow name. |
| `description` | `string or null` | Yes | Short description of the workflow purpose. |
| `target` | `string` | Yes | Execution target that implements the workflow. |
| `source_path` | `string` | Yes | Source file path where the workflow definition lives. |
| `source` | `string` | Yes | Workflow source code or structured document content. |
| `version` | `string or null` | Yes | Version string for the workflow definition, when tracked. |
| `schedulable` | `boolean` | Yes | Whether the workflow can be triggered by schedulers. |
| `edit_mode` | `string` | Yes | Editing mode supported for the workflow definition. Values: `"structured"`, `"source_only"`. |
| `source_only_reasons` | `string[]` | Yes | Reasons why the workflow can only be edited as raw source, when applicable. |

## Full schemas

```json title="input-schema.json" theme={null}
{
  "type": "object",
  "properties": {
    "project_reference": {
      "type": "string",
      "description": "Project ID or slug"
    },
    "workflow_id": {
      "type": "string",
      "description": "Workflow ID from list_workflows"
    },
    "runtime_target_kind": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "main_branch",
            "environment",
            "preview_branch"
          ],
          "description": "Provide the runtime target kind."
        },
        {
          "type": "null",
          "description": "Provide the runtime target kind."
        }
      ],
      "description": "Provide the runtime target kind."
    },
    "target_environment_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "description": "Provide the target environment id."
        },
        {
          "type": "null",
          "description": "Provide the target environment id."
        }
      ],
      "description": "Provide the target environment id."
    },
    "target_branch_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "description": "Provide the target branch id."
        },
        {
          "type": "null",
          "description": "Provide the target branch id."
        }
      ],
      "description": "Provide the target branch id."
    },
    "source_target_kind": {
      "type": "string",
      "enum": [
        "project",
        "main_branch",
        "environment",
        "preview_branch"
      ],
      "description": "Provide the source target kind."
    }
  },
  "required": [
    "workflow_id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "Arguments for the read_workflow_source tool."
}
```

```json title="output-schema.json" theme={null}
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Workflow identifier."
    },
    "name": {
      "type": "string",
      "description": "Human-readable workflow name."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Short description of the workflow purpose."
    },
    "target": {
      "type": "string",
      "description": "Execution target that implements the workflow."
    },
    "source_path": {
      "type": "string",
      "description": "Source file path where the workflow definition lives."
    },
    "source": {
      "type": "string",
      "description": "Workflow source code or structured document content."
    },
    "version": {
      "type": [
        "string",
        "null"
      ],
      "description": "Version string for the workflow definition, when tracked."
    },
    "schedulable": {
      "type": "boolean",
      "description": "Whether the workflow can be triggered by schedulers."
    },
    "edit_mode": {
      "type": "string",
      "enum": [
        "structured",
        "source_only"
      ],
      "description": "Editing mode supported for the workflow definition."
    },
    "source_only_reasons": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Reasons why the workflow can only be edited as raw source, when applicable."
    }
  },
  "required": [
    "id",
    "name",
    "description",
    "target",
    "source_path",
    "source",
    "version",
    "schedulable",
    "edit_mode",
    "source_only_reasons"
  ],
  "additionalProperties": false,
  "description": "Workflow definition including editable source content.",
  "$schema": "http://json-schema.org/draft-07/schema#"
}
```

<details>
  <summary>Try this tool</summary>

  Replace sample arguments with values for your project or connected account. Calls run only when you select Run tool.

  MCP tool call

  Call `veryfront__read_workflow_source` against the Veryfront MCP endpoint.

  Bearer token or API key

  Arguments (JSON)

  Run tool

  Output JSON

  <pre />
</details>


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