WorkflowRun

refresh()

run.refresh() → Promise<WorkflowRun>

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

one requestfreereturns this
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

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

// It returns the run, so it chains
const status = (await run.refresh()).data.status;
run.refresh()
print(run.data["status"])

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

Why it is explicit

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

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

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

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