# Execute workflow (/api-reference/workflows/executeWorkflowV2)

`POST /api/v2/workflows/{workflowId}/execute`

Run the active deployment, set `run: { source: "deployment", version }` to run an earlier deployment version, or set `run.source: "draft"` to run the saved draft. Deployed execution requires workspace read access and OAuth `api:write` scope or a full-access API key; public deployments also allow anonymous synchronous or streamed runs. Running a chosen version requires workspace write access and a full-access API key or OAuth `api:write` scope; an unknown version returns `404`. Draft runs require a full-access personal API key or OAuth `api:write` scope, and workspace write access; workspace API keys are refused, and draft runs cannot be async.

Use `async: true` for a queue receipt, or `stream: true` for SSE. For a synchronous run with both flags false, send `Accept: application/x-ndjson` for heartbeat frames and a final frame containing `data`. With `waitTimeoutSeconds`, a synchronous run still going when the wait elapses continues in the background and answers with its run receipt instead: `202` on a JSON response, or a closing `detached` frame on an NDJSON stream, which keeps its `200`. Timeouts return `200` with `status: "failed"` and `error.code: "TIMEOUT"`; inspect run status. See [Streaming](/workflows/deployment/api#streaming) for event formats. Input descriptions specify compatible modes; invalid combinations return `400`.

Supply `X-Run-Id` to prevent duplicate execution. Reuse returns `409`, without replaying results. A `503` with `error.details.code: "ASYNC_ENQUEUE_AMBIGUOUS"` omits `Retry-After` because the run may already have started. Reconcile using the returned run ID; do not start another run with a new or omitted ID.

OAuth scope: `api:write`.

## Authentication

```json

{
  "requirements": [
    {
      "apiKey": []
    },
    {
      "oauthBearer": [
        "api:write"
      ]
    },
    {}
  ],
  "schemes": {
    "apiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "X-API-Key",
      "description": "Send a personal or workspace API key in `X-API-Key`. See [key types and access](https://docs.sim.ai/api-reference/authentication#key-types); operations that reject workspace keys say so in their description."
    },
    "oauthBearer": {
      "type": "oauth2",
      "description": "Send a Sim OAuth access token in `Authorization: Bearer`. See [OAuth authentication and scopes](https://docs.sim.ai/api-reference/authentication#oauth-access-tokens).",
      "flows": {
        "authorizationCode": {
          "authorizationUrl": "https://www.sim.ai/api/auth/oauth2/authorize",
          "tokenUrl": "https://www.sim.ai/api/auth/oauth2/token",
          "refreshUrl": "https://www.sim.ai/api/auth/oauth2/token",
          "scopes": {
            "api:read": "Read your workspaces, workflows, files, tables, and logs",
            "api:write": "Read, create, change, run, and delete resources in your workspaces",
            "offline_access": "Stay signed in without asking again"
          }
        }
      }
    }
  }
}

```

Required OAuth scope: `api:write`.

## Request examples

### cURL — Request example 1

```bash
curl --request POST 'https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute' \
  --header 'X-API-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "input": {
    "ticketId": "ticket_123"
  }
}'
```

### JavaScript — Request example 1

```javascript
const response = await fetch("https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute", {
  "method": "POST",
  "headers": {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  "body": "{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  }\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const contentType = response.headers.get('content-type') ?? '';
const result = contentType.includes('text/event-stream') || contentType.includes('application/x-ndjson')
  ? response.body
  : await response.json();
```

### Python — Request example 1

```python
import requests

response = requests.request(
    "POST",
    "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute",
    headers={
  "X-API-Key": "YOUR_API_KEY",
  "Content-Type": "application/json"
},
    data="{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  }\n}",
    stream=True,
)
response.raise_for_status()
content_type = response.headers.get("Content-Type", "")
result = response.iter_lines() if "text/event-stream" in content_type or "application/x-ndjson" in content_type else response.json()
```

### Go — Request example 1

```go
package main

import (
  "io"
  "net/http"
  "os"
  "strings"
)

func check(err error) {
  if err != nil { panic(err) }
}

func must[T any](value T, err error) T {
  check(err)
  return value
}

func main() {

  request := must(http.NewRequest("POST", "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute", strings.NewReader("{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  }\n}")))
  request.Header.Set("X-API-Key", "YOUR_API_KEY")
  request.Header.Set("Content-Type", "application/json")
  response := must(http.DefaultClient.Do(request))
  defer response.Body.Close()
  if response.StatusCode >= 400 { panic(response.Status) }
  must(io.Copy(os.Stdout, response.Body))
}
```

### Java — Request example 1

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
  public static void main(String[] args) throws Exception {
    var builder = HttpRequest.newBuilder(URI.create("https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute"));
    builder.header("X-API-Key", "YOUR_API_KEY");
    builder.header("Content-Type", "application/json");
    var request = builder.method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  }\n}")).build();
    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofInputStream());
    try (var body = response.body()) {
      if (response.statusCode() >= 400) throw new IllegalStateException("HTTP " + response.statusCode());
      body.transferTo(System.out);
    }
  }
}
```

### C# — Request example 1

```csharp
using System;
using System.IO;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute");
request.Content = new StringContent("{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  }\n}", Encoding.UTF8);
request.Headers.TryAddWithoutValidation("X-API-Key", "YOUR_API_KEY");
request.Content!.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
response.EnsureSuccessStatusCode();
await response.Content.CopyToAsync(Console.OpenStandardOutput());
```

### cURL — Request example 2

```bash
curl --request POST 'https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute' \
  --header 'X-API-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "input": {
    "ticketId": "ticket_123"
  },
  "async": true
}'
```

### JavaScript — Request example 2

```javascript
const response = await fetch("https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute", {
  "method": "POST",
  "headers": {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  "body": "{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  },\n  \"async\": true\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const contentType = response.headers.get('content-type') ?? '';
const result = contentType.includes('text/event-stream') || contentType.includes('application/x-ndjson')
  ? response.body
  : await response.json();
```

### Python — Request example 2

```python
import requests

response = requests.request(
    "POST",
    "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute",
    headers={
  "X-API-Key": "YOUR_API_KEY",
  "Content-Type": "application/json"
},
    data="{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  },\n  \"async\": true\n}",
    stream=True,
)
response.raise_for_status()
content_type = response.headers.get("Content-Type", "")
result = response.iter_lines() if "text/event-stream" in content_type or "application/x-ndjson" in content_type else response.json()
```

### Go — Request example 2

```go
package main

import (
  "io"
  "net/http"
  "os"
  "strings"
)

func check(err error) {
  if err != nil { panic(err) }
}

func must[T any](value T, err error) T {
  check(err)
  return value
}

func main() {

  request := must(http.NewRequest("POST", "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute", strings.NewReader("{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  },\n  \"async\": true\n}")))
  request.Header.Set("X-API-Key", "YOUR_API_KEY")
  request.Header.Set("Content-Type", "application/json")
  response := must(http.DefaultClient.Do(request))
  defer response.Body.Close()
  if response.StatusCode >= 400 { panic(response.Status) }
  must(io.Copy(os.Stdout, response.Body))
}
```

### Java — Request example 2

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
  public static void main(String[] args) throws Exception {
    var builder = HttpRequest.newBuilder(URI.create("https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute"));
    builder.header("X-API-Key", "YOUR_API_KEY");
    builder.header("Content-Type", "application/json");
    var request = builder.method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  },\n  \"async\": true\n}")).build();
    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofInputStream());
    try (var body = response.body()) {
      if (response.statusCode() >= 400) throw new IllegalStateException("HTTP " + response.statusCode());
      body.transferTo(System.out);
    }
  }
}
```

### C# — Request example 2

```csharp
using System;
using System.IO;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute");
request.Content = new StringContent("{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  },\n  \"async\": true\n}", Encoding.UTF8);
request.Headers.TryAddWithoutValidation("X-API-Key", "YOUR_API_KEY");
request.Content!.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
response.EnsureSuccessStatusCode();
await response.Content.CopyToAsync(Console.OpenStandardOutput());
```

### cURL — Request example 3

```bash
curl --request POST 'https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute' \
  --header 'X-API-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "input": {
    "ticketId": "ticket_123"
  },
  "stream": true
}'
```

### JavaScript — Request example 3

```javascript
const response = await fetch("https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute", {
  "method": "POST",
  "headers": {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  "body": "{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  },\n  \"stream\": true\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const contentType = response.headers.get('content-type') ?? '';
const result = contentType.includes('text/event-stream') || contentType.includes('application/x-ndjson')
  ? response.body
  : await response.json();
```

### Python — Request example 3

```python
import requests

response = requests.request(
    "POST",
    "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute",
    headers={
  "X-API-Key": "YOUR_API_KEY",
  "Content-Type": "application/json"
},
    data="{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  },\n  \"stream\": true\n}",
    stream=True,
)
response.raise_for_status()
content_type = response.headers.get("Content-Type", "")
result = response.iter_lines() if "text/event-stream" in content_type or "application/x-ndjson" in content_type else response.json()
```

### Go — Request example 3

```go
package main

import (
  "io"
  "net/http"
  "os"
  "strings"
)

func check(err error) {
  if err != nil { panic(err) }
}

func must[T any](value T, err error) T {
  check(err)
  return value
}

func main() {

  request := must(http.NewRequest("POST", "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute", strings.NewReader("{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  },\n  \"stream\": true\n}")))
  request.Header.Set("X-API-Key", "YOUR_API_KEY")
  request.Header.Set("Content-Type", "application/json")
  response := must(http.DefaultClient.Do(request))
  defer response.Body.Close()
  if response.StatusCode >= 400 { panic(response.Status) }
  must(io.Copy(os.Stdout, response.Body))
}
```

### Java — Request example 3

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
  public static void main(String[] args) throws Exception {
    var builder = HttpRequest.newBuilder(URI.create("https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute"));
    builder.header("X-API-Key", "YOUR_API_KEY");
    builder.header("Content-Type", "application/json");
    var request = builder.method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  },\n  \"stream\": true\n}")).build();
    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofInputStream());
    try (var body = response.body()) {
      if (response.statusCode() >= 400) throw new IllegalStateException("HTTP " + response.statusCode());
      body.transferTo(System.out);
    }
  }
}
```

### C# — Request example 3

```csharp
using System;
using System.IO;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute");
request.Content = new StringContent("{\n  \"input\": {\n    \"ticketId\": \"ticket_123\"\n  },\n  \"stream\": true\n}", Encoding.UTF8);
request.Headers.TryAddWithoutValidation("X-API-Key", "YOUR_API_KEY");
request.Content!.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
response.EnsureSuccessStatusCode();
await response.Content.CopyToAsync(Console.OpenStandardOutput());
```

### cURL — Request example 4

```bash
curl --request POST 'https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute' \
  --header 'X-API-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "run": {
    "source": "draft"
  }
}'
```

### JavaScript — Request example 4

```javascript
const response = await fetch("https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute", {
  "method": "POST",
  "headers": {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  "body": "{\n  \"run\": {\n    \"source\": \"draft\"\n  }\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const contentType = response.headers.get('content-type') ?? '';
const result = contentType.includes('text/event-stream') || contentType.includes('application/x-ndjson')
  ? response.body
  : await response.json();
```

### Python — Request example 4

```python
import requests

response = requests.request(
    "POST",
    "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute",
    headers={
  "X-API-Key": "YOUR_API_KEY",
  "Content-Type": "application/json"
},
    data="{\n  \"run\": {\n    \"source\": \"draft\"\n  }\n}",
    stream=True,
)
response.raise_for_status()
content_type = response.headers.get("Content-Type", "")
result = response.iter_lines() if "text/event-stream" in content_type or "application/x-ndjson" in content_type else response.json()
```

### Go — Request example 4

```go
package main

import (
  "io"
  "net/http"
  "os"
  "strings"
)

func check(err error) {
  if err != nil { panic(err) }
}

func must[T any](value T, err error) T {
  check(err)
  return value
}

func main() {

  request := must(http.NewRequest("POST", "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute", strings.NewReader("{\n  \"run\": {\n    \"source\": \"draft\"\n  }\n}")))
  request.Header.Set("X-API-Key", "YOUR_API_KEY")
  request.Header.Set("Content-Type", "application/json")
  response := must(http.DefaultClient.Do(request))
  defer response.Body.Close()
  if response.StatusCode >= 400 { panic(response.Status) }
  must(io.Copy(os.Stdout, response.Body))
}
```

### Java — Request example 4

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
  public static void main(String[] args) throws Exception {
    var builder = HttpRequest.newBuilder(URI.create("https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute"));
    builder.header("X-API-Key", "YOUR_API_KEY");
    builder.header("Content-Type", "application/json");
    var request = builder.method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"run\": {\n    \"source\": \"draft\"\n  }\n}")).build();
    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofInputStream());
    try (var body = response.body()) {
      if (response.statusCode() >= 400) throw new IllegalStateException("HTTP " + response.statusCode());
      body.transferTo(System.out);
    }
  }
}
```

### C# — Request example 4

```csharp
using System;
using System.IO;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute");
request.Content = new StringContent("{\n  \"run\": {\n    \"source\": \"draft\"\n  }\n}", Encoding.UTF8);
request.Headers.TryAddWithoutValidation("X-API-Key", "YOUR_API_KEY");
request.Content!.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
response.EnsureSuccessStatusCode();
await response.Content.CopyToAsync(Console.OpenStandardOutput());
```

### cURL — Request example 5

```bash
curl --request POST 'https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute' \
  --header 'X-API-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "run": {
    "source": "draft"
  },
  "waitTimeoutSeconds": 240
}'
```

### JavaScript — Request example 5

```javascript
const response = await fetch("https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute", {
  "method": "POST",
  "headers": {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  "body": "{\n  \"run\": {\n    \"source\": \"draft\"\n  },\n  \"waitTimeoutSeconds\": 240\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const contentType = response.headers.get('content-type') ?? '';
const result = contentType.includes('text/event-stream') || contentType.includes('application/x-ndjson')
  ? response.body
  : await response.json();
```

### Python — Request example 5

```python
import requests

response = requests.request(
    "POST",
    "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute",
    headers={
  "X-API-Key": "YOUR_API_KEY",
  "Content-Type": "application/json"
},
    data="{\n  \"run\": {\n    \"source\": \"draft\"\n  },\n  \"waitTimeoutSeconds\": 240\n}",
    stream=True,
)
response.raise_for_status()
content_type = response.headers.get("Content-Type", "")
result = response.iter_lines() if "text/event-stream" in content_type or "application/x-ndjson" in content_type else response.json()
```

### Go — Request example 5

```go
package main

import (
  "io"
  "net/http"
  "os"
  "strings"
)

func check(err error) {
  if err != nil { panic(err) }
}

func must[T any](value T, err error) T {
  check(err)
  return value
}

func main() {

  request := must(http.NewRequest("POST", "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute", strings.NewReader("{\n  \"run\": {\n    \"source\": \"draft\"\n  },\n  \"waitTimeoutSeconds\": 240\n}")))
  request.Header.Set("X-API-Key", "YOUR_API_KEY")
  request.Header.Set("Content-Type", "application/json")
  response := must(http.DefaultClient.Do(request))
  defer response.Body.Close()
  if response.StatusCode >= 400 { panic(response.Status) }
  must(io.Copy(os.Stdout, response.Body))
}
```

### Java — Request example 5

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
  public static void main(String[] args) throws Exception {
    var builder = HttpRequest.newBuilder(URI.create("https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute"));
    builder.header("X-API-Key", "YOUR_API_KEY");
    builder.header("Content-Type", "application/json");
    var request = builder.method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"run\": {\n    \"source\": \"draft\"\n  },\n  \"waitTimeoutSeconds\": 240\n}")).build();
    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofInputStream());
    try (var body = response.body()) {
      if (response.statusCode() >= 400) throw new IllegalStateException("HTTP " + response.statusCode());
      body.transferTo(System.out);
    }
  }
}
```

### C# — Request example 5

```csharp
using System;
using System.IO;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute");
request.Content = new StringContent("{\n  \"run\": {\n    \"source\": \"draft\"\n  },\n  \"waitTimeoutSeconds\": 240\n}", Encoding.UTF8);
request.Headers.TryAddWithoutValidation("X-API-Key", "YOUR_API_KEY");
request.Content!.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
response.EnsureSuccessStatusCode();
await response.Content.CopyToAsync(Console.OpenStandardOutput());
```

### cURL — Request example 6

```bash
curl --request POST 'https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute' \
  --header 'X-API-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "run": {
    "source": "draft",
    "entry": {
      "type": "block",
      "blockId": "block_123",
      "sourceRunId": "run_123"
    }
  }
}'
```

### JavaScript — Request example 6

```javascript
const response = await fetch("https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute", {
  "method": "POST",
  "headers": {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  "body": "{\n  \"run\": {\n    \"source\": \"draft\",\n    \"entry\": {\n      \"type\": \"block\",\n      \"blockId\": \"block_123\",\n      \"sourceRunId\": \"run_123\"\n    }\n  }\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const contentType = response.headers.get('content-type') ?? '';
const result = contentType.includes('text/event-stream') || contentType.includes('application/x-ndjson')
  ? response.body
  : await response.json();
```

### Python — Request example 6

```python
import requests

response = requests.request(
    "POST",
    "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute",
    headers={
  "X-API-Key": "YOUR_API_KEY",
  "Content-Type": "application/json"
},
    data="{\n  \"run\": {\n    \"source\": \"draft\",\n    \"entry\": {\n      \"type\": \"block\",\n      \"blockId\": \"block_123\",\n      \"sourceRunId\": \"run_123\"\n    }\n  }\n}",
    stream=True,
)
response.raise_for_status()
content_type = response.headers.get("Content-Type", "")
result = response.iter_lines() if "text/event-stream" in content_type or "application/x-ndjson" in content_type else response.json()
```

### Go — Request example 6

```go
package main

import (
  "io"
  "net/http"
  "os"
  "strings"
)

func check(err error) {
  if err != nil { panic(err) }
}

func must[T any](value T, err error) T {
  check(err)
  return value
}

func main() {

  request := must(http.NewRequest("POST", "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute", strings.NewReader("{\n  \"run\": {\n    \"source\": \"draft\",\n    \"entry\": {\n      \"type\": \"block\",\n      \"blockId\": \"block_123\",\n      \"sourceRunId\": \"run_123\"\n    }\n  }\n}")))
  request.Header.Set("X-API-Key", "YOUR_API_KEY")
  request.Header.Set("Content-Type", "application/json")
  response := must(http.DefaultClient.Do(request))
  defer response.Body.Close()
  if response.StatusCode >= 400 { panic(response.Status) }
  must(io.Copy(os.Stdout, response.Body))
}
```

### Java — Request example 6

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
  public static void main(String[] args) throws Exception {
    var builder = HttpRequest.newBuilder(URI.create("https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute"));
    builder.header("X-API-Key", "YOUR_API_KEY");
    builder.header("Content-Type", "application/json");
    var request = builder.method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"run\": {\n    \"source\": \"draft\",\n    \"entry\": {\n      \"type\": \"block\",\n      \"blockId\": \"block_123\",\n      \"sourceRunId\": \"run_123\"\n    }\n  }\n}")).build();
    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofInputStream());
    try (var body = response.body()) {
      if (response.statusCode() >= 400) throw new IllegalStateException("HTTP " + response.statusCode());
      body.transferTo(System.out);
    }
  }
}
```

### C# — Request example 6

```csharp
using System;
using System.IO;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute");
request.Content = new StringContent("{\n  \"run\": {\n    \"source\": \"draft\",\n    \"entry\": {\n      \"type\": \"block\",\n      \"blockId\": \"block_123\",\n      \"sourceRunId\": \"run_123\"\n    }\n  }\n}", Encoding.UTF8);
request.Headers.TryAddWithoutValidation("X-API-Key", "YOUR_API_KEY");
request.Content!.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
response.EnsureSuccessStatusCode();
await response.Content.CopyToAsync(Console.OpenStandardOutput());
```

### cURL — Request example 7

```bash
curl --request POST 'https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute' \
  --header 'X-API-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "run": {
    "source": "draft",
    "entry": {
      "type": "block",
      "blockId": "block_123",
      "sourceRunId": "run_123"
    },
    "stopAfterBlockId": "block_123"
  }
}'
```

### JavaScript — Request example 7

```javascript
const response = await fetch("https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute", {
  "method": "POST",
  "headers": {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  "body": "{\n  \"run\": {\n    \"source\": \"draft\",\n    \"entry\": {\n      \"type\": \"block\",\n      \"blockId\": \"block_123\",\n      \"sourceRunId\": \"run_123\"\n    },\n    \"stopAfterBlockId\": \"block_123\"\n  }\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const contentType = response.headers.get('content-type') ?? '';
const result = contentType.includes('text/event-stream') || contentType.includes('application/x-ndjson')
  ? response.body
  : await response.json();
```

### Python — Request example 7

```python
import requests

response = requests.request(
    "POST",
    "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute",
    headers={
  "X-API-Key": "YOUR_API_KEY",
  "Content-Type": "application/json"
},
    data="{\n  \"run\": {\n    \"source\": \"draft\",\n    \"entry\": {\n      \"type\": \"block\",\n      \"blockId\": \"block_123\",\n      \"sourceRunId\": \"run_123\"\n    },\n    \"stopAfterBlockId\": \"block_123\"\n  }\n}",
    stream=True,
)
response.raise_for_status()
content_type = response.headers.get("Content-Type", "")
result = response.iter_lines() if "text/event-stream" in content_type or "application/x-ndjson" in content_type else response.json()
```

### Go — Request example 7

```go
package main

import (
  "io"
  "net/http"
  "os"
  "strings"
)

func check(err error) {
  if err != nil { panic(err) }
}

func must[T any](value T, err error) T {
  check(err)
  return value
}

func main() {

  request := must(http.NewRequest("POST", "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute", strings.NewReader("{\n  \"run\": {\n    \"source\": \"draft\",\n    \"entry\": {\n      \"type\": \"block\",\n      \"blockId\": \"block_123\",\n      \"sourceRunId\": \"run_123\"\n    },\n    \"stopAfterBlockId\": \"block_123\"\n  }\n}")))
  request.Header.Set("X-API-Key", "YOUR_API_KEY")
  request.Header.Set("Content-Type", "application/json")
  response := must(http.DefaultClient.Do(request))
  defer response.Body.Close()
  if response.StatusCode >= 400 { panic(response.Status) }
  must(io.Copy(os.Stdout, response.Body))
}
```

### Java — Request example 7

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
  public static void main(String[] args) throws Exception {
    var builder = HttpRequest.newBuilder(URI.create("https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute"));
    builder.header("X-API-Key", "YOUR_API_KEY");
    builder.header("Content-Type", "application/json");
    var request = builder.method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"run\": {\n    \"source\": \"draft\",\n    \"entry\": {\n      \"type\": \"block\",\n      \"blockId\": \"block_123\",\n      \"sourceRunId\": \"run_123\"\n    },\n    \"stopAfterBlockId\": \"block_123\"\n  }\n}")).build();
    var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofInputStream());
    try (var body = response.body()) {
      if (response.statusCode() >= 400) throw new IllegalStateException("HTTP " + response.statusCode());
      body.transferTo(System.out);
    }
  }
}
```

### C# — Request example 7

```csharp
using System;
using System.IO;
using System.Net.Http;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/execute");
request.Content = new StringContent("{\n  \"run\": {\n    \"source\": \"draft\",\n    \"entry\": {\n      \"type\": \"block\",\n      \"blockId\": \"block_123\",\n      \"sourceRunId\": \"run_123\"\n    },\n    \"stopAfterBlockId\": \"block_123\"\n  }\n}", Encoding.UTF8);
request.Headers.TryAddWithoutValidation("X-API-Key", "YOUR_API_KEY");
request.Content!.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
response.EnsureSuccessStatusCode();
await response.Content.CopyToAsync(Console.OpenStandardOutput());
```

## Parameters

```json

