Skip to content

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

barnuri
Copy link

@barnuri barnuri commented Apr 8, 2025

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 the flow_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 class LangFlowRunner 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 and modification: Added methods to recursively modify the flow schema, setting session IDs and loading values from environment variables if necessary. (F4ba02e2R

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 8, 2025
@barnuri barnuri changed the title flow-runner feat: flow-runner Apr 8, 2025
@barnuri barnuri changed the title feat: flow-runner feat: flow-runner - run flow without langflow server Apr 8, 2025
@barnuri barnuri changed the title feat: flow-runner - run flow without langflow server feat: ability to run flow without langflow server Apr 9, 2025
@github-actions github-actions bot added the enhancement New feature or request label Apr 9, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 9, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 9, 2025
Copy link
Collaborator

@edwinjosechittilappilly edwinjosechittilappilly left a 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.

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 9, 2025
@barnuri
Copy link
Author

barnuri commented Apr 10, 2025

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
right now if you want to trigger flow in production from json it doesnt works without all those things i added

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 10, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 13, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 14, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 16, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 16, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 16, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 16, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 16, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 16, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants