-
Notifications
You must be signed in to change notification settings - Fork 6.1k
feat: ability to run flow without langflow server #7507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isnt the same experience as Run flow from JSON which already exists?
Does the PR aims to solve the issue of Agents not being able to be executed from JSON file?
Looking forward to the feedback.
Also It would be nice if you can certain tests once the functionality is finalised.
its using the method that already exists and give all the other requirements to make it work |
Provide a service to run a flow when you have flow
JSON
, without the need of langflow ide\backend.This pull request introduces a new class
LangFlowRunner
in theflow_runner.py
file, which provides functionality for running and managing flows. The changes include methods for initializing the database, clearing previous sessions, and modifying flow schemas. Here are the most important changes:New Class Introduction:
LangFlowRunner
: Added a new classLangFlowRunner
which includes methods to handle the execution of flows, initialize the database if needed, clear previous sessions, and modify flow schemas.Key Methods:
run
: Added an asynchronous method to handle the execution of a flow, including logging, initializing the database, modifying the flow schema, and running the graph._init_db_if_needed
: Added an asynchronous method to check if the database exists and initialize it if necessary._clear_previous_sessions
: Added an asynchronous method to clear previous sessions from the database and add the current flow to the database.get_flow_dict
: Added an asynchronous method to retrieve the flow dictionary from a file path or a JSON object._modify_flow_schema
andmodification
: Added methods to recursively modify the flow schema, setting session IDs and loading values from environment variables if necessary. (F4ba02e2R