[
  {
    "name": "workflowId",
    "in": "path",
    "required": true,
    "description": "Unique workflow identifier.",
    "schema": {
      "type": "string",
      "minLength": 1,
      "description": "Unique workflow identifier.",
      "examples": [
        "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"
      ]
    }
  },
  {
    "name": "x-run-id",
    "in": "header",
    "required": false,
    "description": "Run ID for API-key or OAuth callers; ignored for anonymous requests. Reuse it after an uncertain response: a claimed ID returns `409` with `RUN_ID_CONFLICT`, without replaying results. Check Get workflow run, but `404` can persist while the ID remains claimed and does not establish whether execution started. Do not automatically restart with a fresh or omitted ID; either can start another run.",
    "schema": {
      "description": "Run ID for API-key or OAuth callers; ignored for anonymous requests. Reuse it after an uncertain response: a claimed ID returns `409` with `RUN_ID_CONFLICT`, without replaying results. Check Get workflow run, but `404` can persist while the ID remains claimed and does not establish whether execution started. Do not automatically restart with a fresh or omitted ID; either can start another run.",
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9._:-]+$",
      "examples": [
        "run_8f14e45f-ceea-467f-a"
      ]
    }
  },
  {
    "name": "x-sim-via",
    "in": "header",
    "required": false,
    "description": "Comma-separated workflow identifiers naming the workflow-to-workflow call chain that led to this request. Each hop appends its own workflow id, and Sim sets it automatically; supply it yourself only when relaying an existing chain. A chain at the maximum depth is rejected with `409` and `error.details.code: \"CALL_CHAIN_DEPTH_EXCEEDED\"`.",
    "schema": {
      "description": "Comma-separated workflow identifiers naming the workflow-to-workflow call chain that led to this request. Each hop appends its own workflow id, and Sim sets it automatically; supply it yourself only when relaying an existing chain. A chain at the maximum depth is rejected with `409` and `error.details.code: \"CALL_CHAIN_DEPTH_EXCEEDED\"`.",
      "type": "string"
    }
  }
]

