> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bland.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Invoke Node Test Run

> Start a node test run for a given node and pathway with a new prompt and sample conversations.

### Headers

<ParamField header="authorization" type="string" required>
  Your API key for authentication.
</ParamField>

### Body Parameters

<ParamField body="new_prompt" type="string">
  The new prompt to test for this node. This will be used to simulate the agent's responses against the pinned and auto-selected conversations. Either `new_prompt` or `static_text` can be provided, but not both.
</ParamField>

<ParamField body="static_text" type="string">
  Static text that the agent will always reply with. Either `static_text` or `new_prompt` can be provided, but not both. This is useful to test variable extractions on static text nodes.
</ParamField>

<ParamField body="judge_prompt" type="string">
  The judge prompt to evaluate the test results. If not provided, the default judge prompt will be used. The default judge prompt will evaluate the agent responses against the node prompt.
</ParamField>

<ParamField body="loop_prompt" type="string">
  The prompt for the node loop condition.
</ParamField>

<ParamField body="extract_variables" type="array">
  Array of variables to extract from the conversation.
</ParamField>

<ParamField body="extract_variables[].name" type="string" required>
  The name of the variable to extract.
</ParamField>

<ParamField body="extract_variables[].type" type="string" required>
  The type of the variable. Must be one of: `"string"`, `"integer"`, or `"boolean"`.
</ParamField>

<ParamField body="extract_variables[].description" type="string" required>
  A description of what the variable represents.
</ParamField>

<ParamField body="extract_variables[].spelling_precision" type="boolean" required>
  Whether spelling precision should be enforced for this variable.
</ParamField>

<ParamField body="conversations" type="array" required>
  Array of conversation references to include in the test. The system may automatically add up to 4 additional recent completed calls for the same node and pathway.
</ParamField>

<ParamField body="conversations[].id" type="string" required>
  Unique identifier of a call to include in the test run.
</ParamField>

<ParamField body="conversations[].type" type="string" required>
  Type of the conversation. We only support <code>"call"</code> for now.
</ParamField>

<ParamField body="node_id" type="string" required>
  Identifier of the node to test within the specified pathway.
</ParamField>

<ParamField body="pathway_id" type="string" required>
  Identifier of the pathway that the node and conversations belong to.
</ParamField>

<ParamField body="pathway_version" type="string">
  The version of the pathway to test against.
</ParamField>

<ParamField body="n_permutations" type="number">
  Optional number of permutations to generate for each conversation. If omitted, this defaults to <code>5</code>. The total generations per conversation will be <code>n\_permutations + 1</code> (one for the original user messages plus one per permutation).
</ParamField>

### Response

<ResponseField name="data.run_id" type="string">
  Identifier of the created node test run. Use this ID with <code>GET /v1/node\_tests/run/:id</code> to retrieve the full results.
</ResponseField>

<RequestExample>
  ```json Request theme={null}
  {
    "new_prompt": "You are the best financial advisor...",
    "judge_prompt": "Evaluate if the response is helpful and accurate.",
    "loop_prompt": "Continue if the user has more questions.",
    "extract_variables": [
      {
        "name": "user_name",
        "type": "string",
        "description": "The name of the user",
        "spelling_precision": true
      }
    ],
    "conversations": [
      {
        "type": "call",
        "id": "330d8a20-27bc-4d00-b67a-8474c9a6d4e1"
      },
      {
        "type": "call",
        "id": "906f16de-2719-4b7e-864b-a4b002586e7c"
      }
    ],
    "node_id": "a7bbd409-504b-4ba3-a9d1-12f6bc270f58",
    "pathway_id": "05f4b269-e79a-4825-b4cd-7778f782bfad",
    "pathway_version": "2",
    "n_permutations": 5
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": {
      "run_id": "727a85f1-1959-4ec1-95a4-248a2eecf1ae"
    },
    "errors": null
  }
  ```
</ResponseExample>

***

Docs for agents: [llms.txt](/llms.txt)
