Recipe · LangGraph

Your LangGraph interrupt(), answered by a real human

LangGraph gives you the pause: interrupt() stops the graph and the checkpointer keeps its state. It does not give you a person to answer. This recipe sends the paused question to GetABrain, waits for human answers, and resumes the graph with them.

GetABrain: human feedback for any AI project, from verified real people. How answers are verified

  1. 1.Get a test key ($5 sandbox credit)

    Sign up as a requestor and mint a test-mode key. It is a normal gab_k_ / gab_s_ pair that returns simulated answers billed at the minimum bid with no fee, paid from the $5 sandbox credit first, so you can wire everything before you fund real answers.

  2. 2.Install

    The Python SDK and LangGraph.

    pip install getabrain langgraph
  3. 3.Pause the graph with interrupt()

    Inside the node that needs a human, call interrupt() with the question. The graph stops and saves its state under the thread id.

    from langgraph.types import interrupt
    
    def approve_refund(state):
        verdict = interrupt({"question": state["refund_question"]})
        return {"approved": verdict == "yes"}
  4. 4.Send the question to GetABrain, then resume

    Your runner reads the interrupt payload, asks humans, and resumes the same thread with the majority answer. The longer walkthrough is the LangGraph human-in-the-loop post; the product is the human-in-the-loop API.

    from getabrain import GetABrain
    from langgraph.types import Command
    
    gab = GetABrain(api_key="gab_k_...", api_secret="gab_s_...")
    config = {"configurable": {"thread_id": "refund-8842"}}
    
    result = graph.invoke(inputs, config)
    question = result["__interrupt__"][0].value["question"]
    
    query = gab.queries.create(
        type="yes_no",
        title="Approve this refund?",
        content_data={"question": question},
        required_responses=3,
        bid_amount_cents=25,
    )
    answers = gab.queries.wait_for_responses(query["id"], min_responses=3, timeout_s=900)
    votes = [a["response_data"].get("answer") for a in answers]
    graph.invoke(Command(resume=max(set(votes), key=votes.count)), config)
Sources (3)
  • interrupt() pauses the graph and the checkpointer saves its state: docs.langchain.com · checked 2026-12-02
  • The value passed to Command(resume=...) becomes the return value of interrupt(): docs.langchain.com · checked 2026-12-02
  • invoke() surfaces interrupts under result["__interrupt__"]; thread_id selects the saved state: docs.langchain.com · checked 2026-12-02
No. LangGraph keeps the pause and the state. GetABrain supplies the people who answer while the graph waits.
We don't promise answer times. You set the bid and how long the question stays open, and each answer comes back as soon as a person writes it. The checkpointer holds state for as long as you need, and you set the timeout.
Test mode answers are simulated, billed at the minimum bid with no fee, $5 sandbox credit first. Live answers start at $0.05 each plus a 20% platform fee, prepaid, no subscription required.