```

## Request body

```json

{
  "required": true,
  "description": "Input, workflow-state selection, and execution-mode options. Input descriptions specify compatible modes; invalid combinations return `400`.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "input": {
            "description": "Workflow input keyed by the selected trigger input-field name.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "description": "Value supplied for one workflow input field."
            }
          },
          "run": {
            "description": "Workflow state and entry point to execute. Omit for the active deployment; `source: \"deployment\"` with `version` runs that deployment version, and `source: \"draft\"` the saved draft. A draft run requires OAuth or personal-key write access and supports synchronous or streamed runs only; `waitTimeoutSeconds` lets a synchronous one continue in the background.",
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "source": {
                    "type": "string",
                    "const": "deployment",
                    "description": "Execute a deployed workflow version."
                  },
                  "version": {
                    "description": "Deployment version to execute instead of the active one. Requires a full-access API key or an OAuth access token with `api:write`, plus workspace write access, and the workflow must be deployed. An unknown version returns `404`.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "source"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "source": {
                    "description": "Run the saved draft. `manual` is a deprecated name of `draft`.",
                    "type": "string",
                    "enum": [
                      "draft",
                      "manual"
                    ]
                  },
                  "entry": {
                    "description": "Where the draft run enters. Omit to enter through the workflow trigger; a block entry requires an exact source run.",
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "trigger",
                            "description": "Enter the draft run through a runnable trigger."
                          },
                          "blockId": {
                            "description": "Runnable trigger block to enter through. Omit only when the saved workflow has exactly one runnable trigger.",
                            "type": "string",
                            "minLength": 1
                          },
                          "sample": {
                            "description": "Run with the selected trigger's sample payload, which the server derives from the trigger, instead of `input`. Its writes are sent unless `dry`. Cannot be combined with `input`.",
                            "type": "boolean"
                          },
                          "useMockPayload": {
                            "deprecated": true,
                            "description": "Deprecated name of `sample`, accepted with the same meaning. Send `sample`; a request that sends both with different values is refused.",
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "type"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "block",
                            "description": "Start the draft run at a block, using persisted upstream state."
                          },
                          "blockId": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Saved workflow block at which the draft run starts: its id, display name or reference key (the name lowercased, whitespace and dots removed)."
                          },
                          "sourceRunId": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Run in this workflow whose persisted execution state supplies upstream block results. Missing or expired state returns 404. A test run (a dry run, or a workflow test) holds placeholders for the writes it did not send, so it is the source only of a `dry` run."
                          }
                        },
                        "required": [
                          "type",
                          "blockId",
                          "sourceRunId"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "stopAfterBlockId": {
                    "description": "Saved workflow block after which the run stops (its id, display name or reference key); downstream blocks do not execute. Must not be inside a loop or parallel. If a router, condition, or untaken error path routes the run away from the block, the run fails as soon as that is decided; no further block starts, though blocks already running finish. With a block entry naming the same block, re-runs only that block against the source run.",
                    "type": "string",
                    "minLength": 1
                  },
                  "dry": {
                    "description": "Dry run: a call that could change something outside the run (a tool call not declared `read`, every MCP call, an HTTP request other than a GET, HEAD or OPTIONS without a method-override header) is not sent but answered with a correctly shaped placeholder, and the run returns what it held back in `sideEffects`, each list described there. Reads, model calls, credential resolution and code run for real. Child workflows inherit it; custom, Mothership, Pi, Human in the loop and Wait blocks are answered whole, so the run never pauses. Agents read their memory but write none, and nothing else beyond the run's own log is kept: it raises no workspace event, does not count as a run of the workflow, and is logged under the `test` trigger. Synchronous only: cannot be combined with `stream` or `waitTimeoutSeconds`.",
                    "type": "boolean"
                  },
                  "allow": {
                    "description": "Blocks whose writes a dry run sends for real, listed in `sideEffects.allowed`. Requires `dry`. Name a block of this workflow by id, display name or reference key, or a block of a workflow it calls as `<workflow>.<block>` (the workflow's id or name, then the block's id, name or key), at most 256 characters. A selector holding a dot names a block of this workflow only by its exact id or display name; otherwise its workflow part is matched against the workflows its Workflow blocks call at any depth, then, for a child chosen as the run goes, a workflow of this workspace by id or exact name. A selector matching several blocks is refused with them. A child's entry applies wherever that workflow runs, at every depth. A Human in the loop or Wait block, a block that runs another workflow (a Workflow or custom block), a loop or parallel, a disabled block, or a block of a workflow reached only as a custom block's cannot be allowed. Allowing an Agent sends only its own tool calls: a workflow or custom block it calls stays stubbed. An entry the run never reaches is listed in `sideEffects.unreached`.",
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    }
                  },
                  "mocks": {
                    "description": "Blocks answered with this output object instead of running, to steer branches or give a stubbed write a realistic result, keyed like `allow` entries (a block of this workflow, or `<workflow>.<block>` of a workflow it calls). Requires `dry`. A locked block (or one inside a locked loop or parallel), a loop or parallel, and a disabled block cannot be mocked; a block of a locked workflow, or of one in a locked folder, returns `423`. A mock is data: it cannot set a field the run’s execution, trace or billing reads (`cost`, `tokens`, `model`, `providerTiming`, `toolCalls`, `executionData`, `childTraceSpans`, `childWorkflowId`, `childWorkflowSnapshotId`, `childDeploymentVersionId`, or any field starting with `_`), nor hold a large-value reference (an object with `__simLargeValueRef`). A field the block does not declare is listed in `sideEffects.mockFields`, not refused. The run records only which blocks were mocked, so a rerun passes the outputs again; its log shows a mocked block’s output like any other block’s.",
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "maxLength": 256,
                      "description": "Block selector."
                    },
                    "additionalProperties": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "description": "Output field."
                      },
                      "description": "Output object that answers the block instead of its handler."
                    },
                    "maxProperties": 50
                  },
                  "mocksFrom": {
                    "description": "Answer blocks with their outputs in an earlier run of this workflow. Requires `dry`. The run records the source run and blocks, so a rerun names them again.",
                    "type": "object",
                    "properties": {
                      "runId": {
                        "type": "string",
                        "minLength": 1,
                        "description": "Run of this workflow whose recorded block outputs answer the blocks. An unknown or expired run returns `404`; one still running, or whose log is not written yet, `409`; reading it needs what reading the run does, and a permission group that hides execution data returns `403`."
                      },
                      "blocks": {
                        "minItems": 1,
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "description": "This workflow's blocks (not a child's; not inside a loop or parallel unless that run mocked it), by id, display name or reference key, answered with the output each recorded in that run, redacted as the run shows it. Refused: a block the run did not execute, and, when that run was a test run, a block it answered with a placeholder rather than mocking or allowing it. Fields a mock cannot set (see `mocks`) are left out and listed in `sideEffects.mockFields`; an output holding a large-value reference is refused. Other refusals are those of `mocks`, and a block cannot be named here and in `mocks` both."
                      }
                    },
                    "required": [
                      "runId",
                      "blocks"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "source"
                ],
                "additionalProperties": false
              }
            ]
          },
          "async": {
            "default": false,
            "description": "Queue the run and return a 202 receipt. Requires a full-access API key or an OAuth access token with `api:write`, and a deployed run source. Cannot stream, select outputs, enable thinking/tool events, or include file-inlining options (`includeFileBase64` or `base64MaxBytes`).",
            "type": "boolean"
          },
          "executionTimeoutSeconds": {
            "description": "Maximum duration of an asynchronous run, in seconds, capped by the plan's execution timeout. Requires `async: true` or `waitTimeoutSeconds`; otherwise returns `400`.",
            "type": "integer",
            "minimum": 1,
            "maximum": 604800
          },
          "waitTimeoutSeconds": {
            "description": "Wait at most this many seconds for a synchronous run; `0` waits until it settles. A run still going then continues in the background and the response carries its run receipt instead of its result: `202` on a JSON response, or a closing `detached` frame on an `application/x-ndjson` result stream, which keeps its `200`. The receipt is sent only once the run can be read on the runs resource, where it can also be cancelled. The run is admitted under asynchronous limits, and a dropped connection no longer cancels it. Requires a full-access API key or an OAuth access token with `api:write`. Cannot be combined with `async` or `stream`.",
            "type": "integer",
            "minimum": 0,
            "maximum": 604800
          },
          "stream": {
            "default": false,
            "description": "Return Server-Sent Events instead of JSON when true. Cannot be combined with `async`.",
            "type": "boolean"
          },
          "selectedOutputs": {
            "description": "Select `<blockName>.<outputPath>` or `<childWorkflowId>.<blockName>.<outputPath>` using normalized block reference names. Child selectors cover every invocation. Synchronous results use selector strings verbatim as `blockOutputs` keys; streaming selections shape the envelope. Unknown block names or IDs return `400` with available blocks before execution. Unexecuted blocks and absent paths are omitted. Incompatible with `async`; select outputs from the finished run resource instead.",
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "includeThinking": {
            "default": false,
            "description": "Include model reasoning events in an agent-event stream. Requires `stream: true` and the `X-Sim-Stream-Protocol: agent-events-v1` request header, and is rejected when `async` is true.",
            "type": "boolean"
          },
          "includeToolCalls": {
            "default": false,
            "description": "Include tool-call events in an agent-event stream. Requires `stream: true` and the `X-Sim-Stream-Protocol: agent-events-v1` request header, and is rejected when `async` is true.",
            "type": "boolean"
          },
          "includeFileBase64": {
            "description": "Inline eligible output files as base64 content. Rejected when `async` is true.",
            "type": "boolean"
          },
          "base64MaxBytes": {
            "description": "Maximum total bytes of file content to inline as base64, lowering but never raising the server limit of 16 MiB. Rejected when `async` is true.",
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 16777216
          }
        },
        "additionalProperties": false,
        "title": "Execute workflow request",
        "description": "Input, workflow-state selection, and execution-mode options. Input descriptions specify compatible modes; invalid combinations return `400`."
      },
      "examples": {
        "example1": {
          "summary": "Request example 1",
          "value": {
            "input": {
              "ticketId": "ticket_123"
            }
          }
        },
        "example2": {
          "summary": "Request example 2",
          "value": {
            "input": {
              "ticketId": "ticket_123"
            },
            "async": true
          }
        },
        "example3": {
          "summary": "Request example 3",
          "value": {
            "input": {
              "ticketId": "ticket_123"
            },
            "stream": true
          }
        },
        "example4": {
          "summary": "Request example 4",
          "value": {
            "run": {
              "source": "draft"
            }
          }
        },
        "example5": {
          "summary": "Request example 5",
          "value": {
            "run": {
              "source": "draft"
            },
            "waitTimeoutSeconds": 240
          }
        },
        "example6": {
          "summary": "Request example 6",
          "value": {
            "run": {
              "source": "draft",
              "entry": {
                "type": "block",
                "blockId": "block_123",
                "sourceRunId": "run_123"
              }
            }
          }
        },
        "example7": {
          "summary": "Request example 7",
          "value": {
            "run": {
              "source": "draft",
              "entry": {
                "type": "block",
                "blockId": "block_123",
                "sourceRunId": "run_123"
              },
              "stopAfterBlockId": "block_123"
            }
          }
        }
      }
    }
  }
}

