diff --git a/docs/docs/examples/flow-runner.mdx b/docs/docs/examples/flow-runner.mdx
index ddcee5f40..846a5b186 100644
--- a/docs/docs/examples/flow-runner.mdx
+++ b/docs/docs/examples/flow-runner.mdx
@@ -90,7 +90,7 @@ class FlowRunner(CustomComponent):
```
-Second, we will import _`Document`_ from the [*langchain.schema*](https://docs.langchain.com/docs/components/schema/) module. This will be the return type of the _`build`_ method.
+Second, we will import _`Document`_ from the [_langchain.schema_](https://docs.langchain.com/docs/components/schema/) module. This will be the return type of the _`build`_ method.
---
@@ -120,7 +120,7 @@ Now, let's add the [parameters](focus://11[20:55]) and the [return type](focus:/
---
-```python
+```python focus=13:14
from langflow import CustomComponent
from langchain.schema import Document
@@ -133,9 +133,7 @@ class FlowRunner(CustomComponent):
...
def build(self, flow_name: str, document: Document) -> Document:
- # focus
# List the flows
- # focus
flows = self.list_flows()
```
@@ -144,7 +142,7 @@ We can now start writing the _`build`_ method. Let's list available flows in "My
---
-```python
+```python focus=15:18
from langflow import CustomComponent
from langchain.schema import Document
@@ -159,17 +157,19 @@ class FlowRunner(CustomComponent):
def build(self, flow_name: str, document: Document) -> Document:
# List the flows
flows = self.list_flows()
- # focus
# Get the flow that matches the selected name
- # focus
- flow = next(filter(lambda f: f.name == flow_name, flows))
+ # You can also get the flow by id
+ # using self.get_flow(flow_id=flow_id)
+ flow = self.get_flow(flow_name=flow_name)
```
And retrieve a flow that matches the selected name (we'll make a dropdown input field for the user to choose among flow names).