Skip to main content

CENTCOM Human Approval connector for LangGraph - pause AI workflows for human decisions

Project description

centcom-langgraph

Human approval nodes for LangGraph workflows, powered by CENTCOM.

Drop a CENTCOM approval node into any LangGraph graph. The connector uses LangGraph's native interrupt() to pause graphs and resume them when operators respond in the CENTCOM dashboard. The operator response is delivered back to your app via webhook and used to resume the graph — no thread blocked, fully persistent.

Install

pip install centcom-langgraph

# With webhook handler (FastAPI)
pip install centcom-langgraph[webhook]

Quick Start

from langgraph.graph import StateGraph, START, END
from langgraph.checkpoint.memory import MemorySaver
from centcom_langgraph import centcom_approval, CentcomState

class MyState(CentcomState):
    order_id: str
    approved: bool

graph = StateGraph(MyState)
graph.add_node("approve", centcom_approval(
    type="approval",
    question=lambda s: f"Approve order {s['order_id']}?",
    context=lambda s: f"Order {s['order_id']} needs approval",
    callback_url="https://my-app.com/centcom-webhook",
))

graph.add_edge(START, "approve")
graph.add_edge("approve", END)

app = graph.compile(checkpointer=MemorySaver())
result = app.invoke(
    {"order_id": "ORD-42", "approved": False},
    config={"configurable": {"thread_id": "order-42"}},
)

Runtime Flow

  1. Your graph reaches centcom_approval(...) and sends a request to CENTCOM.
  2. The node calls interrupt(...), so execution pauses and state is checkpointed.
  3. An operator answers in the CENTCOM dashboard.
  4. CENTCOM sends the signed response payload to your webhook endpoint.
  5. Your webhook handler verifies the signature and resumes LangGraph with Command(resume=payload).

Official Resources

API

centcom_approval(**kwargs)

Factory returning a LangGraph node. Parameters accept static values or (state) -> value callables.

centcom_tool(**kwargs)

LangChain @tool for agent graphs where the LLM decides when to request approval.

create_webhook_handler(**kwargs)

Async handler that verifies CENTCOM webhooks and resumes LangGraph threads.

CentcomState

TypedDict mixin adding centcom_request_id, centcom_response, centcom_status to your graph state.

Docs

Full documentation at contro1.com/docs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

centcom_langgraph-0.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

centcom_langgraph-0.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file centcom_langgraph-0.1.0.tar.gz.

File metadata

  • Download URL: centcom_langgraph-0.1.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for centcom_langgraph-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4514dfb93e4ebbaf51eca87030c510b0feb094c1051ee21fc8e9f02b7a3a2d26
MD5 1f8ea8987a4cca0b3637c97b13f9bbc7
BLAKE2b-256 668e6e5fad94a4236a2b3544d75bccfe8d99fa767a1123c2b5ef75280b5e5aa7

See more details on using hashes here.

File details

Details for the file centcom_langgraph-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for centcom_langgraph-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4fda06736fadf0794fad73f0c5b13239ba51ec67d50be24c717bd3fd15b904da
MD5 e19c095da52e8de4824c240e364334e4
BLAKE2b-256 14ab9f4d31609cfe7b9216afff8575ca9e6800d08cb6687b3f5591e68ca1133f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page