```

## Responses

### 200

```json

{
  "description": "A synchronous run result, heartbeat-delimited NDJSON result stream, or Server-Sent Event stream.",
  "headers": {
    "X-Run-Id": {
      "description": "Identifier assigned to the workflow run.",
      "schema": {
        "type": "string",
        "minLength": 1,
        "title": "Run identifier",
        "description": "Identifier assigned to the workflow run."
      }
    },
    "X-RateLimit-Limit": {
      "description": "Maximum requests allowed in the current window.",
      "schema": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "title": "Rate limit",
        "description": "Maximum requests allowed in the current window."
      }
    },
    "X-RateLimit-Remaining": {
      "description": "Requests remaining in the current window.",
      "schema": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "title": "Rate limit remaining",
        "description": "Requests remaining in the current window."
      }
    },
    "X-RateLimit-Reset": {
      "description": "ISO 8601 timestamp when the current rate-limit window resets.",
      "schema": {
        "type": "string",
        "format": "date-time",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
        "title": "Rate limit reset",
        "description": "ISO 8601 timestamp when the current rate-limit window resets."
      }
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "runId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9._:-]+$",
                "description": "Unique workflow run identifier.",
                "examples": [
                  "run_8f14e45f-ceea-467f-a"
                ]
              },
              "workflowId": {
                "type": "string",
                "description": "Workflow that produced the run."
              },
              "status": {
                "type": "string",
                "enum": [
                  "completed",
                  "failed",
                  "paused",
                  "cancelled"
                ],
                "description": "Terminal or paused run status."
              },
              "output": {
                "description": "Workflow output, including partial output on failure."
              },
              "blockOutputs": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "description": "Output value produced by one workflow block."
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Outputs of the blocks named by `selectedOutputs`, keyed by those selector strings exactly as sent, or null when none were requested. `output` stays the final workflow output regardless. Selectors whose block did not run or whose path is absent are omitted (an unknown block is a `400` instead); failed runs include the outputs of the blocks that did run."
              },
              "error": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "message": {
                        "type": "string",
                        "description": "Human-readable workflow execution failure message."
                      },
                      "code": {
                        "type": "string",
                        "enum": [
                          "TIMEOUT",
                          "CANCELLED",
                          "USAGE_LIMIT_EXCEEDED",
                          "INVALID_INPUT",
                          "BLOCK_EXECUTION_FAILED",
                          "CHILD_WORKFLOW_FAILED",
                          "EXECUTION_FAILED"
                        ],
                        "description": "Stable machine-readable execution failure code. `BLOCK_EXECUTION_FAILED` and `CHILD_WORKFLOW_FAILED` are reported only where block attribution is available; elsewhere a block-level failure is reported as `EXECUTION_FAILED`."
                      },
                      "blockId": {
                        "description": "Identifier of the failing block, when attributable. Get workflow run reads it from the run trace, so it is absent there when the trace is unavailable or hidden by organization permission groups, when no failed block in the trace recorded the run error, and for a timeout, cancellation, usage-limit, or invalid-input failure.",
                        "type": "string"
                      },
                      "blockName": {
                        "description": "Display name of the failing block, when attributable. Present whenever `blockId` is.",
                        "type": "string"
                      },
                      "blockType": {
                        "description": "Integration or block type that failed, when attributable. Present whenever `blockId` is.",
                        "type": "string"
                      },
                      "rerunFromBlockId": {
                        "description": "Block a rerun of this failure starts from (`run.entry` of type `block` naming it, with this run as `sourceRunId`): the failing block, or the outermost loop or parallel holding it, since a run cannot start inside one. Set by Execute workflow from the graph the run executed and by Get workflow run from the saved draft, whenever `blockId` is and that graph still has the block.",
                        "type": "string"
                      }
                    },
                    "required": [
                      "message",
                      "code"
                    ],
                    "additionalProperties": false,
                    "title": "Execution error",
                    "description": "Structured in-band failure details for a workflow run."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Structured execution failure, or null when none occurred."
              },
              "startedAt": {
                "description": "ISO 8601 timestamp when execution started.",
                "format": "date-time",
                "type": "string"
              },
              "endedAt": {
                "description": "ISO 8601 timestamp when execution ended.",
                "format": "date-time",
                "type": "string"
              },
              "durationMs": {
                "description": "Execution duration in milliseconds.",
                "type": "number",
                "minimum": 0
              },
              "executionTimeoutSeconds": {
                "anyOf": [
                  {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Execution timeout applied to this run, in seconds: the plan's timeout, lowered by `executionTimeoutSeconds` when one was requested. Null when the run has no execution timeout."
              },
              "paused": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "runId": {
                        "type": "string",
                        "description": "Run to name in Resume workflow run: the run this pause is recorded under, which for a resumed run that paused again is the run it resumed."
                      },
                      "points": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "contextId": {
                              "type": "string",
                              "description": "Pause context to name in `contextId` when resuming this point."
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "human",
                                "time"
                              ],
                              "description": "`human` waits for a resume request; `time` resumes automatically at `resumeAt`."
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "paused",
                                "queued",
                                "resuming",
                                "resumed",
                                "failed"
                              ],
                              "description": "Resume state of this point: waiting, queued behind another resume, resuming, resumed, or a failed resume attempt."
                            }
                          },
                          "required": [
                            "contextId",
                            "kind",
                            "status"
                          ],
                          "additionalProperties": false
                        },
                        "description": "Every point the run is paused at. Resume one with Resume workflow run, naming `runId` and its `contextId`."
                      }
                    },
                    "required": [
                      "runId",
                      "points"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Where the run waits when `status` is `paused`; null otherwise."
              },
              "sideEffects": {
                "type": "object",
                "properties": {
                  "stubbed": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "workflowId": {
                          "type": "string",
                          "description": "Workflow whose block it was: the run workflow, or a child workflow it called."
                        },
                        "blockId": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Block id in that workflow; null when the call named no block."
                        },
                        "block": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Block display name; null when the call named no block."
                        },
                        "tool": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Tool the block (or an Agent) called; null when the whole block was answered instead of run."
                        },
                        "request": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "description": "Request field."
                              }
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "What the call would have sent: an in-process operation's input, an HTTP call's `method`, `url` and `body` (never header values; for code's `fetch`, header names, the URL capped with only query parameter names, the body capped, and the code's workspace and personal secrets masked, though a secret typed into the code itself is not), or a custom or MCP tool's `arguments`. For a block answered whole, its logged inputs. Credentials, secrets, password fields and (when the workspace redacts it) PII are redacted; null when the run could not prove none remain, or could not build the request once they were masked (such as a URL that is wholly a secret)."
                        },
                        "returned": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "description": "Placeholder field."
                          },
                          "description": "Placeholder output the block or tool call returned to the run instead."
                        },
                        "mcp": {
                          "description": "The MCP server and tool an MCP block's call named; absent for any other call.",
                          "type": "object",
                          "properties": {
                            "server": {
                              "type": "string",
                              "description": "MCP server or managed connection id."
                            },
                            "tool": {
                              "type": "string",
                              "description": "MCP tool name."
                            }
                          },
                          "required": [
                            "server",
                            "tool"
                          ],
                          "additionalProperties": false
                        },
                        "reason": {
                          "description": "Why a call that is not a plain write was held back; absent for a plain write. `placeholder`: a read whose request holds a placeholder the run returned earlier (a `dry_run_<kind>_<n>` string or a number above 900000000, such as a placeholder row's id in a URL, or free text quoting one), so it depends on a call that was never sent. `mcp-read-only`: an MCP call whose server declares the tool read-only and not destructive (`readOnlyHint`, not `destructiveHint`), a claim Sim cannot verify; name its block in `run.allow` to send it.",
                          "type": "string",
                          "enum": [
                            "placeholder",
                            "mcp-read-only"
                          ]
                        }
                      },
                      "required": [
                        "workflowId",
                        "blockId",
                        "block",
                        "tool",
                        "request",
                        "returned"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Calls that were not sent, in the order the run reached them, each answered with a placeholder (a table row insert, upsert or update echoes the data it would have written, secrets masked; placeholder ids and values the request cannot determine are `dry_run_<kind>_<n>` strings and numbers above 900000000): writes, every MCP call, and reads that would send a placeholder (`reason`). Code run in the isolate (JavaScript without imports: a Function block's, a Condition's expressions, a While or Do While loop's condition, or code an Agent's model writes) sends its GET, HEAD and OPTIONS `fetch` calls (an API that writes on a GET is not stubbed); any other request, or one carrying a method-override header, gets an empty 200 (header `x-sim-dry-run: stubbed`) and is listed here as tool `function_execute`."
                  },
                  "allowed": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "workflowId": {
                          "type": "string",
                          "description": "Workflow whose block it was: the run workflow, or a child workflow it called."
                        },
                        "blockId": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Block id in that workflow; null when the call named no block."
                        },
                        "block": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Block display name; null when the call named no block."
                        },
                        "tool": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Tool sent; null when the whole block ran."
                        },
                        "mcp": {
                          "description": "The MCP server and tool an MCP block's call named; absent for any other call.",
                          "type": "object",
                          "properties": {
                            "server": {
                              "type": "string",
                              "description": "MCP server or managed connection id."
                            },
                            "tool": {
                              "type": "string",
                              "description": "MCP tool name."
                            }
                          },
                          "required": [
                            "server",
                            "tool"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "workflowId",
                        "blockId",
                        "block",
                        "tool"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Writes sent for real because `run.allow` named their block, once per block and tool (an MCP block's per MCP tool)."
                  },
                  "unchecked": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "workflowId": {
                          "type": "string",
                          "description": "Workflow whose block it was: the run workflow, or a child workflow it called."
                        },
                        "blockId": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Block id in that workflow; null when the call named no block."
                        },
                        "block": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Block display name; null when the call named no block."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Why the run cannot see what this code changed."
                        }
                      },
                      "required": [
                        "workflowId",
                        "blockId",
                        "block",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Blocks whose code ran for real in a remote sandbox (shell, Python, JavaScript with imports, a selected sandbox or files), once per block: a Function block's code, a Condition's expressions, or code an Agent's model wrote, whose network calls the run cannot see. Code run in the isolate is not listed: its network writes are stubbed."
                  },
                  "omitted": {
                    "type": "object",
                    "properties": {
                      "stubbed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991,
                        "description": "Writes left out of `stubbed`."
                      },
                      "allowed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991,
                        "description": "Writes left out of `allowed`."
                      },
                      "unchecked": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991,
                        "description": "Blocks left out of `unchecked`."
                      }
                    },
                    "required": [
                      "stubbed",
                      "allowed",
                      "unchecked"
                    ],
                    "additionalProperties": false,
                    "description": "Entries each list left out once it held 50."
                  },
                  "unreached": {
                    "description": "Allowed and mocked blocks the run never reached: on a branch it did not take, upstream of a block entry, or in a child it never called. Absent when none.",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "workflowId": {
                          "type": "string",
                          "description": "Workflow of the block."
                        },
                        "blockId": {
                          "type": "string",
                          "description": "Block id in that workflow."
                        },
                        "block": {
                          "type": "string",
                          "description": "Block display name."
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "allow",
                            "mock"
                          ],
                          "description": "`allow` for a `run.allow` entry, `mock` for `run.mocks` or `run.mocksFrom`."
                        }
                      },
                      "required": [
                        "workflowId",
                        "blockId",
                        "block",
                        "kind"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "mockFields": {
                    "description": "Mocks with fields a block reading them gets nothing from. Absent when none.",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "workflowId": {
                          "type": "string",
                          "description": "Workflow of the block."
                        },
                        "blockId": {
                          "type": "string",
                          "description": "Block id in that workflow."
                        },
                        "block": {
                          "type": "string",
                          "description": "Block display name."
                        },
                        "undeclared": {
                          "description": "Top-level fields a passed mock sets that its block does not declare as outputs, likely misspelt. Agent and Function blocks, whose outputs the model or code decides, never have any.",
                          "type": "array",
                          "items": {
                            "type": "string",
                            "description": "Output field."
                          }
                        },
                        "dropped": {
                          "description": "Fields of an output read from a run (`run.mocksFrom`) that a mock cannot set (see `run.mocks`), so left out.",
                          "type": "array",
                          "items": {
                            "type": "string",
                            "description": "Output field."
                          }
                        }
                      },
                      "required": [
                        "workflowId",
                        "blockId",
                        "block"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "stubbed",
                  "allowed",
                  "unchecked",
                  "omitted"
                ],
                "additionalProperties": false,
                "title": "Workflow run side effects",
                "description": "What a dry run (`run.dry`) did with each write it reached, whatever its status; absent otherwise."
              },
              "overrides": {
                "type": "object",
                "properties": {
                  "allow": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Block selector."
                    },
                    "description": "Blocks whose writes the run sent (`run.allow`)."
                  },
                  "mocks": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Block selector."
                    },
                    "description": "Blocks the run answered with outputs the caller passed (`run.mocks`). Only the blocks are recorded, so a rerun passes the outputs again."
                  },
                  "mocksFrom": {
                    "description": "Blocks the run answered with their outputs in another run (`run.mocksFrom`), which a rerun reads again. Absent when none.",
                    "type": "object",
                    "properties": {
                      "runId": {
                        "type": "string",
                        "description": "Run the outputs were read from."
                      },
                      "blocks": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "description": "Block id."
                        },
                        "description": "Blocks answered, by id."
                      }
                    },
                    "required": [
                      "runId",
                      "blocks"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "allow",
                  "mocks"
                ],
                "additionalProperties": false,
                "title": "Workflow run overrides",
                "description": "A dry run's overrides (`run.dry`); absent for any other run."
              }
            },
            "required": [
              "runId",
              "workflowId",
              "status",
              "output",
              "blockOutputs",
              "error",
              "executionTimeoutSeconds",
              "paused"
            ],
            "additionalProperties": false,
            "title": "Workflow run result",
            "description": "Response data."
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "title": "Synchronous workflow execution response",
        "description": "Completed, failed, paused, or cancelled synchronous workflow run.",
        "examples": [
          {
            "data": {
              "runId": "run_8f14e45f-ceea-467f-a",
              "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
              "status": "completed",
              "output": {
                "result": "Ticket routed to Support"
              },
              "blockOutputs": null,
              "error": null,
              "startedAt": "2026-08-09T18:04:10.000Z",
              "endedAt": "2026-08-09T18:04:11.000Z",
              "durationMs": 1000,
              "paused": null,
              "executionTimeoutSeconds": 3000
            }
          }
        ]
      },
      "examples": {
        "example1": {
          "summary": "Response example 1",
          "value": {
            "data": {
              "runId": "run_8f14e45f-ceea-467f-a",
              "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
              "status": "completed",
              "output": {
                "result": "Ticket routed to Support"
              },
              "blockOutputs": null,
              "error": null,
              "startedAt": "2026-08-09T18:04:10.000Z",
              "endedAt": "2026-08-09T18:04:11.000Z",
              "durationMs": 1000,
              "paused": null,
              "executionTimeoutSeconds": 3000
            }
          }
        }
      }
    },
    "application/x-ndjson": {
      "schema": {
        "type": "string"
      }
    },
    "text/event-stream": {
      "schema": {
        "type": "string"
      }
    }
  }
}

