@squidcloud/client
    Preparing search index...

    Class LangGraphReference

    Reference to a specific LangGraph.

    Index
    • Deletes all checkpoints for the given thread on this graph. Idempotent — succeeds on a nonexistent thread. After deletion, getState(threadId) returns an empty state and any subsequent invoke/resume on the same threadId starts fresh with no prior history.

      Parameters

      • threadId: string

        The thread to delete.

      Returns Promise<void>

    • Starts a new LangGraph run without waiting for the result. Returns a jobId — pass it to squid.job().awaitJob(jobId) or getJob(jobId) to retrieve the result later.

      Use this for graphs that may run longer than is comfortable to hold a Promise for.

      Parameters

      • options: InvokeLangGraphOptions = {}

        Initial state, optional thread to run against, and optional timeout and context of the run.

      Returns Promise<string>

    • Resumes an interrupted LangGraph thread and waits for the result. The thread must currently be in interrupted status.

      Parameters

      • threadId: string

        The thread to resume.

      • resumePayload: unknown

        Value passed to the interrupt() call inside the graph.

      • options: ResumeLangGraphOptions = {}

        Optional timeout and context of the resumed run.

      Returns Promise<InvokeLangGraphSuccessResult>

    • Resumes an interrupted LangGraph thread without waiting for the result. Returns a jobId — pass it to squid.job().awaitJob(jobId) or getJob(jobId) to retrieve the result later.

      Parameters

      • threadId: string

        The thread to resume.

      • resumePayload: unknown

        Value passed to the interrupt() call inside the graph.

      • options: ResumeLangGraphOptions = {}

        Optional timeout and context of the resumed run.

      Returns Promise<string>

    • Starts a new LangGraph run and streams its events: what nodes write with LangGraph's stream writer, the tokens of the LLM calls that nodes make, and the AI messages that nodes write whole. The last event is the result.

      Every subscription starts a run, and unsubscribing does not stop it. Streaming needs the client's socket, so a passive client throws.

      Parameters

      • options: StreamLangGraphOptions = {}

        Initial state, thread, timeout, context and session of the run, and which tokens to stream.

      Returns Observable<LangGraphStreamEvent>