Busabase
OpenAPI 参考

Workflows

See, start, cancel, and decide runs of a Workflow node. A run acts as the key's owner, capped by the key.

GET
/api/v1/workflows/{nodeId}/runs

Path Parameters

nodeId*string
Length1 <= length

Query Parameters

limit?integer

How many runs to return. Default 20, at most 50.

Range1 <= value <= 50
cursor?string

nextCursor from the previous page.

Length1 <= length
runId?string

Answer for this one run instead of a page, with what the caller may do to it.

Length1 <= length

Response Body

application/json

curl -X GET "https://example.com/api/v1/workflows/string/runs"
{  "runs": [    {      "id": "string",      "spaceId": "string",      "workflowNodeId": "string",      "status": "queued",      "trigger": "manual",      "startedBy": "string",      "startedVia": null,      "cancelledBy": null,      "cursorNodeId": "string",      "previousNodeId": "string",      "outputs": {        "property1": {          "kind": "string",          "capturedAt": "string",          "sequence": 0,          "record": {            "recordId": "string",            "baseId": "string",            "headCommitId": "string",            "fields": {              "property1": null,              "property2": null            }          },          "data": {            "property1": null,            "property2": null          }        },        "property2": {          "kind": "string",          "capturedAt": "string",          "sequence": 0,          "record": {            "recordId": "string",            "baseId": "string",            "headCommitId": "string",            "fields": {              "property1": null,              "property2": null            }          },          "data": {            "property1": null,            "property2": null          }        }      },      "recordId": "string",      "payload": {        "property1": null,        "property2": null      },      "pause": {        "kind": "wait",        "nodeId": "string",        "resumeAt": "string"      },      "error": "string",      "freshness": "snapshot-steps-plus-explicit-reread",      "startedAt": "string",      "updatedAt": "string"    }  ],  "canRun": true,  "decidableRunIds": [    "string"  ],  "nextCursor": "string",  "queuedCount": 0,  "actorNames": {    "property1": "string",    "property2": "string"  }}
POST
/api/v1/workflows/{nodeId}/runs

Path Parameters

nodeId*string
Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/workflows/string/runs" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "spaceId": "string",  "workflowNodeId": "string",  "status": "queued",  "trigger": "manual",  "startedBy": "string",  "startedVia": null,  "cancelledBy": null,  "cursorNodeId": "string",  "previousNodeId": "string",  "outputs": {    "property1": {      "kind": "string",      "capturedAt": "string",      "sequence": 0,      "record": {        "recordId": "string",        "baseId": "string",        "headCommitId": "string",        "fields": {          "property1": null,          "property2": null        }      },      "data": {        "property1": null,        "property2": null      }    },    "property2": {      "kind": "string",      "capturedAt": "string",      "sequence": 0,      "record": {        "recordId": "string",        "baseId": "string",        "headCommitId": "string",        "fields": {          "property1": null,          "property2": null        }      },      "data": {        "property1": null,        "property2": null      }    }  },  "recordId": "string",  "payload": {    "property1": null,    "property2": null  },  "pause": {    "kind": "wait",    "nodeId": "string",    "resumeAt": "string"  },  "error": "string",  "freshness": "snapshot-steps-plus-explicit-reread",  "startedAt": "string",  "updatedAt": "string"}
GET
/api/v1/workflow-runs/{runId}

Path Parameters

runId*string
Length1 <= length

Response Body

application/json

curl -X GET "https://example.com/api/v1/workflow-runs/string"
{  "id": "string",  "spaceId": "string",  "workflowNodeId": "string",  "status": "queued",  "trigger": "manual",  "startedBy": "string",  "startedVia": null,  "cancelledBy": null,  "cursorNodeId": "string",  "previousNodeId": "string",  "outputs": {    "property1": {      "kind": "string",      "capturedAt": "string",      "sequence": 0,      "record": {        "recordId": "string",        "baseId": "string",        "headCommitId": "string",        "fields": {          "property1": null,          "property2": null        }      },      "data": {        "property1": null,        "property2": null      }    },    "property2": {      "kind": "string",      "capturedAt": "string",      "sequence": 0,      "record": {        "recordId": "string",        "baseId": "string",        "headCommitId": "string",        "fields": {          "property1": null,          "property2": null        }      },      "data": {        "property1": null,        "property2": null      }    }  },  "recordId": "string",  "payload": {    "property1": null,    "property2": null  },  "pause": {    "kind": "wait",    "nodeId": "string",    "resumeAt": "string"  },  "error": "string",  "freshness": "snapshot-steps-plus-explicit-reread",  "startedAt": "string",  "updatedAt": "string"}
POST
/api/v1/workflow-runs/{runId}/decide

Path Parameters

runId*string
Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/workflow-runs/string/decide" \  -H "Content-Type: application/json" \  -d '{    "decision": "approved"  }'
{  "id": "string",  "spaceId": "string",  "workflowNodeId": "string",  "status": "queued",  "trigger": "manual",  "startedBy": "string",  "startedVia": null,  "cancelledBy": null,  "cursorNodeId": "string",  "previousNodeId": "string",  "outputs": {    "property1": {      "kind": "string",      "capturedAt": "string",      "sequence": 0,      "record": {        "recordId": "string",        "baseId": "string",        "headCommitId": "string",        "fields": {          "property1": null,          "property2": null        }      },      "data": {        "property1": null,        "property2": null      }    },    "property2": {      "kind": "string",      "capturedAt": "string",      "sequence": 0,      "record": {        "recordId": "string",        "baseId": "string",        "headCommitId": "string",        "fields": {          "property1": null,          "property2": null        }      },      "data": {        "property1": null,        "property2": null      }    }  },  "recordId": "string",  "payload": {    "property1": null,    "property2": null  },  "pause": {    "kind": "wait",    "nodeId": "string",    "resumeAt": "string"  },  "error": "string",  "freshness": "snapshot-steps-plus-explicit-reread",  "startedAt": "string",  "updatedAt": "string"}
POST
/api/v1/workflow-runs/{runId}/cancel

Path Parameters

runId*string
Length1 <= length

Response Body

application/json

curl -X POST "https://example.com/api/v1/workflow-runs/string/cancel"
{  "id": "string",  "spaceId": "string",  "workflowNodeId": "string",  "status": "queued",  "trigger": "manual",  "startedBy": "string",  "startedVia": null,  "cancelledBy": null,  "cursorNodeId": "string",  "previousNodeId": "string",  "outputs": {    "property1": {      "kind": "string",      "capturedAt": "string",      "sequence": 0,      "record": {        "recordId": "string",        "baseId": "string",        "headCommitId": "string",        "fields": {          "property1": null,          "property2": null        }      },      "data": {        "property1": null,        "property2": null      }    },    "property2": {      "kind": "string",      "capturedAt": "string",      "sequence": 0,      "record": {        "recordId": "string",        "baseId": "string",        "headCommitId": "string",        "fields": {          "property1": null,          "property2": null        }      },      "data": {        "property1": null,        "property2": null      }    }  },  "recordId": "string",  "payload": {    "property1": null,    "property2": null  },  "pause": {    "kind": "wait",    "nodeId": "string",    "resumeAt": "string"  },  "error": "string",  "freshness": "snapshot-steps-plus-explicit-reread",  "startedAt": "string",  "updatedAt": "string"}