```

### 202

```json

{
  "description": "The asynchronous run was queued, or the synchronous run was still running when `waitTimeoutSeconds` elapsed and continues in the background.",
  "headers": {
    "X-Run-Id": {
      "description": "Identifier assigned to the workflow run.",
      "schema": {
        "type": "string",
        "minLength": 1,
        "title": "Run identifier",
        "description": "Identifier assigned to the workflow run."
      }
    },
    "X-RateLimit-Limit": {
      "description": "Maximum requests allowed in the current window.",
      "schema": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "title": "Rate limit",
        "description": "Maximum requests allowed in the current window."
      }
    },
    "X-RateLimit-Remaining": {
      "description": "Requests remaining in the current window.",
      "schema": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "title": "Rate limit remaining",
        "description": "Requests remaining in the current window."
      }
    },
    "X-RateLimit-Reset": {
      "description": "ISO 8601 timestamp when the current rate-limit window resets.",
      "schema": {
        "type": "string",
        "format": "date-time",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
        "title": "Rate limit reset",
        "description": "ISO 8601 timestamp when the current rate-limit window resets."
      }
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "runId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9._:-]+$",
                "description": "Unique workflow run identifier.",
                "examples": [
                  "run_8f14e45f-ceea-467f-a"
                ]
              },
              "statusUrl": {
                "type": "string",
                "format": "uri",
                "description": "Absolute URL of the workflow run resource."
              },
              "executionTimeoutSeconds": {
                "anyOf": [
                  {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Execution timeout applied to this run, in seconds: the plan's timeout, lowered by `executionTimeoutSeconds` when one was requested. Null when the run has no execution timeout."
              }
            },
            "required": [
              "runId",
              "statusUrl",
              "executionTimeoutSeconds"
            ],
            "additionalProperties": false,
            "title": "Queued workflow run",
            "description": "Response data."
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "title": "Queued workflow execution response",
        "description": "Receipt returned for an asynchronous workflow run, or for a synchronous run still running when `waitTimeoutSeconds` elapsed.",
        "examples": [
          {
            "data": {
              "runId": "run_8f14e45f-ceea-467f-a",
              "statusUrl": "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/runs/run_8f14e45f-ceea-467f-a",
              "executionTimeoutSeconds": 5400
            }
          }
        ]
      },
      "examples": {
        "example1": {
          "summary": "Response example 1",
          "value": {
            "data": {
              "runId": "run_8f14e45f-ceea-467f-a",
              "statusUrl": "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/runs/run_8f14e45f-ceea-467f-a",
              "executionTimeoutSeconds": 5400
            }
          }
        }
      }
    }
  }
}

```

### 400

```json

{
  "description": "The request is invalid. This includes a query parameter sent with no value (`?limit=`, `?search=`), which is rejected rather than read as zero, empty, or the parameter default — omit the parameter instead.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "BAD_REQUEST",
          "message": "Invalid request"
        }
      }
    }
  }
}

```

### 401

```json

{
  "description": "The API credential is missing or invalid.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "UNAUTHORIZED",
          "message": "Authentication required"
        }
      }
    }
  }
}

```

### 402

```json

{
  "description": "The workspace has exceeded its usage or billing limits.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "USAGE_LIMIT_EXCEEDED",
          "message": "Usage limit exceeded. Please upgrade your plan to continue."
        }
      }
    }
  }
}

```

### 403

```json

{
  "description": "The caller lacks the rights this operation requires. When the cause is one a caller can act on, `error.details.code` names it. A resource in a workspace the caller cannot reach at all answers `404` instead, so absence and denial are indistinguishable.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "FORBIDDEN",
          "message": "Insufficient workspace permissions",
          "details": {
            "code": "INSUFFICIENT_WORKSPACE_ROLE"
          }
        }
      }
    }
  }
}

```

### 404

```json

{
  "description": "The requested resource was not found.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "NOT_FOUND",
          "message": "Not found"
        }
      }
    }
  }
}

```

### 409

```json

{
  "description": "The run cannot be started, for one of two causes named by `error.details.code`: `RUN_ID_CONFLICT` when the supplied `X-Run-Id` is already claimed, and `CALL_CHAIN_DEPTH_EXCEEDED` when the incoming `X-Sim-Via` chain has reached the maximum workflow-to-workflow call depth.",
  "headers": {
    "X-Run-Id": {
      "description": "Identifier assigned to the workflow run.",
      "schema": {
        "type": "string",
        "minLength": 1,
        "title": "Run identifier",
        "description": "Identifier assigned to the workflow run."
      }
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "CONFLICT",
          "message": "Run ID has already been used",
          "details": {
            "code": "RUN_ID_CONFLICT",
            "runId": "0f7c1a2e-9b3d-4c58-8a21-6d4e5f7a9b01"
          }
        }
      }
    }
  }
}

```

### 413

```json

{
  "description": "The request, or a resource collection it must materialize, exceeds the allowed size: an oversized request body, a generated artifact past the download ceiling, or a workspace folder tree too large to load in full.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "PAYLOAD_TOO_LARGE",
          "message": "Request body is too large"
        }
      }
    }
  }
}

```

### 415

```json

{
  "description": "The request uses an unsupported media type.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "UNSUPPORTED_MEDIA_TYPE",
          "message": "Request body must be sent as application/json"
        }
      }
    }
  }
}

```

### 429

```json

{
  "description": "The caller exceeded the request rate limit.",
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying, sent on `429` and `503`. Add jitter rather than retrying at exactly this offset.",
      "schema": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "title": "Retry after",
        "description": "Seconds to wait before retrying, sent on `429` and `503`. Add jitter rather than retrying at exactly this offset."
      }
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "RATE_LIMITED",
          "message": "API rate limit exceeded",
          "details": {
            "retryAfter": "2026-01-01T00:00:30.000Z"
          }
        }
      }
    }
  }
}

```

### 499

```json

{
  "description": "The client closed the connection before the response was produced. An abort can leave the run going, so `error.details.runId` carries the run id — reconcile against the runs resource rather than starting another run.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "CLIENT_CLOSED_REQUEST",
          "message": "Client cancelled request",
          "details": {
            "runId": "0f7c1a2e-9b3d-4c58-8a21-6d4e5f7a9b01"
          }
        }
      }
    }
  }
}

```

### 500

```json

{
  "description": "An unexpected server error occurred.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "INTERNAL_ERROR",
          "message": "Internal server error"
        }
      }
    }
  }
}

```

### 503

```json

{
  "description": "A required service is temporarily unavailable. When present, `Retry-After` gives the minimum seconds to wait; add jitter before retrying. Check operation-specific guidance before repeating a change after an uncertain response.",
  "headers": {
    "Retry-After": {
      "description": "Seconds to wait before retrying, sent on `429` and `503`. Add jitter rather than retrying at exactly this offset.",
      "schema": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "title": "Retry after",
        "description": "Seconds to wait before retrying, sent on `429` and `503`. Add jitter rather than retrying at exactly this offset."
      }
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the error."
              },
              "details": {
                "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "INSUFFICIENT_WORKSPACE_ROLE",
                          "PERSONAL_API_KEYS_DISABLED",
                          "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
                          "PRINCIPAL_KIND_NOT_PERMITTED",
                          "ORGANIZATION_MEMBERSHIP_REQUIRED",
                          "ORGANIZATION_ADMIN_REQUIRED",
                          "ENTERPRISE_PLAN_REQUIRED",
                          "SSO_DISABLED",
                          "SSO_DOMAIN_NOT_VERIFIED",
                          "SSO_PROVIDER_LIMIT_REACHED",
                          "ORGANIZATION_PLAN_REQUIRED",
                          "AUDIT_LOGS_DISABLED",
                          "ACCESS_REQUESTS_DISABLED",
                          "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
                          "SKILL_EDITOR_ACCESS_REQUIRED",
                          "SECRET_ADMIN_ACCESS_REQUIRED",
                          "WORKSPACE_RESOURCE_LIMIT_REACHED",
                          "PUBLIC_SHARING_NOT_ALLOWED",
                          "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
                          "MCP_SERVER_URL_NOT_ALLOWED",
                          "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
                          "CHAT_AUTH_MODE_NOT_PERMITTED",
                          "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
                          "PERMISSION_GROUP_CAPABILITY_BLOCKED",
                          "INTEGRATION_NOT_ALLOWED",
                          "INSUFFICIENT_SCOPE",
                          "READ_ONLY_API_KEY",
                          "SCIM_MANAGED_MEMBERSHIP",
                          "FEATURE_NOT_ENABLED"
                        ],
                        "title": "Forbidden detail code",
                        "description": "Stable cause code for an actionable `403` response."
                      }
                    },
                    "required": [
                      "code"
                    ],
                    "additionalProperties": {
                      "description": "Additional context for this refusal."
                    },
                    "title": "Actionable forbidden details",
                    "description": "Machine-readable cause and optional context for an actionable `403` response."
                  },
                  {
                    "description": "Other structured context defined by the specific error."
                  }
                ]
              },
              "requestId": {
                "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false,
            "description": "Canonical error details."
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "title": "v2 error response",
        "description": "Canonical error envelope returned by the public v2 API.",
        "examples": [
          {
            "error": {
              "code": "BAD_REQUEST",
              "message": "The request is invalid."
            }
          }
        ]
      },
      "example": {
        "error": {
          "code": "SERVICE_UNAVAILABLE",
          "message": "Service temporarily unavailable"
        }
      }
    }
  }
}

