Platform guide

Stacksona for LangGraph

Use Stacksona around interrupt, review, and resume points. Stacksona owns approval inbox, signed decision, and audit trail while LangGraph owns graph state.

Use Stacksona at interrupt, review, and resume points. LangGraph owns graph state. Stacksona owns approval and audit. This page shows the recommended integration pattern using HTTP, a wrapper, or a small bridge service.

Start with this decision step

Every recipe should create a Stacksona decision before the platform executes the risky action.

pseudo
1. Agent prepares a risky action.
2. Platform calls Stacksona with action details.
3. If decision is allow or approved, execute the action.
4. If decision is pending_review, wait, poll, or resume through callback.
5. If decision is reject or rejected, do not execute.

Recommended pattern

StepDescription
Before risky nodeCreate a Stacksona decision request before the graph node executes an external action.
Pending reviewStore thread_id in graph state and pause execution until approval.
ResumeContinue graph execution only after approved. Route rejected decisions to fallback nodes.

Example

python
# Python recipe using a small HTTP helper.
# Keep the Stacksona API key on the server side.

def propose_refund(state):
    decision = stacksona_request_decision({
        "taskId": state["task_id"],
        "workflowName": "LangGraph Support Agent",
        "taskLabel": "Refund request",
        "toolName": "issue_refund",
        "subject": "Agent wants to issue a refund",
        "riskLevel": "high",
        "payload": state["refund_payload"],
    })

    if decision["status"] == "allow":
        return {**state, "approved": True}

    if decision["status"] == "pending_review":
        return interrupt({"thread_id": decision["thread_id"], "task_id": decision["task_id"]})

    return {**state, "approved": False}

Decision handling

StatusWorkflow behavior
allowContinue immediately.
rejectStop the action before execution.
pending_reviewPause, poll, or wait for callback. Continue only after approved.
approvedExecute the action. Validate token first when signed approval is required.
rejectedDo not execute. Route to fallback, manual task, or safe response.

Integration FAQ

Can I use Stacksona with LangGraph today?

Yes. Use the documented native package when one exists. Otherwise, use the REST API, HTTP module, webhook action, or a small Node sidecar with @stacksona/sdk.

Where should Stacksona sit in a LangGraph workflow?

Place Stacksona immediately before the action that sends, updates, deletes, refunds, posts, deploys, or calls a production API.

What statuses should my workflow allow?

Execute the gated action only on allow or approved. Stop, retry, notify, or route to fallback for every other state.