Monitor endpoints
The /monitor
endpoints are for internal Langflow functionality, primarily related to running flows in the Playground, storing chat history, and generating flow logs.
This information is primarily for those who are building custom components or contributing to the Langflow codebase in a way that requires calling or understanding these endpoints.
For typical application development with Langflow, there are more appropriate options for monitoring, debugging, and memory management. For more information, see the following:
- Logs: Langflow log storage locations, customization options, and where to view logs in the visual editor
- Test flows in the Playground: Run flows and inspect message history
- Memory management options: Langflow storage locations and options, including the database, cache, and chat history
Vertex buildsโ
The Vertex build endpoints (/monitor/builds
) are exclusively for Playground functionality.
When you run a flow in the Playground, Langflow calls the /build/$FLOW_ID/flow
endpoint in chat.py. This call retrieves the flow data, builds a graph, and executes the graph. As each component (or node) is executed, the build_vertex
function calls build_and_run
, which may call the individual components' def_build
method, if it exists. If a component doesn't have a def_build
function, the build still returns a component.
The build
function allows components to execute logic at runtime. For example, the Recursive Character Text Splitter component is a child of the LCTextSplitterComponent
class. When text needs to be processed, the parent class's build
method is called, which creates a RecursiveCharacterTextSplitter
object and uses it to split the text according to the defined parameters. The split text is then passed on to the next component. This all occurs when the component is built.
Get Vertex buildsโ
Retrieve Vertex builds for a specific flow.
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/monitor/builds?flow_id=$FLOW_ID" \_10 -H "accept: application/json" \_10 -H "x-api-key: $LANGFLOW_API_KEY"
Result
_357{_357 "vertex_builds": {_357 "ChatInput-NCmix": [_357 {_357 "data": {_357 "results": {_357 "message": {_357 "text_key": "text",_357 "data": {_357 "timestamp": "2024-12-23 19:10:57",_357 "sender": "User",_357 "sender_name": "User",_357 "session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_357 "text": "Hello",_357 "files": [],_357 "error": "False",_357 "edit": "False",_357 "properties": {_357 "text_color": "",_357 "background_color": "",_357 "edited": "False",_357 "source": {_357 "id": "None",_357 "display_name": "None",_357 "source": "None"_357 },_357 "icon": "",_357 "allow_markdown": "False",_357 "positive_feedback": "None",_357 "state": "complete",_357 "targets": []_357 },_357 "category": "message",_357 "content_blocks": [],_357 "id": "c95bed34-f906-4aa6-84e4-68553f6db772",_357 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"_357 },_357 "default_value": "",_357 "text": "Hello",_357 "sender": "User",_357 "sender_name": "User",_357 "files": [],_357 "session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_357 "timestamp": "2024-12-23 19:10:57+00:00",_357 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_357 "error": "False",_357 "edit": "False",_357 "properties": {_357 "text_color": "",_357 "background_color": "",_357 "edited": "False",_357 "source": {_357 "id": "None",_357 "display_name": "None",_357 "source": "None"_357 },_357 "icon": "",_357 "allow_markdown": "False",_357 "positive_feedback": "None",_357 "state": "complete",_357 "targets": []_357 },_357 "category": "message",_357 "content_blocks": []_357 }_357 },_357 "outputs": {_357 "message": {_357 "message": {_357 "timestamp": "2024-12-23T19:10:57",_357 "sender": "User",_357 "sender_name": "User",_357 "session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_357 "text": "Hello",_357 "files": [],_357 "error": false,_357 "edit": false,_357 "properties": {_357 "text_color": "",_357 "background_color": "",_357 "edited": false,_357 "source": {_357 "id": null,_357 "display_name": null,_357 "source": null_357 },_357 "icon": "",_357 "allow_markdown": false,_357 "positive_feedback": null,_357 "state": "complete",_357 "targets": []_357 },_357 "category": "message",_357 "content_blocks": [],_357 "id": "c95bed34-f906-4aa6-84e4-68553f6db772",_357 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"_357 },_357 "type": "object"_357 }_357 },_357 "logs": { "message": [] },_357 "message": {_357 "message": "Hello",_357 "sender": "User",_357 "sender_name": "User",_357 "files": [],_357 "type": "object"_357 },_357 "artifacts": {_357 "message": "Hello",_357 "sender": "User",_357 "sender_name": "User",_357 "files": [],_357 "type": "object"_357 },_357 "timedelta": 0.015060124918818474,_357 "duration": "15 ms",_357 "used_frozen_result": false_357 },_357 "artifacts": {_357 "message": "Hello",_357 "sender": "User",_357 "sender_name": "User",_357 "files": [],_357 "type": "object"_357 },_357 "params": "- Files: []\n Message: Hello\n Sender: User\n Sender Name: User\n Type: object\n",_357 "valid": true,_357 "build_id": "40aa200e-74db-4651-b698-f80301d2b26b",_357 "id": "ChatInput-NCmix",_357 "timestamp": "2024-12-23T19:10:58.772766Z",_357 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"_357 }_357 ],_357 "Prompt-BEn9c": [_357 {_357 "data": {_357 "results": {},_357 "outputs": {_357 "prompt": {_357 "message": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.",_357 "type": "text"_357 }_357 },_357 "logs": { "prompt": [] },_357 "message": {_357 "prompt": {_357 "repr": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.",_357 "raw": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.",_357 "type": "text"_357 }_357 },_357 "artifacts": {_357 "prompt": {_357 "repr": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.",_357 "raw": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.",_357 "type": "text"_357 }_357 },_357 "timedelta": 0.0057758750626817346,_357 "duration": "6 ms",_357 "used_frozen_result": false_357 },_357 "artifacts": {_357 "prompt": {_357 "repr": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.",_357 "raw": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.",_357 "type": "text"_357 }_357 },_357 "params": "None",_357 "valid": true,_357 "build_id": "39bbbfde-97fd-42a5-a9ed-d42a5c5d532b",_357 "id": "Prompt-BEn9c",_357 "timestamp": "2024-12-23T19:10:58.781019Z",_357 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"_357 }_357 ],_357 "OpenAIModel-7AjrN": [_357 {_357 "data": {_357 "results": {},_357 "outputs": {_357 "text_output": {_357 "message": "Hello! ๐ I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",_357 "type": "text"_357 },_357 "model_output": { "message": "", "type": "unknown" }_357 },_357 "logs": { "text_output": [] },_357 "message": {_357 "text_output": {_357 "repr": "Hello! ๐ I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",_357 "raw": "Hello! ๐ I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",_357 "type": "text"_357 }_357 },_357 "artifacts": {_357 "text_output": {_357 "repr": "Hello! ๐ I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",_357 "raw": "Hello! ๐ I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",_357 "type": "text"_357 }_357 },_357 "timedelta": 1.034765167045407,_357 "duration": "1.03 seconds",_357 "used_frozen_result": false_357 },_357 "artifacts": {_357 "text_output": {_357 "repr": "Hello! ๐ I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",_357 "raw": "Hello! ๐ I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",_357 "type": "text"_357 }_357 },_357 "params": "None",_357 "valid": true,_357 "build_id": "4f0ae730-a266-4d35-b89f-7b825c620a0f",_357 "id": "OpenAIModel-7AjrN",_357 "timestamp": "2024-12-23T19:10:58.790484Z",_357 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"_357 }_357 ],_357 "ChatOutput-sfUhT": [_357 {_357 "data": {_357 "results": {_357 "message": {_357 "text_key": "text",_357 "data": {_357 "timestamp": "2024-12-23 19:10:58",_357 "sender": "Machine",_357 "sender_name": "AI",_357 "session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_357 "text": "Hello! ๐ I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",_357 "files": [],_357 "error": "False",_357 "edit": "False",_357 "properties": {_357 "text_color": "",_357 "background_color": "",_357 "edited": "False",_357 "source": {_357 "id": "OpenAIModel-7AjrN",_357 "display_name": "OpenAI",_357 "source": "gpt-4o-mini"_357 },_357 "icon": "OpenAI",_357 "allow_markdown": "False",_357 "positive_feedback": "None",_357 "state": "complete",_357 "targets": []_357 },_357 "category": "message",_357 "content_blocks": [],_357 "id": "5688356d-9f30-40ca-9907-79a7a2fc16fd",_357 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"_357 },_357 "default_value": "",_357 "text": "Hello! ๐ I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",_357 "sender": "Machine",_357 "sender_name": "AI",_357 "files": [],_357 "session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_357 "timestamp": "2024-12-23 19:10:58+00:00",_357 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_357 "error": "False",_357 "edit": "False",_357 "properties": {_357 "text_color": "",_357 "background_color": "",_357 "edited": "False",_357 "source": {_357 "id": "OpenAIModel-7AjrN",_357 "display_name": "OpenAI",_357 "source": "gpt-4o-mini"_357 },_357 "icon": "OpenAI",_357 "allow_markdown": "False",_357 "positive_feedback": "None",_357 "state": "complete",_357 "targets": []_357 },_357 "category": "message",_357 "content_blocks": []_357 }_357 },_357 "outputs": {_357 "message": {_357 "message": {_357 "timestamp": "2024-12-23T19:10:58",_357 "sender": "Machine",_357 "sender_name": "AI",_357 "session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_357 "text": "Hello! ๐ I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",_357 "files": [],_357 "error": false,_357 "edit": false,_357 "properties": {_357 "text_color": "",_357 "background_color": "",_357 "edited": false,_357 "source": {_357 "id": "OpenAIModel-7AjrN",_357 "display_name": "OpenAI",_357 "source": "gpt-4o-mini"_357 },_357 "icon": "OpenAI",_357 "allow_markdown": false,_357 "positive_feedback": null,_357 "state": "complete",_357 "targets": []_357 },_357 "category": "message",_357 "content_blocks": [],_357 "id": "5688356d-9f30-40ca-9907-79a7a2fc16fd",_357 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"_357 },_357 "type": "object"_357 }_357 },_357 "logs": { "message": [] },_357 "message": {_357 "message": "Hello! ๐ I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",_357 "sender": "Machine",_357 "sender_name": "AI",_357 "files": [],_357 "type": "object"_357 },_357 "artifacts": {_357 "message": "Hello! ๐ I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",_357 "sender": "Machine",_357 "sender_name": "AI",_357 "files": [],_357 "type": "object"_357 },_357 "timedelta": 0.017838125000707805,_357 "duration": "18 ms",_357 "used_frozen_result": false_357 },_357 "artifacts": {_357 "message": "Hello! ๐ I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!",_357 "sender": "Machine",_357 "sender_name": "AI",_357 "files": [],_357 "type": "object"_357 },_357 "params": "- Files: []\n Message: Hello! ๐ I'm excited to help you get started on your journey to building\n something fresh! What do you have in mind? Whether it's a project, an idea, or\n a concept, let's dive in and make it happen!\n Sender: Machine\n Sender Name: AI\n Type: object\n",_357 "valid": true,_357 "build_id": "1e8b908b-aba7-403b-9e9b-eca92bb78668",_357 "id": "ChatOutput-sfUhT",_357 "timestamp": "2024-12-23T19:10:58.813268Z",_357 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"_357 }_357 ]_357 }_357}
Delete Vertex buildsโ
Delete Vertex builds for a specific flow.
_10curl -X DELETE \_10 "$LANGFLOW_URL/api/v1/monitor/builds?flow_id=$FLOW_ID" \_10 -H "accept: */*" \_10 -H "x-api-key: $LANGFLOW_API_KEY"
Result
_10204 No Content
Messages endpointsโ
The /monitor/messages
endpoints store, retrieve, edit, and delete records in the message table in langflow.db
Typically, these are called implicitly when running flows that produce message history, or when inspecting and modifying Playground memories.
Get messagesโ
Retrieve a list of all messages:
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/monitor/messages" \_10 -H "accept: application/json" \_10 -H "x-api-key: $LANGFLOW_API_KEY"
To filter messages, use the flow_id
, session_id
, sender
, and sender_name
query parameters.
To sort the results, use the order_by
query parameter.
This example retrieves messages sent by Machine
and AI
in a given chat session (session_id
) and orders the messages by timestamp.
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/monitor/messages?flow_id=$FLOW_ID&session_id=01ce083d-748b-4b8d-97b6-33adbb6a528a&sender=Machine&sender_name=AI&order_by=timestamp" \_10 -H "accept: application/json" \_10 -H "x-api-key: $LANGFLOW_API_KEY"
Result
_30[_30 {_30 "id": "1c1d6134-9b8b-4079-931c-84dcaddf19ba",_30 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_30 "timestamp": "2024-12-23 19:20:11 UTC",_30 "sender": "Machine",_30 "sender_name": "AI",_30 "session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_30 "text": "Hello! It's great to see you here! What exciting project or idea are you thinking about diving into today? Whether it's something fresh and innovative or a classic concept with a twist, I'm here to help you get started! Let's brainstorm together!",_30 "files": "[]",_30 "edit": false,_30 "properties": {_30 "text_color": "",_30 "background_color": "",_30 "edited": false,_30 "source": {_30 "id": "OpenAIModel-7AjrN",_30 "display_name": "OpenAI",_30 "source": "gpt-4o-mini"_30 },_30 "icon": "OpenAI",_30 "allow_markdown": false,_30 "positive_feedback": null,_30 "state": "complete",_30 "targets": []_30 },_30 "category": "message",_30 "content_blocks": []_30 }_30]
Delete messagesโ
Delete specific messages by their IDs.
This example deletes the message retrieved in the previous GET /messages
example.
_10curl -v -X DELETE \_10 "$LANGFLOW_URL/api/v1/monitor/messages" \_10 -H "accept: */*" \_10 -H "Content-Type: application/json" \_10 -H "x-api-key: $LANGFLOW_API_KEY" \_10 -d '["MESSAGE_ID_1", "MESSAGE_ID_2"]'
Result
_10204 No Content
Update messageโ
Update a specific message by its ID.
This example updates the text
value of message 3ab66cc6-c048-48f8-ab07-570f5af7b160
.
_10curl -X PUT \_10 "$LANGFLOW_URL/api/v1/monitor/messages/3ab66cc6-c048-48f8-ab07-570f5af7b160" \_10 -H "accept: application/json" \_10 -H "Content-Type: application/json" \_10 -H "x-api-key: $LANGFLOW_API_KEY" \_10 -d '{_10 "text": "testing 1234"_10}'
Result
_25{_25 "timestamp": "2024-12-23T18:49:06",_25 "sender": "string",_25 "sender_name": "string",_25 "session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_25 "text": "testing 1234",_25 "files": ["string"],_25 "error": true,_25 "edit": true,_25 "properties": {_25 "text_color": "string",_25 "background_color": "string",_25 "edited": false,_25 "source": { "id": "string", "display_name": "string", "source": "string" },_25 "icon": "string",_25 "allow_markdown": false,_25 "positive_feedback": true,_25 "state": "complete",_25 "targets": []_25 },_25 "category": "message",_25 "content_blocks": [],_25 "id": "3ab66cc6-c048-48f8-ab07-570f5af7b160",_25 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a"_25}
Update session IDโ
Update the session ID for messages.
This example updates the session_ID
value 01ce083d-748b-4b8d-97b6-33adbb6a528a
to different_session_id
.
_10curl -X PATCH \_10 "$LANGFLOW_URL/api/v1/monitor/messages/session/01ce083d-748b-4b8d-97b6-33adbb6a528a?new_session_id=different_session_id" \_10 -H "accept: application/json" \_10 -H "x-api-key: $LANGFLOW_API_KEY"
Result
_30[_30 {_30 "id": "8dd7f064-e63a-4773-b472-ca0475249dfd",_30 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_30 "timestamp": "2024-12-23 18:49:55 UTC",_30 "sender": "User",_30 "sender_name": "User",_30 "session_id": "different_session_id",_30 "text": "message",_30 "files": "[]",_30 "edit": false,_30 "properties": {_30 "text_color": "",_30 "background_color": "",_30 "edited": false,_30 "source": {_30 "id": null,_30 "display_name": null,_30 "source": null_30 },_30 "icon": "",_30 "allow_markdown": false,_30 "positive_feedback": null,_30 "state": "complete",_30 "targets": []_30 },_30 "category": "message",_30 "content_blocks": []_30 }_30]
Delete messages by sessionโ
Delete all messages for a specific session.
_10curl -X DELETE \_10 "$LANGFLOW_URL/api/v1/monitor/messages/session/different_session_id_2" \_10 -H "accept: */*" \_10 -H "x-api-key: $LANGFLOW_API_KEY"
Result
_10HTTP/1.1 204 No Content
Get transactionsโ
Retrieve all transactions, which are interactions between components, for a specific flow. This information is also available in flow logs.
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/monitor/transactions?flow_id=$FLOW_ID&page=1&size=50" \_10 -H "accept: application/json" \_10 -H "x-api-key: $LANGFLOW_API_KEY"
Result
_19{_19 "items": [_19 {_19 "timestamp": "2024-12-23T20:05:01.061Z",_19 "vertex_id": "string",_19 "target_id": "string",_19 "inputs": {},_19 "outputs": {},_19 "status": "string",_19 "error": "string",_19 "flow_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_19 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_19 }_19 ],_19 "total": 0,_19 "page": 1,_19 "size": 1,_19 "pages": 0_19}