Workflow run schema
See Management API schema for every domain, the endpoint and authentication.
Queries
workflowRun
Reads a workflow run.
Scope: ORGANIZATION_WORKSPACE_READ.
workflowRun(id: ID!): WorkflowRun @authMutations
workflowRunRerun
Reruns a workflow run that has ended as a new run of the whole workflow, on the version chosen.
Every step runs again, so leads are created and outbound requests are sent again, and an
action_response answers nobody. The caller must also hold every scope the workflow of the
chosen version acts with, except those any author grants, as Workflow.scopesToHold lists.
Scope: ORGANIZATION_WORKSPACE_UPDATE.
workflowRunRerun(input: WorkflowRunRerunInput!): WorkflowRunRerunPayload! @authTypes
WorkflowRunStatus
"""The state of a workflow run."""
enum WorkflowRunStatus {
"""Started and not yet ended."""
RUNNING
"""Ended with every task succeeded."""
COMPLETED
"""Stopped at a failed task."""
FAILED
}WorkflowTaskType
"""The kind of node a workflow task ran."""
enum WorkflowTaskType {
"""The trigger node the run started from."""
ORIGIN
"""A tool node."""
TOOL
"""A condition node, which chose a branch."""
CONDITION
"""A sleep node, which paused the run."""
SLEEP
}WorkflowTaskStatus
"""The state of a workflow task."""
enum WorkflowTaskStatus {
"""Started and not yet ended."""
RUNNING
"""Ended with its work done."""
SUCCEEDED
"""Failed, which stopped the run."""
FAILED
}WorkflowRunSortKeys
"""
The orders `Workflow.runs` can sort by. A cursor is valid only for the `sortKey` and `reverse` it
came from.
"""
enum WorkflowRunSortKeys {
"""By `startedAt`."""
STARTED_AT
}WorkflowTaskSortKeys
"""
The orders `WorkflowRun.tasks` can sort by. A cursor is valid only for the `sortKey` and
`reverse` it came from.
"""
enum WorkflowTaskSortKeys {
"""By `startedAt`, which is the order the run ran its tasks in."""
STARTED_AT
}WorkflowRun
"""
One execution of a workflow, started by an event. A run executes the published workflow, or the
draft for a preview run.
"""
type WorkflowRun {
"""The ID of the run."""
id: ID!
"""The ID of the workflow, which stays after the workflow is deleted."""
workflowId: ID!
"""
The ID of the workspace of the workflow. A workflow ID is unique only within its workspace.
"""
workspaceId: ID!
"""
The workflow. Null when the workflow was deleted.
Scope: `ORGANIZATION_WORKSPACE_READ`.
"""
workflow: Workflow
"""The state of the run."""
status: WorkflowRunStatus!
"""When the run started."""
startedAt: DateTime!
"""When the run ended. Null while it runs."""
finishedAt: DateTime
"""
Why the run failed, naming a node, a tool or an argument but never data a tool read. Null unless
`status` is `FAILED`.
"""
failureReason: String
"""
Whether the run executes the draft: a visitor started it in a preview, or it reruns a preview
run. A preview run executes the draft as it stood when the run started, and its writes are real.
"""
preview: Boolean!
"""
Whether the run is a rerun of an earlier run. `rerunRoot` is the run its chain started from.
"""
rerun: Boolean!
"""
The tasks of the run, one per visit of a node, in the order the run reached them.
Scope: `ORGANIZATION_WORKSPACE_READ`.
"""
tasks(first: Int, after: String, sortKey: WorkflowTaskSortKeys = STARTED_AT, reverse: Boolean = false): WorkflowTaskConnection! @auth
"""
The live labels on the run, ordered by namespace, then key. `labelsSet` with `ownerType:
WORKFLOW_RUN` writes them.
Scope: `ORGANIZATION_WORKSPACE_READ`.
"""
labels: [Label!]! @auth
"""
The run the chain of a rerun started from. Null when the run is not a rerun.
Scope: `ORGANIZATION_WORKSPACE_READ`.
"""
rerunRoot: WorkflowRun @auth
"""
The reruns of the run, latest first. A rerun of a rerun is listed under the run its chain
started from, so the list is empty on a rerun.
Scope: `ORGANIZATION_WORKSPACE_READ`.
"""
reruns(first: Int, after: String, last: Int, before: String, reverse: Boolean = true): WorkflowRunConnection! @auth
"""
The version the action submission that started the run was recorded on, which `ORIGINAL` reruns.
Null when another event or a preview started the run, or once the submission is deleted.
Scope: `ORGANIZATION_WORKSPACE_READ`.
"""
workspaceVersion: WorkspaceVersion @auth
}WorkflowRunRerunVersion
"""
The version a rerun runs on: `DRAFT` for a preview run, `ORIGINAL` or `LIVE` for any other run.
"""
enum WorkflowRunRerunVersion {
"""
The version the action submission of the run was recorded on, `WorkflowRun.workspaceVersion`.
"""
ORIGINAL
"""The live version of the project."""
LIVE
"""
The workflow of the run as the draft of its workspace now holds it, for a preview run.
"""
DRAFT
}WorkflowRunRerunInput
"""The input of `workflowRunRerun`."""
input WorkflowRunRerunInput {
"""The ID of the run."""
id: ID!
"""The version the rerun runs on."""
version: WorkflowRunRerunVersion!
}WorkflowRunRerunPayload
"""The result of `workflowRunRerun`."""
type WorkflowRunRerunPayload {
"""The rerun. Null when `userErrors` is not empty."""
workflowRun: WorkflowRun
"""
The reasons the run cannot be rerun, with codes `RUN_NOT_RERUNNABLE` (the run is running, or no
action submission that still exists started it), `VERSION_UNAVAILABLE` (the chosen version
cannot run it) or `RERUN_IN_PROGRESS` (a rerun of the same chain is running).
"""
userErrors: [UserError!]!
}WorkflowTask
"""
One visit of a workflow run to a node, and its outcome. Only a tool task has `operations`.
"""
type WorkflowTask {
"""The ID of the task, the same across every attempt of one visit."""
id: ID!
"""
The ID of the node the task ran, as the `nodes` of the workflow name it.
"""
stepId: ID!
"""
The number of the visit to the node, from 1. A run that enters a node again records a new task.
"""
visit: Int!
"""The kind of node the task ran."""
type: WorkflowTaskType!
"""The tool the task ran. Null when the task is not a `TOOL` task."""
tool: String
"""The state of the task."""
status: WorkflowTaskStatus!
"""When the task started."""
startedAt: DateTime!
"""When the task ended. Null while it runs."""
finishedAt: DateTime
"""Why the task failed. Null unless `status` is `FAILED`."""
failureReason: String
"""
When the sleep ends and the run resumes, at or shortly after this time. Null unless the
task is a `SLEEP` task that is `RUNNING`.
"""
wakesAt: DateTime
"""The run of the task."""
run: WorkflowRun!
"""
The creates, updates and deletes the task made to leads and labels, newest first.
Scope: `ORGANIZATION_WORKSPACE_READ`.
"""
operations(first: Int, after: String, sortKey: OperationSortKeys = OCCURRED_AT, reverse: Boolean = true): OperationConnection! @auth
}WorkflowRunConnection
"""A page of workflow runs."""
type WorkflowRunConnection {
"""The edges in this page."""
edges: [WorkflowRunEdge!]!
"""The runs in this page."""
nodes: [WorkflowRun!]!
"""Where this page sits in the list."""
pageInfo: PageInfo!
"""The total number of runs."""
totalCount: Int!
}WorkflowRunEdge
"""A workflow run in a page of results."""
type WorkflowRunEdge {
"""The cursor of this edge."""
cursor: String!
"""The run."""
node: WorkflowRun!
}WorkflowTaskConnection
"""A page of workflow tasks."""
type WorkflowTaskConnection {
"""The edges in this page."""
edges: [WorkflowTaskEdge!]!
"""The tasks in this page."""
nodes: [WorkflowTask!]!
"""Where this page sits in the list."""
pageInfo: PageInfo!
"""The total number of tasks in the run."""
totalCount: Int!
}WorkflowTaskEdge
"""A workflow task in a page of results."""
type WorkflowTaskEdge {
"""The cursor of this edge."""
cursor: String!
"""The task."""
node: WorkflowTask!
}Workflow (extension)
extend type Workflow {
"""
The runs of the workflow, oldest first.
Scope: `ORGANIZATION_WORKSPACE_READ`.
"""
runs(first: Int, after: String, last: Int, before: String, sortKey: WorkflowRunSortKeys = STARTED_AT, reverse: Boolean = false): WorkflowRunConnection! @auth
}WorkflowRunProgress
"""One message of a subscription to a workflow run's progress."""
type WorkflowRunProgress {
"""The run's status."""
status: WorkflowRunStatus!
"""When the run started."""
startedAt: DateTime!
"""When the run finished. Null while it is `RUNNING`."""
finishedAt: DateTime
"""Why the run failed. Null unless `status` is `FAILED`."""
failureReason: String
"""
In the first message, the tasks from the one the subscription's `from` names, or every task
when it is null. In each later message, the tasks whose `status` changed, in the order the run reached them.
A task that starts and ends between two of the server's reads arrives once, ended.
"""
tasks: [WorkflowTask!]!
"""
The cursor of the run's latest task, which a new subscription's `from` takes.
"""
cursor: String!
"""
Why the subscription ends, set on its last message only. Null on every other message.
"""
end: WorkflowRunProgressEnd
}WorkflowRunProgressEnd
"""
Why a subscription to a run's progress ended, and when to subscribe again.
"""
type WorkflowRunProgressEnd {
"""Why the subscription ended."""
reason: WorkflowRunProgressEndReason!
"""
How long to wait, in milliseconds, before subscribing again. 0 for `TIME_LIMIT`, and the time
until the first sleep wakes for `SLEEPING`. Null for `FINISHED`, which needs no new subscription.
"""
resubscribeInMs: Int
}WorkflowRunProgressEndReason
"""The reasons a subscription to a run's progress ends."""
enum WorkflowRunProgressEndReason {
"""The run completed or failed."""
FINISHED
"""The subscription reached the server's time limit for one stream."""
TIME_LIMIT
"""
Every running task is a sleep that wakes after the server's time limit for one stream.
"""
SLEEPING
}Subscription (extension)
extend type Subscription {
"""
Pushes a workflow run's progress: its state, its tasks from the one `from` names, then each
change. The last message's `end` says why the stream ended and when to subscribe again, and a
run that has already finished sends only that message. Served only at `/api/graphql/stream`.
Scope: `ORGANIZATION_WORKSPACE_READ`.
"""
workflowRunProgress(
id: ID!
"""
The cursor of the task the first message starts from: a `WorkflowRunProgress` message's
`cursor`, or the cursor of the last task the client holds from `WorkflowRun.tasks` read with
`reverse: false`. Null sends every task.
"""
from: String
): WorkflowRunProgress! @auth
}