---
title: "Watch an Operation to its end"
description: "Open one stream for one Operation and receive each change until the work ends, over Server-Sent Events."
url: "https://harnesty.com/en/docs/operations/watch-an-operation"
language: "en"
kind: "docs"
updated: "2026-11-30"
summary:
  - "A watch sends each change of one Operation as it happens."
  - "The last event states how the work ended, and the stream closes."
  - "A dropped stream resumes after the last event you received."
sources:
  - title: "Operations"
    url: "https://harnesty.com/en/docs/operations"
  - title: "Workspace REST and MCP reference"
    url: "https://harnesty.com/en/docs/workspace-reference"
---

# Watch an Operation to its end

You want to know the moment a durable call ends, without reading its Operation again and again. A watch sends each change of one Operation as it happens, and it closes when the work ends.

## In short

- A watch sends each change of one Operation as it happens.
- The last event states how the work ended, and the stream closes.
- A dropped stream resumes after the last event you received.

1. Call [`operation.watch`](https://harnesty.com/en/docs/workspace-reference#operation.watch@v1) with the Operation's identity. Over HTTP, read the answer as a Server-Sent Events stream. A browser `EventSource` does this for you.
1. Read the first event. It is the submission of the work.
1. Read each later event. Each one is a change of state, or the Operation being held for a person to look at. While nothing changes, a heartbeat arrives, and it needs nothing from you.
1. If the connection drops, reconnect with the `Last-Event-ID` header set to the id of the last event you received. The stream continues after that event, and a browser `EventSource` sends the header for you.
1. Read the last event. It states how the work ended, it carries the result, and the stream closes. Where it carries a reference to the result instead of the result itself, [read the Operation](https://harnesty.com/en/docs/operations/read-an-operation) to get it.

You are done when the stream closes after an event that states how the work ended. If the watch is refused before its first event, no stream opens, and the answer carries the refusal's code. If the stream closes with a refusal code instead, a Mandate you watch under was revoked or your Principal was barred while you watched. If the work had already ended when you opened the stream, you receive its history and its last event at once, and then the stream closes.

## Sources

1. [Operations](https://harnesty.com/en/docs/operations)
1. [Workspace REST and MCP reference](https://harnesty.com/en/docs/workspace-reference)
