agent-swarm.devagent-swarm.dev

Script Runs

Inspect durable script workflow runs, review journal entries, and monitor swarm-script, raw-LLM, and agent-task execution status through the Script Runs API

POST
/api/internal/raw-llm

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "http://localhost:3013/api/internal/raw-llm" \  -H "Content-Type: application/json" \  -d '{    "prompt": "string"  }'
{
  "result": null,
  "model": "string"
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/internal/script-runs/{runId}/agent-task

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

runId*string
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "http://localhost:3013/api/internal/script-runs/497f6eca-6276-4993-bfeb-53cbbbba6f08/agent-task" \  -H "Content-Type: application/json" \  -d '{    "stepKey": "string"  }'
{
  "taskId": "string",
  "taskOutput": "string"
}
{
  "taskId": "string",
  "status": "backlog"
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/internal/script-runs/{runId}/heartbeat

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

runId*string
Formatuuid

Response Body

application/json

curl -X POST "http://localhost:3013/api/internal/script-runs/497f6eca-6276-4993-bfeb-53cbbbba6f08/heartbeat"
Empty
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/internal/script-runs/{runId}/status

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

runId*string
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "http://localhost:3013/api/internal/script-runs/497f6eca-6276-4993-bfeb-53cbbbba6f08/status" \  -H "Content-Type: application/json" \  -d '{    "status": "completed"  }'
Empty
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/internal/script-runs/{runId}/steps

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

runId*string
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "http://localhost:3013/api/internal/script-runs/497f6eca-6276-4993-bfeb-53cbbbba6f08/steps" \  -H "Content-Type: application/json" \  -d '{    "stepKey": "string",    "stepType": "string",    "status": "completed"  }'
{
  "ok": true
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/internal/script-runs/{runId}/steps/{stepKey}

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

runId*string
Formatuuid
stepKey*string
Length1 <= length

Response Body

application/json

application/json

curl -X GET "http://localhost:3013/api/internal/script-runs/497f6eca-6276-4993-bfeb-53cbbbba6f08/steps/string"
{
  "stepKey": "string",
  "stepType": "string",
  "status": "completed",
  "result": null,
  "error": "string"
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/script-runs

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Query Parameters

status?string
Value in"running" | "paused" | "completed" | "failed" | "cancelled" | "aborted_limit"
agentId?string
scriptName?string
limit?integer
Range1 <= value <= 500
offset?|
Range0 <= value

Response Body

application/json

curl -X GET "http://localhost:3013/api/script-runs"
{
  "runs": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "agentId": "string",
      "scriptName": "string",
      "kind": "workflow",
      "status": "running",
      "pid": 0,
      "startedAt": "string",
      "finishedAt": "string",
      "error": "string",
      "lastHeartbeatAt": "string",
      "idempotencyKey": "string",
      "requestedByUserId": "string"
    }
  ],
  "total": 0
}
POST
/api/script-runs

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:3013/api/script-runs" \  -H "Content-Type: application/json" \  -d '{    "source": "string"  }'
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "status": "running",
  "url": "string"
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "status": "running",
  "url": "string"
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
DELETE
/api/script-runs/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string
Formatuuid

Response Body

application/json

curl -X DELETE "http://localhost:3013/api/script-runs/497f6eca-6276-4993-bfeb-53cbbbba6f08"
Empty
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/script-runs/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string
Formatuuid

Response Body

application/json

application/json

curl -X GET "http://localhost:3013/api/script-runs/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "run": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "agentId": "string",
    "scriptName": "string",
    "source": "string",
    "args": null,
    "kind": "workflow",
    "status": "running",
    "pid": 0,
    "startedAt": "string",
    "finishedAt": "string",
    "output": null,
    "error": "string",
    "lastHeartbeatAt": "string",
    "idempotencyKey": "string",
    "requestedByUserId": "string"
  },
  "journal": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "runId": "78c33d18-170c-44d3-a227-b3194f134f73",
      "stepKey": "string",
      "stepType": "string",
      "config": {
        "property1": null,
        "property2": null
      },
      "status": "completed",
      "result": null,
      "error": "string",
      "startedAt": "string",
      "completedAt": "string",
      "durationMs": 0
    }
  ]
}
{
  "error": "string",
  "property1": null,
  "property2": null
}