```

## Referenced schemas

The following definitions preserve recursive references and composition exactly.

```json

{
  "#/components/schemas/ExecuteWorkflowRequest": {
    "type": "object",
    "properties": {
      "input": {
        "description": "Workflow input keyed by the selected trigger input-field name.",
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "description": "Value supplied for one workflow input field."
        }
      },
      "run": {
        "description": "Workflow state and entry point to execute. Omit for the active deployment; `source: \"deployment\"` with `version` runs that deployment version, and `source: \"draft\"` the saved draft. A draft run requires OAuth or personal-key write access and supports synchronous or streamed runs only; `waitTimeoutSeconds` lets a synchronous one continue in the background.",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "source": {
                "type": "string",
                "const": "deployment",
                "description": "Execute a deployed workflow version."
              },
              "version": {
                "description": "Deployment version to execute instead of the active one. Requires a full-access API key or an OAuth access token with `api:write`, plus workspace write access, and the workflow must be deployed. An unknown version returns `404`.",
                "type": "integer",
                "minimum": 1,
                "maximum": 2147483647
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "source": {
                "description": "Run the saved draft. `manual` is a deprecated name of `draft`.",
                "type": "string",
                "enum": [
                  "draft",
                  "manual"
                ]
              },
              "entry": {
                "description": "Where the draft run enters. Omit to enter through the workflow trigger; a block entry requires an exact source run.",
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "trigger",
                        "description": "Enter the draft run through a runnable trigger."
                      },
                      "blockId": {
                        "description": "Runnable trigger block to enter through. Omit only when the saved workflow has exactly one runnable trigger.",
                        "type": "string",
                        "minLength": 1
                      },
                      "sample": {
                        "description": "Run with the selected trigger's sample payload, which the server derives from the trigger, instead of `input`. Its writes are sent unless `dry`. Cannot be combined with `input`.",
                        "type": "boolean"
                      },
                      "useMockPayload": {
                        "deprecated": true,
                        "description": "Deprecated name of `sample`, accepted with the same meaning. Send `sample`; a request that sends both with different values is refused.",
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "block",
                        "description": "Start the draft run at a block, using persisted upstream state."
                      },
                      "blockId": {
                        "type": "string",
                        "minLength": 1,
                        "description": "Saved workflow block at which the draft run starts: its id, display name or reference key (the name lowercased, whitespace and dots removed)."
                      },
                      "sourceRunId": {
                        "type": "string",
                        "minLength": 1,
                        "description": "Run in this workflow whose persisted execution state supplies upstream block results. Missing or expired state returns 404. A test run (a dry run, or a workflow test) holds placeholders for the writes it did not send, so it is the source only of a `dry` run."
                      }
                    },
                    "required": [
                      "type",
                      "blockId",
                      "sourceRunId"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "stopAfterBlockId": {
                "description": "Saved workflow block after which the run stops (its id, display name or reference key); downstream blocks do not execute. Must not be inside a loop or parallel. If a router, condition, or untaken error path routes the run away from the block, the run fails as soon as that is decided; no further block starts, though blocks already running finish. With a block entry naming the same block, re-runs only that block against the source run.",
                "type": "string",
                "minLength": 1
              },
              "dry": {
                "description": "Dry run: a call that could change something outside the run (a tool call not declared `read`, every MCP call, an HTTP request other than a GET, HEAD or OPTIONS without a method-override header) is not sent but answered with a correctly shaped placeholder, and the run returns what it held back in `sideEffects`, each list described there. Reads, model calls, credential resolution and code run for real. Child workflows inherit it; custom, Mothership, Pi, Human in the loop and Wait blocks are answered whole, so the run never pauses. Agents read their memory but write none, and nothing else beyond the run's own log is kept: it raises no workspace event, does not count as a run of the workflow, and is logged under the `test` trigger. Synchronous only: cannot be combined with `stream` or `waitTimeoutSeconds`.",
                "type": "boolean"
              },
              "allow": {
                "description": "Blocks whose writes a dry run sends for real, listed in `sideEffects.allowed`. Requires `dry`. Name a block of this workflow by id, display name or reference key, or a block of a workflow it calls as `<workflow>.<block>` (the workflow's id or name, then the block's id, name or key), at most 256 characters. A selector holding a dot names a block of this workflow only by its exact id or display name; otherwise its workflow part is matched against the workflows its Workflow blocks call at any depth, then, for a child chosen as the run goes, a workflow of this workspace by id or exact name. A selector matching several blocks is refused with them. A child's entry applies wherever that workflow runs, at every depth. A Human in the loop or Wait block, a block that runs another workflow (a Workflow or custom block), a loop or parallel, a disabled block, or a block of a workflow reached only as a custom block's cannot be allowed. Allowing an Agent sends only its own tool calls: a workflow or custom block it calls stays stubbed. An entry the run never reaches is listed in `sideEffects.unreached`.",
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                }
              },
              "mocks": {
                "description": "Blocks answered with this output object instead of running, to steer branches or give a stubbed write a realistic result, keyed like `allow` entries (a block of this workflow, or `<workflow>.<block>` of a workflow it calls). Requires `dry`. A locked block (or one inside a locked loop or parallel), a loop or parallel, and a disabled block cannot be mocked; a block of a locked workflow, or of one in a locked folder, returns `423`. A mock is data: it cannot set a field the run’s execution, trace or billing reads (`cost`, `tokens`, `model`, `providerTiming`, `toolCalls`, `executionData`, `childTraceSpans`, `childWorkflowId`, `childWorkflowSnapshotId`, `childDeploymentVersionId`, or any field starting with `_`), nor hold a large-value reference (an object with `__simLargeValueRef`). A field the block does not declare is listed in `sideEffects.mockFields`, not refused. The run records only which blocks were mocked, so a rerun passes the outputs again; its log shows a mocked block’s output like any other block’s.",
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "maxLength": 256,
                  "description": "Block selector."
                },
                "additionalProperties": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "description": "Output field."
                  },
                  "description": "Output object that answers the block instead of its handler."
                },
                "maxProperties": 50
              },
              "mocksFrom": {
                "description": "Answer blocks with their outputs in an earlier run of this workflow. Requires `dry`. The run records the source run and blocks, so a rerun names them again.",
                "type": "object",
                "properties": {
                  "runId": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Run of this workflow whose recorded block outputs answer the blocks. An unknown or expired run returns `404`; one still running, or whose log is not written yet, `409`; reading it needs what reading the run does, and a permission group that hides execution data returns `403`."
                  },
                  "blocks": {
                    "minItems": 1,
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "description": "This workflow's blocks (not a child's; not inside a loop or parallel unless that run mocked it), by id, display name or reference key, answered with the output each recorded in that run, redacted as the run shows it. Refused: a block the run did not execute, and, when that run was a test run, a block it answered with a placeholder rather than mocking or allowing it. Fields a mock cannot set (see `mocks`) are left out and listed in `sideEffects.mockFields`; an output holding a large-value reference is refused. Other refusals are those of `mocks`, and a block cannot be named here and in `mocks` both."
                  }
                },
                "required": [
                  "runId",
                  "blocks"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          }
        ]
      },
      "async": {
        "default": false,
        "description": "Queue the run and return a 202 receipt. Requires a full-access API key or an OAuth access token with `api:write`, and a deployed run source. Cannot stream, select outputs, enable thinking/tool events, or include file-inlining options (`includeFileBase64` or `base64MaxBytes`).",
        "type": "boolean"
      },
      "executionTimeoutSeconds": {
        "description": "Maximum duration of an asynchronous run, in seconds, capped by the plan's execution timeout. Requires `async: true` or `waitTimeoutSeconds`; otherwise returns `400`.",
        "type": "integer",
        "minimum": 1,
        "maximum": 604800
      },
      "waitTimeoutSeconds": {
        "description": "Wait at most this many seconds for a synchronous run; `0` waits until it settles. A run still going then continues in the background and the response carries its run receipt instead of its result: `202` on a JSON response, or a closing `detached` frame on an `application/x-ndjson` result stream, which keeps its `200`. The receipt is sent only once the run can be read on the runs resource, where it can also be cancelled. The run is admitted under asynchronous limits, and a dropped connection no longer cancels it. Requires a full-access API key or an OAuth access token with `api:write`. Cannot be combined with `async` or `stream`.",
        "type": "integer",
        "minimum": 0,
        "maximum": 604800
      },
      "stream": {
        "default": false,
        "description": "Return Server-Sent Events instead of JSON when true. Cannot be combined with `async`.",
        "type": "boolean"
      },
      "selectedOutputs": {
        "description": "Select `<blockName>.<outputPath>` or `<childWorkflowId>.<blockName>.<outputPath>` using normalized block reference names. Child selectors cover every invocation. Synchronous results use selector strings verbatim as `blockOutputs` keys; streaming selections shape the envelope. Unknown block names or IDs return `400` with available blocks before execution. Unexecuted blocks and absent paths are omitted. Incompatible with `async`; select outputs from the finished run resource instead.",
        "maxItems": 100,
        "type": "array",
        "items": {
          "type": "string",
          "minLength": 1
        }
      },
      "includeThinking": {
        "default": false,
        "description": "Include model reasoning events in an agent-event stream. Requires `stream: true` and the `X-Sim-Stream-Protocol: agent-events-v1` request header, and is rejected when `async` is true.",
        "type": "boolean"
      },
      "includeToolCalls": {
        "default": false,
        "description": "Include tool-call events in an agent-event stream. Requires `stream: true` and the `X-Sim-Stream-Protocol: agent-events-v1` request header, and is rejected when `async` is true.",
        "type": "boolean"
      },
      "includeFileBase64": {
        "description": "Inline eligible output files as base64 content. Rejected when `async` is true.",
        "type": "boolean"
      },
      "base64MaxBytes": {
        "description": "Maximum total bytes of file content to inline as base64, lowering but never raising the server limit of 16 MiB. Rejected when `async` is true.",
        "type": "integer",
        "exclusiveMinimum": 0,
        "maximum": 16777216
      }
    },
    "additionalProperties": false,
    "title": "Execute workflow request",
    "description": "Input, workflow-state selection, and execution-mode options. Input descriptions specify compatible modes; invalid combinations return `400`."
  },
  "#/components/headers/X-Run-Id": {
    "description": "Identifier assigned to the workflow run.",
    "schema": {
      "type": "string",
      "minLength": 1,
      "title": "Run identifier",
      "description": "Identifier assigned to the workflow run."
    }
  },
  "#/components/headers/X-RateLimit-Limit": {
    "description": "Maximum requests allowed in the current window.",
    "schema": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "title": "Rate limit",
      "description": "Maximum requests allowed in the current window."
    }
  },
  "#/components/headers/X-RateLimit-Remaining": {
    "description": "Requests remaining in the current window.",
    "schema": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "title": "Rate limit remaining",
      "description": "Requests remaining in the current window."
    }
  },
  "#/components/headers/X-RateLimit-Reset": {
    "description": "ISO 8601 timestamp when the current rate-limit window resets.",
    "schema": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
      "title": "Rate limit reset",
      "description": "ISO 8601 timestamp when the current rate-limit window resets."
    }
  },
  "#/components/schemas/ExecuteWorkflowSyncResponse": {
    "type": "object",
    "properties": {
      "data": {
        "description": "Response data.",
        "$ref": "#/components/schemas/WorkflowRunResult"
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false,
    "title": "Synchronous workflow execution response",
    "description": "Completed, failed, paused, or cancelled synchronous workflow run.",
    "examples": [
      {
        "data": {
          "runId": "run_8f14e45f-ceea-467f-a",
          "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
          "status": "completed",
          "output": {
            "result": "Ticket routed to Support"
          },
          "blockOutputs": null,
          "error": null,
          "startedAt": "2026-08-09T18:04:10.000Z",
          "endedAt": "2026-08-09T18:04:11.000Z",
          "durationMs": 1000,
          "paused": null,
          "executionTimeoutSeconds": 3000
        }
      }
    ]
  },
  "#/components/schemas/WorkflowRunResult": {
    "type": "object",
    "properties": {
      "runId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "pattern": "^[A-Za-z0-9._:-]+$",
        "description": "Unique workflow run identifier.",
        "examples": [
          "run_8f14e45f-ceea-467f-a"
        ]
      },
      "workflowId": {
        "type": "string",
        "description": "Workflow that produced the run."
      },
      "status": {
        "type": "string",
        "enum": [
          "completed",
          "failed",
          "paused",
          "cancelled"
        ],
        "description": "Terminal or paused run status."
      },
      "output": {
        "description": "Workflow output, including partial output on failure."
      },
      "blockOutputs": {
        "anyOf": [
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "description": "Output value produced by one workflow block."
            }
          },
          {
            "type": "null"
          }
        ],
        "description": "Outputs of the blocks named by `selectedOutputs`, keyed by those selector strings exactly as sent, or null when none were requested. `output` stays the final workflow output regardless. Selectors whose block did not run or whose path is absent are omitted (an unknown block is a `400` instead); failed runs include the outputs of the blocks that did run."
      },
      "error": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ExecutionError"
          },
          {
            "type": "null"
          }
        ],
        "description": "Structured execution failure, or null when none occurred."
      },
      "startedAt": {
        "description": "ISO 8601 timestamp when execution started.",
        "format": "date-time",
        "type": "string"
      },
      "endedAt": {
        "description": "ISO 8601 timestamp when execution ended.",
        "format": "date-time",
        "type": "string"
      },
      "durationMs": {
        "description": "Execution duration in milliseconds.",
        "type": "number",
        "minimum": 0
      },
      "executionTimeoutSeconds": {
        "anyOf": [
          {
            "type": "number",
            "exclusiveMinimum": 0
          },
          {
            "type": "null"
          }
        ],
        "description": "Execution timeout applied to this run, in seconds: the plan's timeout, lowered by `executionTimeoutSeconds` when one was requested. Null when the run has no execution timeout."
      },
      "paused": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "runId": {
                "type": "string",
                "description": "Run to name in Resume workflow run: the run this pause is recorded under, which for a resumed run that paused again is the run it resumed."
              },
              "points": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "contextId": {
                      "type": "string",
                      "description": "Pause context to name in `contextId` when resuming this point."
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "human",
                        "time"
                      ],
                      "description": "`human` waits for a resume request; `time` resumes automatically at `resumeAt`."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "paused",
                        "queued",
                        "resuming",
                        "resumed",
                        "failed"
                      ],
                      "description": "Resume state of this point: waiting, queued behind another resume, resuming, resumed, or a failed resume attempt."
                    }
                  },
                  "required": [
                    "contextId",
                    "kind",
                    "status"
                  ],
                  "additionalProperties": false
                },
                "description": "Every point the run is paused at. Resume one with Resume workflow run, naming `runId` and its `contextId`."
              }
            },
            "required": [
              "runId",
              "points"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ],
        "description": "Where the run waits when `status` is `paused`; null otherwise."
      },
      "sideEffects": {
        "description": "What a dry run (`run.dry`) did with each write it reached, whatever its status; absent otherwise.",
        "$ref": "#/components/schemas/WorkflowRunSideEffects"
      },
      "overrides": {
        "description": "A dry run's overrides (`run.dry`); absent for any other run.",
        "$ref": "#/components/schemas/WorkflowRunOverrides"
      }
    },
    "required": [
      "runId",
      "workflowId",
      "status",
      "output",
      "blockOutputs",
      "error",
      "executionTimeoutSeconds",
      "paused"
    ],
    "additionalProperties": false,
    "title": "Workflow run result",
    "description": "Response data."
  },
  "#/components/schemas/ExecutionError": {
    "type": "object",
    "properties": {
      "message": {
        "type": "string",
        "description": "Human-readable workflow execution failure message."
      },
      "code": {
        "type": "string",
        "enum": [
          "TIMEOUT",
          "CANCELLED",
          "USAGE_LIMIT_EXCEEDED",
          "INVALID_INPUT",
          "BLOCK_EXECUTION_FAILED",
          "CHILD_WORKFLOW_FAILED",
          "EXECUTION_FAILED"
        ],
        "description": "Stable machine-readable execution failure code. `BLOCK_EXECUTION_FAILED` and `CHILD_WORKFLOW_FAILED` are reported only where block attribution is available; elsewhere a block-level failure is reported as `EXECUTION_FAILED`."
      },
      "blockId": {
        "description": "Identifier of the failing block, when attributable. Get workflow run reads it from the run trace, so it is absent there when the trace is unavailable or hidden by organization permission groups, when no failed block in the trace recorded the run error, and for a timeout, cancellation, usage-limit, or invalid-input failure.",
        "type": "string"
      },
      "blockName": {
        "description": "Display name of the failing block, when attributable. Present whenever `blockId` is.",
        "type": "string"
      },
      "blockType": {
        "description": "Integration or block type that failed, when attributable. Present whenever `blockId` is.",
        "type": "string"
      },
      "rerunFromBlockId": {
        "description": "Block a rerun of this failure starts from (`run.entry` of type `block` naming it, with this run as `sourceRunId`): the failing block, or the outermost loop or parallel holding it, since a run cannot start inside one. Set by Execute workflow from the graph the run executed and by Get workflow run from the saved draft, whenever `blockId` is and that graph still has the block.",
        "type": "string"
      }
    },
    "required": [
      "message",
      "code"
    ],
    "additionalProperties": false,
    "title": "Execution error",
    "description": "Structured in-band failure details for a workflow run."
  },
  "#/components/schemas/WorkflowRunSideEffects": {
    "type": "object",
    "properties": {
      "stubbed": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "workflowId": {
              "type": "string",
              "description": "Workflow whose block it was: the run workflow, or a child workflow it called."
            },
            "blockId": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Block id in that workflow; null when the call named no block."
            },
            "block": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Block display name; null when the call named no block."
            },
            "tool": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Tool the block (or an Agent) called; null when the whole block was answered instead of run."
            },
            "request": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "description": "Request field."
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "What the call would have sent: an in-process operation's input, an HTTP call's `method`, `url` and `body` (never header values; for code's `fetch`, header names, the URL capped with only query parameter names, the body capped, and the code's workspace and personal secrets masked, though a secret typed into the code itself is not), or a custom or MCP tool's `arguments`. For a block answered whole, its logged inputs. Credentials, secrets, password fields and (when the workspace redacts it) PII are redacted; null when the run could not prove none remain, or could not build the request once they were masked (such as a URL that is wholly a secret)."
            },
            "returned": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "description": "Placeholder field."
              },
              "description": "Placeholder output the block or tool call returned to the run instead."
            },
            "mcp": {
              "description": "The MCP server and tool an MCP block's call named; absent for any other call.",
              "type": "object",
              "properties": {
                "server": {
                  "type": "string",
                  "description": "MCP server or managed connection id."
                },
                "tool": {
                  "type": "string",
                  "description": "MCP tool name."
                }
              },
              "required": [
                "server",
                "tool"
              ],
              "additionalProperties": false
            },
            "reason": {
              "description": "Why a call that is not a plain write was held back; absent for a plain write. `placeholder`: a read whose request holds a placeholder the run returned earlier (a `dry_run_<kind>_<n>` string or a number above 900000000, such as a placeholder row's id in a URL, or free text quoting one), so it depends on a call that was never sent. `mcp-read-only`: an MCP call whose server declares the tool read-only and not destructive (`readOnlyHint`, not `destructiveHint`), a claim Sim cannot verify; name its block in `run.allow` to send it.",
              "type": "string",
              "enum": [
                "placeholder",
                "mcp-read-only"
              ]
            }
          },
          "required": [
            "workflowId",
            "blockId",
            "block",
            "tool",
            "request",
            "returned"
          ],
          "additionalProperties": false
        },
        "description": "Calls that were not sent, in the order the run reached them, each answered with a placeholder (a table row insert, upsert or update echoes the data it would have written, secrets masked; placeholder ids and values the request cannot determine are `dry_run_<kind>_<n>` strings and numbers above 900000000): writes, every MCP call, and reads that would send a placeholder (`reason`). Code run in the isolate (JavaScript without imports: a Function block's, a Condition's expressions, a While or Do While loop's condition, or code an Agent's model writes) sends its GET, HEAD and OPTIONS `fetch` calls (an API that writes on a GET is not stubbed); any other request, or one carrying a method-override header, gets an empty 200 (header `x-sim-dry-run: stubbed`) and is listed here as tool `function_execute`."
      },
      "allowed": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "workflowId": {
              "type": "string",
              "description": "Workflow whose block it was: the run workflow, or a child workflow it called."
            },
            "blockId": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Block id in that workflow; null when the call named no block."
            },
            "block": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Block display name; null when the call named no block."
            },
            "tool": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Tool sent; null when the whole block ran."
            },
            "mcp": {
              "description": "The MCP server and tool an MCP block's call named; absent for any other call.",
              "type": "object",
              "properties": {
                "server": {
                  "type": "string",
                  "description": "MCP server or managed connection id."
                },
                "tool": {
                  "type": "string",
                  "description": "MCP tool name."
                }
              },
              "required": [
                "server",
                "tool"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "workflowId",
            "blockId",
            "block",
            "tool"
          ],
          "additionalProperties": false
        },
        "description": "Writes sent for real because `run.allow` named their block, once per block and tool (an MCP block's per MCP tool)."
      },
      "unchecked": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "workflowId": {
              "type": "string",
              "description": "Workflow whose block it was: the run workflow, or a child workflow it called."
            },
            "blockId": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Block id in that workflow; null when the call named no block."
            },
            "block": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Block display name; null when the call named no block."
            },
            "reason": {
              "type": "string",
              "description": "Why the run cannot see what this code changed."
            }
          },
          "required": [
            "workflowId",
            "blockId",
            "block",
            "reason"
          ],
          "additionalProperties": false
        },
        "description": "Blocks whose code ran for real in a remote sandbox (shell, Python, JavaScript with imports, a selected sandbox or files), once per block: a Function block's code, a Condition's expressions, or code an Agent's model wrote, whose network calls the run cannot see. Code run in the isolate is not listed: its network writes are stubbed."
      },
      "omitted": {
        "type": "object",
        "properties": {
          "stubbed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Writes left out of `stubbed`."
          },
          "allowed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Writes left out of `allowed`."
          },
          "unchecked": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Blocks left out of `unchecked`."
          }
        },
        "required": [
          "stubbed",
          "allowed",
          "unchecked"
        ],
        "additionalProperties": false,
        "description": "Entries each list left out once it held 50."
      },
      "unreached": {
        "description": "Allowed and mocked blocks the run never reached: on a branch it did not take, upstream of a block entry, or in a child it never called. Absent when none.",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "workflowId": {
              "type": "string",
              "description": "Workflow of the block."
            },
            "blockId": {
              "type": "string",
              "description": "Block id in that workflow."
            },
            "block": {
              "type": "string",
              "description": "Block display name."
            },
            "kind": {
              "type": "string",
              "enum": [
                "allow",
                "mock"
              ],
              "description": "`allow` for a `run.allow` entry, `mock` for `run.mocks` or `run.mocksFrom`."
            }
          },
          "required": [
            "workflowId",
            "blockId",
            "block",
            "kind"
          ],
          "additionalProperties": false
        }
      },
      "mockFields": {
        "description": "Mocks with fields a block reading them gets nothing from. Absent when none.",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "workflowId": {
              "type": "string",
              "description": "Workflow of the block."
            },
            "blockId": {
              "type": "string",
              "description": "Block id in that workflow."
            },
            "block": {
              "type": "string",
              "description": "Block display name."
            },
            "undeclared": {
              "description": "Top-level fields a passed mock sets that its block does not declare as outputs, likely misspelt. Agent and Function blocks, whose outputs the model or code decides, never have any.",
              "type": "array",
              "items": {
                "type": "string",
                "description": "Output field."
              }
            },
            "dropped": {
              "description": "Fields of an output read from a run (`run.mocksFrom`) that a mock cannot set (see `run.mocks`), so left out.",
              "type": "array",
              "items": {
                "type": "string",
                "description": "Output field."
              }
            }
          },
          "required": [
            "workflowId",
            "blockId",
            "block"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "stubbed",
      "allowed",
      "unchecked",
      "omitted"
    ],
    "additionalProperties": false,
    "title": "Workflow run side effects",
    "description": "What a dry run (`run.dry`) did with each write it reached, whatever its status; absent otherwise."
  },
  "#/components/schemas/WorkflowRunOverrides": {
    "type": "object",
    "properties": {
      "allow": {
        "type": "array",
        "items": {
          "type": "string",
          "description": "Block selector."
        },
        "description": "Blocks whose writes the run sent (`run.allow`)."
      },
      "mocks": {
        "type": "array",
        "items": {
          "type": "string",
          "description": "Block selector."
        },
        "description": "Blocks the run answered with outputs the caller passed (`run.mocks`). Only the blocks are recorded, so a rerun passes the outputs again."
      },
      "mocksFrom": {
        "description": "Blocks the run answered with their outputs in another run (`run.mocksFrom`), which a rerun reads again. Absent when none.",
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "description": "Run the outputs were read from."
          },
          "blocks": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Block id."
            },
            "description": "Blocks answered, by id."
          }
        },
        "required": [
          "runId",
          "blocks"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "allow",
      "mocks"
    ],
    "additionalProperties": false,
    "title": "Workflow run overrides",
    "description": "A dry run's overrides (`run.dry`); absent for any other run."
  },
  "#/components/schemas/ExecuteWorkflowQueuedResponse": {
    "type": "object",
    "properties": {
      "data": {
        "description": "Response data.",
        "$ref": "#/components/schemas/QueuedWorkflowRun"
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false,
    "title": "Queued workflow execution response",
    "description": "Receipt returned for an asynchronous workflow run, or for a synchronous run still running when `waitTimeoutSeconds` elapsed.",
    "examples": [
      {
        "data": {
          "runId": "run_8f14e45f-ceea-467f-a",
          "statusUrl": "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/runs/run_8f14e45f-ceea-467f-a",
          "executionTimeoutSeconds": 5400
        }
      }
    ]
  },
  "#/components/schemas/QueuedWorkflowRun": {
    "type": "object",
    "properties": {
      "runId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "pattern": "^[A-Za-z0-9._:-]+$",
        "description": "Unique workflow run identifier.",
        "examples": [
          "run_8f14e45f-ceea-467f-a"
        ]
      },
      "statusUrl": {
        "type": "string",
        "format": "uri",
        "description": "Absolute URL of the workflow run resource."
      },
      "executionTimeoutSeconds": {
        "anyOf": [
          {
            "type": "number",
            "exclusiveMinimum": 0
          },
          {
            "type": "null"
          }
        ],
        "description": "Execution timeout applied to this run, in seconds: the plan's timeout, lowered by `executionTimeoutSeconds` when one was requested. Null when the run has no execution timeout."
      }
    },
    "required": [
      "runId",
      "statusUrl",
      "executionTimeoutSeconds"
    ],
    "additionalProperties": false,
    "title": "Queued workflow run",
    "description": "Response data."
  },
  "#/components/responses/BadRequest": {
    "description": "The request is invalid. This includes a query parameter sent with no value (`?limit=`, `?search=`), which is rejected rather than read as zero, empty, or the parameter default — omit the parameter instead.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "BAD_REQUEST",
            "message": "Invalid request"
          }
        }
      }
    }
  },
  "#/components/schemas/V2Error": {
    "type": "object",
    "properties": {
      "error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable machine-readable error code."
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation of the error."
          },
          "details": {
            "description": "Structured error context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/V2ActionableForbiddenDetails"
              },
              {
                "description": "Other structured context defined by the specific error."
              }
            ]
          },
          "requestId": {
            "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false,
        "description": "Canonical error details."
      }
    },
    "required": [
      "error"
    ],
    "additionalProperties": false,
    "title": "v2 error response",
    "description": "Canonical error envelope returned by the public v2 API.",
    "examples": [
      {
        "error": {
          "code": "BAD_REQUEST",
          "message": "The request is invalid."
        }
      }
    ]
  },
  "#/components/schemas/V2ActionableForbiddenDetails": {
    "type": "object",
    "properties": {
      "code": {
        "$ref": "#/components/schemas/V2ForbiddenDetailCode"
      }
    },
    "required": [
      "code"
    ],
    "additionalProperties": {
      "description": "Additional context for this refusal."
    },
    "title": "Actionable forbidden details",
    "description": "Machine-readable cause and optional context for an actionable `403` response."
  },
  "#/components/schemas/V2ForbiddenDetailCode": {
    "type": "string",
    "enum": [
      "INSUFFICIENT_WORKSPACE_ROLE",
      "PERSONAL_API_KEYS_DISABLED",
      "WORKSPACE_KEY_OPERATION_NOT_PERMITTED",
      "PRINCIPAL_KIND_NOT_PERMITTED",
      "ORGANIZATION_MEMBERSHIP_REQUIRED",
      "ORGANIZATION_ADMIN_REQUIRED",
      "ENTERPRISE_PLAN_REQUIRED",
      "SSO_DISABLED",
      "SSO_DOMAIN_NOT_VERIFIED",
      "SSO_PROVIDER_LIMIT_REACHED",
      "ORGANIZATION_PLAN_REQUIRED",
      "AUDIT_LOGS_DISABLED",
      "ACCESS_REQUESTS_DISABLED",
      "ACCESS_REQUEST_ORGANIZATION_REQUIRED",
      "SKILL_EDITOR_ACCESS_REQUIRED",
      "SECRET_ADMIN_ACCESS_REQUIRED",
      "WORKSPACE_RESOURCE_LIMIT_REACHED",
      "PUBLIC_SHARING_NOT_ALLOWED",
      "CREDENTIAL_ADMIN_ACCESS_REQUIRED",
      "MCP_SERVER_URL_NOT_ALLOWED",
      "WORKSPACE_PLAN_CAPABILITY_REQUIRED",
      "CHAT_AUTH_MODE_NOT_PERMITTED",
      "CONNECTOR_MANAGED_RESOURCE_READ_ONLY",
      "PERMISSION_GROUP_CAPABILITY_BLOCKED",
      "INTEGRATION_NOT_ALLOWED",
      "INSUFFICIENT_SCOPE",
      "READ_ONLY_API_KEY",
      "SCIM_MANAGED_MEMBERSHIP",
      "FEATURE_NOT_ENABLED"
    ],
    "title": "Forbidden detail code",
    "description": "Stable cause code for an actionable `403` response."
  },
  "#/components/responses/Unauthorized": {
    "description": "The API credential is missing or invalid.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "UNAUTHORIZED",
            "message": "Authentication required"
          }
        }
      }
    }
  },
  "#/components/responses/UsageLimitExceeded": {
    "description": "The workspace has exceeded its usage or billing limits.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "USAGE_LIMIT_EXCEEDED",
            "message": "Usage limit exceeded. Please upgrade your plan to continue."
          }
        }
      }
    }
  },
  "#/components/responses/Forbidden": {
    "description": "The caller lacks the rights this operation requires. When the cause is one a caller can act on, `error.details.code` names it. A resource in a workspace the caller cannot reach at all answers `404` instead, so absence and denial are indistinguishable.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "FORBIDDEN",
            "message": "Insufficient workspace permissions",
            "details": {
              "code": "INSUFFICIENT_WORKSPACE_ROLE"
            }
          }
        }
      }
    }
  },
  "#/components/responses/NotFound": {
    "description": "The requested resource was not found.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "NOT_FOUND",
            "message": "Not found"
          }
        }
      }
    }
  },
  "#/components/responses/RunIdConflict": {
    "description": "The run cannot be started, for one of two causes named by `error.details.code`: `RUN_ID_CONFLICT` when the supplied `X-Run-Id` is already claimed, and `CALL_CHAIN_DEPTH_EXCEEDED` when the incoming `X-Sim-Via` chain has reached the maximum workflow-to-workflow call depth.",
    "headers": {
      "X-Run-Id": {
        "$ref": "#/components/headers/X-Run-Id"
      }
    },
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "CONFLICT",
            "message": "Run ID has already been used",
            "details": {
              "code": "RUN_ID_CONFLICT",
              "runId": "0f7c1a2e-9b3d-4c58-8a21-6d4e5f7a9b01"
            }
          }
        }
      }
    }
  },
  "#/components/responses/PayloadTooLarge": {
    "description": "The request, or a resource collection it must materialize, exceeds the allowed size: an oversized request body, a generated artifact past the download ceiling, or a workspace folder tree too large to load in full.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "PAYLOAD_TOO_LARGE",
            "message": "Request body is too large"
          }
        }
      }
    }
  },
  "#/components/responses/UnsupportedMediaType": {
    "description": "The request uses an unsupported media type.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "UNSUPPORTED_MEDIA_TYPE",
            "message": "Request body must be sent as application/json"
          }
        }
      }
    }
  },
  "#/components/responses/RateLimited": {
    "description": "The caller exceeded the request rate limit.",
    "headers": {
      "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
      }
    },
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "RATE_LIMITED",
            "message": "API rate limit exceeded",
            "details": {
              "retryAfter": "2026-01-01T00:00:30.000Z"
            }
          }
        }
      }
    }
  },
  "#/components/headers/Retry-After": {
    "description": "Seconds to wait before retrying, sent on `429` and `503`. Add jitter rather than retrying at exactly this offset.",
    "schema": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "title": "Retry after",
      "description": "Seconds to wait before retrying, sent on `429` and `503`. Add jitter rather than retrying at exactly this offset."
    }
  },
  "#/components/responses/ClientClosedRequest": {
    "description": "The client closed the connection before the response was produced. An abort can leave the run going, so `error.details.runId` carries the run id — reconcile against the runs resource rather than starting another run.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "CLIENT_CLOSED_REQUEST",
            "message": "Client cancelled request",
            "details": {
              "runId": "0f7c1a2e-9b3d-4c58-8a21-6d4e5f7a9b01"
            }
          }
        }
      }
    }
  },
  "#/components/responses/InternalError": {
    "description": "An unexpected server error occurred.",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "INTERNAL_ERROR",
            "message": "Internal server error"
          }
        }
      }
    }
  },
  "#/components/responses/ServiceUnavailable": {
    "description": "A required service is temporarily unavailable. When present, `Retry-After` gives the minimum seconds to wait; add jitter before retrying. Check operation-specific guidance before repeating a change after an uncertain response.",
    "headers": {
      "Retry-After": {
        "$ref": "#/components/headers/Retry-After"
      }
    },
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/V2Error"
        },
        "example": {
          "error": {
            "code": "SERVICE_UNAVAILABLE",
            "message": "Service temporarily unavailable"
          }
        }
      }
    }
  }
}

```

[Download OpenAPI specification](/openapi.json)

Source: `openapi-v2-workflows.json`, operation `executeWorkflowV2`.