Skip to content

Commit 1d1ac46

Browse files
npowNissan Pow
andauthored
Document how to get run ID from Runner result (#182)
Co-authored-by: Nissan Pow <npow@netflix.com>
1 parent 41ea29d commit 1d1ac46

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎docs/metaflow/managing-flows/runner.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,26 @@ with Runner('slowflow.py', show_output=False).run(seconds=SECONDS) as running:
8888

8989
Note that we set `show_output=False` to hide the output of the run while it executes.
9090

91+
### Getting the run ID
92+
93+
To get the run ID of a completed (or in-progress) run, use `running.run.id`. The full pathspec
94+
(`FlowName/RunID`) is available via `running.run.pathspec`:
95+
96+
```python
97+
from metaflow import Runner
98+
with Runner('slowflow.py').run() as running:
99+
print(running.run.id) # e.g. "12345"
100+
print(running.run.pathspec) # e.g. "SlowFlow/12345"
101+
```
102+
103+
This is the same `Run` object you would get from [the Client API](/metaflow/client), so you can
104+
pass the ID directly to `Run` to retrieve the run later:
105+
106+
```python
107+
from metaflow import Run
108+
run = Run(f'SlowFlow/{run_id}')
109+
```
110+
91111
### Passing parameters
92112

93113
You can pass parameters to the run through the keyword arguments in `run`, such as `seconds` above.

0 commit comments

Comments
 (0)