Skip to content

Add .invoke() Method to Graph API (LangGraph-like Execution) #35

@divinoborges

Description

@divinoborges

Summary

Currently, Graph only exposes a .launch() method, which is great for interactive and UI-based workflows (e.g. Gradio apps). However, this design limits the use of Graph in programmatic, server-side, and API-driven contexts.

This issue proposes introducing a .invoke() method, similar to how LangGraph works, enabling graphs to be executed as pure functions and easily exposed as APIs.


Motivation

Many real-world use cases require graphs to be:

  • Executed headlessly (without UI)
  • Integrated into REST / FastAPI / serverless APIs
  • Used in pipelines, backends, or microservices
  • Composable and callable like regular Python functions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions