---
title: "run_campaign"
description: "Execute a campaign and wait for results. Blocks until completion and returns per-test results."
sidebarTitle: "run_campaign"
lastUpdated: "2026-09-23"
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

{/* GENERATED FILE: do not edit by hand. Regenerate with: node scripts/generate.mjs */}

Execute a campaign and wait for results — blocks until completion and returns per-test results.

<Warning>
  **Destructive · Writes data · Calls external systems.** This tool can modify or delete data. Review the arguments before letting an agent call it.
</Warning>

## Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `campaign_json` | string | Yes | Campaign JSON template (from build_campaign) |
| `ignore_errors` | boolean | No | Ignore failures across all action types (options.ignore_failed = &lt;all action codes&gt;). Per-test statuses may be rewritten to success. |
| `max_poll_duration` | string | No | Maximum time to wait for results (default: 10m). Format: duration string (e.g. 5m, 15m) |
| `overrides` | string | No | JSON object mapping test IDs to their variable values and owner assignments. Format: \{"&lt;test_id&gt;": \{"input_variables": \{...\}, "direct_owners": \{...\}\}\}. input_variables values are flat strings (e.g. "42"); direct_owners maps a device identifier to a value (e.g., \{"sim_owner": "SIM-001"\}). To target a specific variant, pin it at build time via build_campaign variants=[…] — the \{value, bucket\} object form is NOT accepted here. |
| `parallel` | boolean | No | Run campaign tests in parallel (options.parallel_test_execution=-1). Superadmin-only; the platform rejects test lists that use SIM or SMARTPHONE actions, or sleep on unlocked resources. |

## Example arguments

Illustrative arguments an agent supplies when calling this tool:

```json
{
  "campaign_json": "string"
}
```

## Description

```text
Best for quick ad-hoc / CI runs. It holds ONE connection open for the entire run, so on the hosted (HTTP) MCP transport a longer run can be reset by the gateway; for anything beyond a quick smoke test prefer start_execution + poll_execution (start returns a result_id immediately, then poll until terminal).

For ad-hoc runs: build_campaign(test_ids=…) → run_campaign. For a saved Tests campaign: build_campaign(test_campaign_id=…) → run_campaign(overrides=…).
```

## Related

- [`start_execution`](/mcp/tools/execution/start_execution)
- [`poll_execution`](/mcp/tools/execution/poll_execution)
- [`build_campaign`](/mcp/tools/execution/build_campaign)

## What's next?

<Columns cols={2}>
  <Card title="All MCP tools" icon="robot" href="/mcp/tools/overview">
    Browse the full tool reference by category.
  </Card>
  <Card title="Connect a client" icon="plug" href="/mcp/connect">
    Point Claude, Cursor, or Claude Code at the server.
  </Card>
</Columns>
