# Run.watch()
[EN] Source: https://mastra.ai/reference/workflows/run-methods/watch

The `.watch()` method allows you to monitor the execution of a workflow run, providing real-time updates on the status of steps.

## Usage example

```typescript showLineNumbers copy
const run = await workflow.createRunAsync();

run.watch((event) => {
  console.log(event?.payload?.currentStep?.id);
});

const result = await run.start({ inputData: { value: "initial data" } });
```

## Parameters

<PropertiesTable
  content={[
    {
      name: "callback",
      type: "(event: WatchEvent) => void",
      description:
        "A callback function that is called whenever a step is completed or the workflow state changes. The event parameter contains: type ('watch'), payload (currentStep and workflowState), and eventTimestamp",
      isOptional: false,
    },
    {
      name: "type",
      type: "'watch' | 'watch-v2'",
      description:
        "The type of watch events to listen for. 'watch' for step completion events, 'watch-v2' for data stream events",
      isOptional: true,
      defaultValue: "'watch'",
    },
  ]}
/>

## Returns

<PropertiesTable
  content={[
    {
      name: "unwatch",
      type: "() => void",
      description:
        "A function that can be called to stop watching the workflow run",
    },
  ]}
/>

## Extended usage example

```typescript showLineNumbers copy
const run = await workflow.createRunAsync();

run.watch((event) => {
  console.log(event?.payload?.currentStep?.id);
}, "watch");

const result = await run.start({ inputData: { value: "initial data" } });
```

## Related

- [Workflows overview](/docs/workflows/overview#running-workflows)
- [Workflow.createRunAsync()](../workflow-methods/create-run)
- [Watch Workflow](/docs/workflows/overview)


---
title: "Reference: Run Class | Workflows"
description: Documentation for the Run class in Mastra, which represents a workflow execution instance.
---