# Mastra.getWorkflow()
[EN] Source: https://mastra.ai/reference/core/getWorkflow

The `.getWorkflow()` method is used to retrieve a workflow by its ID. The method accepts a workflow ID and an optional options object.

## Usage example

```typescript copy
mastra.getWorkflow("testWorkflow");
```

## Parameters

<PropertiesTable
  content={[
    {
      name: "id",
      type: "TWorkflowId extends keyof TWorkflows",
      description:
        "The ID of the workflow to retrieve. Must be a valid workflow ID that exists in the Mastra configuration.",
    },
    {
      name: "options",
      type: "{ serialized?: boolean }",
      description:
        "Optional configuration object. When `serialized` is true, returns only the workflow name instead of the full workflow instance.",
      optional: true,
    },
  ]}
/>

## Returns

<PropertiesTable
  content={[
    {
      name: "workflow",
      type: "TWorkflows[TWorkflowId]",
      description:
        "The workflow instance with the specified ID. Throws an error if the workflow is not found.",
    },
  ]}
/>

## Related

- [Workflows overview](/docs/workflows/overview)


---
title: "Reference: Mastra.getWorkflows() | Core"
description: "Documentation for the `Mastra.getWorkflows()` method in Mastra, which retrieves all configured workflows."
---