---
title: "Create Run, Wait for Output"
method: POST
path: "/threads/{thread_id}/runs/wait"
tags: ["Runs"]
---

# Create Run, Wait for Output

`POST /threads/{thread_id}/runs/wait`

Create a run in existing thread. Wait for the final output and then return it.

## Path parameters

- `thread_id` string, uuid, required — The ID of the thread.

## Request body

- RunCreateStateful — Payload for creating a run.
  - `assistant_id` union, required — The assistant ID or graph name to run. If using graph name, will default to first assistant created from that graph.
    - string, uuid
    - string
  - `input` union — The input to the graph.
    - object[]
    - object
  - `metadata` object — Metadata to assign to the run.
  - `config` object — The configuration for the assistant.
    - `tags` string[]
    - `recursion_limit` integer
    - `configurable` object
  - `context` object — Static context to add to the assistant for this run.
  - `webhook` string, uri — Webhook to call after LangGraph API call is done.
  - `interrupt_before` union — Nodes to interrupt immediately before they get executed.
    - '*'
    - string[]
  - `interrupt_after` union — Nodes to interrupt immediately after they get executed.
    - '*'
    - string[]
  - `stream_mode` union — The stream mode(s) to use.
    - string[]
    - 'values' | 'messages' | 'messages-tuple' | 'updates' | 'events' | 'debug' | 'custom'
  - `stream_subgraphs` boolean — Whether to stream output from subgraphs.
  - `on_disconnect` 'cancel' | 'continue' — The disconnect mode to use. Must be one of 'cancel' or 'continue'.
  - `feedback_keys` string[] — Feedback keys to assign to run.
  - `multitask_strategy` 'reject' | 'rollback' | 'interrupt' | 'enqueue' — Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.
  - `if_not_exists` 'create' | 'reject' — How to handle missing thread. Must be either 'reject' (raise error if missing), or 'create' (create new thread).
  - `after_seconds` integer — The number of seconds to wait before starting the run. Use to schedule future runs.

## Response `200`

Success

- unknown

## Other responses

- `404` — Not Found
- `409` — Conflict
- `422` — Validation Error

---

[API](https://skmtc.net/xpert-ai/apis/agent-protocol.md) · [All operations](https://skmtc.net/xpert-ai/apis/agent-protocol/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xpert-ai/agent-protocol/versions/ac9dbe16ea2f/schema)
