# refresh()

Canonical URL: https://developers.iagenify.com/sdk/ref/workflow-run/refresh/
Language: en

`run.refresh() → Promise<WorkflowRun>`

Re-reads the run and replaces data. One request, and it returns the same object.

Status: one request · free · returns this

```javascript
await run.refresh();
console.log(run.data.status);

// It returns the run, so it chains
const status = (await run.refresh()).data.status;
```

## Why it is explicit {#why}

> **data never updates itself**
>
> A run moves on the platform with nothing telling your process. Reading data twice without a refresh gives the same snapshot — which is the honest behaviour, and the reason this method exists.

## Prefer wait() for polling {#polling}

[wait()](/sdk/ref/workflow-run/wait) refreshes on an interval until a status you named is reached, with a ceiling. Writing that loop yourself is the same thing with more ways to get it wrong.

## After resume, retry and cancel {#after}

Those three already replace `data` with the state the platform returned, so an extra refresh after one of them is not needed.

## It is free {#cost}

Reading a run costs nothing. What costs is what the run does.

- [wait()](/sdk/ref/workflow-run/wait): Polling properly.
- [data](/sdk/ref/workflow-run/data): What you are reading.

```python
run.refresh()
print(run.data["status"])

# It returns the run, so it chains
status = run.refresh().data["status"]
```
