Skip to content
Anlyon
Esc
↑↓navigate↵open⌘Jpreview

Get a function run

A run with its input and output, every call it made in order (refused ones included) and its receipt. A plan run carries its plan and the plan’s approval; an apply run names the plan run it carried out. A key created with endUserRequired reads its own end user’s runs and no others.

GET/api/v2/function-runs/{id}
Authorization
AuthorizationBearer token (Anlyon API key) · headerrequired

Workspace API key sent as Authorization: Bearer <key>.

or
better-auth.session_tokenAPI key · cookierequired

Browser session used by dashboard-only operations.

Path parameters
idstringrequired

The run's id (frn_...).

min length 1 · max length 100
Header parameters
X-Request-Idstring

Optional caller correlation ID. Unsafe or oversized values are replaced.

max length 128
Anlyon-End-Userstring

The end user this call acts for: your own id for them, 1 to 128 characters of letters, digits and . _ : @ -. Accepted only with an API key, which stays on your server; a session or an OAuth token that sends it is refused. A key created with endUserRequired must send it on every action call (400 END_USER_REQUIRED). On an /end-users/{endUserId} route it must name the same end user as the path.

min length 1 · max length 128 · matches ^[A-Za-z0-9._:@-]{1,128}$
Responses
200

The run.

successbooleanrequired
Allowed:true
dataFunctionRunrequired
Show properties
idstringrequired
functionIdstringrequired
functionNamestringrequired
functionVersionIdstringrequired
modestringrequired
Allowed:straight_throughplanapply
statusstringrequired
Allowed:runningsucceededfailedbudget_exceededplannedawaiting_approvaldiverged
endUserIdstring | nullrequired

The end user the run acted for. Every call carried it.

inputobjectrequired
inputDigeststringrequired
outputany | nullrequired

What run returned

errorobject | nullrequired
Show properties
codestringrequired
messagestringrequired
logsstring[]required

Lines from anlyon.log. At most 100.

budgetstring | nullrequired

The budget that ended the run.

Allowed:maxActionCallsmaxCpuMsmaxSubrequeststimeoutMs
actionCallsintegerrequired
min 0
callsFunctionRunCall[]required
Show properties
Array of FunctionRunCall
sequenceintegerrequired
min 1
actionstringrequired
kindstringrequired

From the action's method. A GET reads.

Allowed:readwrite
statestringrequired

intent is a write a plan run recorded and did not send.

Allowed:intentdispatchedrefusedfailed
invocationIdstring | nullrequired

The invocation the call became

refusalstring | nullrequired

Why the call was refused, when it was. RUN_DIVERGED for an apply run's write that did not match its plan.

plannedSequenceinteger | nullrequired

An apply run's write

createdAtstring<date-time>required
planFunctionRunPlan | nullrequired

A plan run's plan

Show properties
Any of:
FunctionRunPlan
digeststringrequired

Covers the version

writesobject[]required
Show properties
Array of object
sequenceintegerrequired
actionstringrequired
inputanyrequired

The write's input

approvalobject | nullrequired

Null when the plan has no writes. It needs no approval.

Show properties
idstringrequired
statusstringrequired
Allowed:pendingapproveddeniedexpired
deciderstringrequired
Allowed:teamend_user
appliedByRunIdstring | nullrequired

The apply run that carried out the plan. A plan is applied at most once.

null
null
planRunIdstring | nullrequired

An apply run's plan run.

planDigeststring | nullrequired

An apply run's approved plan digest.

approvalIdstring | nullrequired

An apply run's plan approval.

receiptFunctionRunReceipt | nullrequired
Show properties
Any of:
FunctionRunReceipt
functionIdstringrequired
functionVersionIdstringrequired
digeststringrequired
inputDigeststringrequired
modestringrequired
Allowed:straight_throughplanapply
planDigeststring | nullrequired

A plan run's plan

approvalIdstring | nullrequired
planRunIdstring | nullrequired

For an apply run

callsobject[]required
Show properties
Array of object
sequenceintegerrequired
actionstringrequired
kindstringrequired
Allowed:readwrite
statestringrequired
Allowed:intentdispatchedrefusedfailed
invocationIdstring | nullrequired
refusalstring | nullrequired
plannedSequenceinteger | nullrequired
outcomestringrequired
Allowed:succeededfailedbudget_exceededplannedawaiting_approvaldiverged
budgetstring | nullrequired
Allowed:maxActionCallsmaxCpuMsmaxSubrequeststimeoutMs
finishedAtstring<date-time>required
null
null
durationMsinteger | nullrequired
createdAtstring<date-time>required
finishedAtstring<date-time> | nullrequired
401

Unauthorized - Invalid or missing API key

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

403

Authenticated credential lacks the required scope or workspace access.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

404

Not Found - Resource does not exist

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

429

Too Many Requests - Rate limit exceeded. A workspace's API requests are limited per minute and per UTC clock hour by plan; Retry-After says when to try again, and an hourly refusal names the limit and when the count resets. Successful responses carry the same limits in X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (the minute) and X-RateLimit-Limit-Hour, X-RateLimit-Remaining-Hour, X-RateLimit-Reset-Hour (the hour).

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://api.anlyon.com/api/v2/function-runs/string' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "success": true,
  "data": {
    "id": "frn_V1StGXR8_Z5jdHi6B-myT",
    "functionId": "fn_V1StGXR8_Z5jdHi6B-myT",
    "functionName": "refund-with-checks",
    "functionVersionId": "fnv_V1StGXR8_Z5jdHi6B-myT",
    "mode": "straight_through",
    "status": "running",
    "endUserId": "user_123",
    "input": {},
    "inputDigest": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
    "output": null,
    "error": {
      "code": "FUNCTION_THREW",
      "message": "string"
    },
    "logs": [
      "string"
    ],
    "budget": "maxActionCalls",
    "actionCalls": 2,
    "calls": [
      {
        "sequence": 1,
        "action": "refund",
        "kind": "read",
        "state": "intent",
        "invocationId": "inv_V1StGXR8_Z5jdHi6B-myT",
        "refusal": "ACTION_NOT_ALLOWED",
        "plannedSequence": 2,
        "createdAt": "2019-08-24T14:15:22Z"
      }
    ],
    "plan": {
      "digest": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
      "writes": [
        {
          "sequence": 2,
          "action": "refund",
          "input": null
        }
      ],
      "approval": {
        "id": "apr_V1StGXR8_Z5jdHi6B-myT",
        "status": "pending",
        "decider": "team"
      },
      "appliedByRunId": "string"
    },
    "planRunId": "string",
    "planDigest": "string",
    "approvalId": "string",
    "receipt": {
      "functionId": "fn_V1StGXR8_Z5jdHi6B-myT",
      "functionVersionId": "fnv_V1StGXR8_Z5jdHi6B-myT",
      "digest": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
      "inputDigest": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
      "mode": "straight_through",
      "planDigest": "string",
      "approvalId": "string",
      "planRunId": "string",
      "calls": [
        {
          "sequence": 1,
          "action": "refund",
          "kind": "read",
          "state": "intent",
          "invocationId": "string",
          "refusal": "string",
          "plannedSequence": 0
        }
      ],
      "outcome": "succeeded",
      "budget": "maxActionCalls",
      "finishedAt": "2019-08-24T14:15:22Z"
    },
    "durationMs": 0,
    "createdAt": "2019-08-24T14:15:22Z",
    "finishedAt": "2019-08-24T14:15:22Z"
  }
}