Executions

SDK platic.tools.functions.runs()
SDK platic.tools.functions.runs()

Each agent call, manual run, or test records an execution. It includes the result, logs, and HTTP calls, without secret values.

The first request lists the executions of all functions; the second, those of a single function. Both go from newest to oldest.

Example

await platic.tools.functions.runs({ limit: 20 });

await platic.tools.functions.runs({ functionId: "fn_123" });

Parameters

ParameterInTypeDescriptionRequired
functionIdpathstringFunction ID. Only on the second route✓
limitqueryintegerHow many to return, from 1 to 100. Default, 50—
pageTokenquerystringThe previous page's nextPageToken—
workspacequerystringOnly if the credential covers several workspaces: the workspace to act in—

Response

{
  "status": "success",
  "data": [
    {
      "id": "run_8d1f",
      "functionId": "Hk2s9QmXc1",
      "functionName": "tax_id_lookup",
      "version": 1,
      "trigger": "agent",
      "ok": true,
      "durationMs": 412,
      "inputPreview": "{\"taxId\":\"XAXX010101000\"}",
      "outputPreview": "{\"found\":true,\"name\":\"EXAMPLE COMPANY INC\"}",
      "logs": ["info response {\"status\":200}"],
      "httpCalls": [
        { "method": "POST", "host": "api.example.com", "status": 200, "durationMs": 380 }
      ],
      "agentId": "Qm3vT8yLp2",
      "conversationId": "c1F9aZr7Kd",
      "at": "2026-11-24T18:05:00.000Z"
    },
    {
      "id": "run_7a02",
      "functionId": "Hk2s9QmXc1",
      "functionName": "tax_id_lookup",
      "version": "draft",
      "trigger": "test",
      "ok": false,
      "errorCode": "EGRESS_DENIED",
      "errorMessage": "La función intentó llamar a un dominio que no está permitido.",
      "durationMs": 95,
      "logs": [],
      "httpCalls": [],
      "actor": "user:8sKd2LxQp0",
      "at": "2026-11-24T17:58:00.000Z"
    }
  ],
  "nextPageToken": "eyJhdCI6IjIwMjYtMTEtMjRUMTg6MDU6MDAuMDAwWiJ9"
}

Response fields

FieldTypeDescription
nextPageTokenstring | nullFor the next page: send it as pageToken. null when there are no more
data[].idstringExecution ID
data[].functionId, functionNamestringThe function that ran
data[].versioninteger | stringThe version that ran, or "draft" in a test
data[].triggerstringWho ran it: agent, manual or test
data[].okbooleanWhether it finished well
data[].errorCode, errorMessagestringWhen it failed. See errors inside an execution
data[].durationMsintegerDuration
data[].inputPreview, outputPreviewstringExcerpt of the input and the output, up to 4 KB each
data[].logsstring[]What the code wrote with log
data[].httpCallsarrayEach call with method, host, status and durationMs
data[].agentId, conversationIdstringThe agent and the conversation, when an agent called it
data[].actorstringWho ran it by hand or tested it
data[].atstringISO 8601 date

Errors

Statusdetails.codeWhen
400INVALID_REQUESTlimit out of range, invalid pageToken, or the credential covers several workspaces and workspace is missing
403FORBIDDENThe person behind the token does not have access to Integrations
404NOT_FOUNDThe function does not exist in this workspace

Notes

  • The executions of a deleted function are kept for 30 days.
  • For the next page, send nextPageToken as pageToken. cursor is also accepted as an alias for pageToken.
  • Secret values never appear: Platica removes them before storing.