WorkflowRun

The `WorkflowRun` entity.

Definition

TypeScript
interface WorkflowRun {
  id: string;
  workspaceId: string;
  subjectId: string;
  parentRunId: string | null;
  status:
    | "pending"
    | "failed"
    | "running"
    | "completed"
    | "cancelled"
    | "timed_out"
    | "paused"
    | "waiting";
  mode: "sync" | "async";
  input: unknown;
  output: any;
  error: string | null;
  triggeredBy: "workflow" | "agent" | "swarm" | "user" | "event";
  cfWorkflowId: string | null;
  durationMs: number | null;
  userId: string;
  startedAt: string | null;
  completedAt: string | null;
  createdAt: string;
  updatedAt: string;
}

Fields

FieldTypeNotes
idstringreadonly required
workspaceIdstringrequired — Workspace this run belongs to.
subjectIdstringrequired — Prefixed ID of the entity being run.
parentRunIdstring | nullrequired — Parent run ID when this run was spawned from another.
status"pending" | "failed" | "running" | "completed" | "cancelled" | "timed_out" | "paused" | "waiting"required — Run lifecycle status.
mode"sync" | "async"required — Execution mode (sync, async/streaming, etc.).
inputunknownrequired — Input payload submitted to the run.
outputanyrequired — Final output produced by the run, if successful.
errorstring | nullrequired — Error message when the run failed, otherwise null.
triggeredBy"workflow" | "agent" | "swarm" | "user" | "event"required — Origin of the run (user, trigger, parent run, scheduled, etc.).
cfWorkflowIdstring | nullrequired — Cloudflare Workflow instance ID, when the run used workflows.
durationMsnumber | nullrequired — Total duration in milliseconds, once the run finishes.
userIdstringrequired — User on whose behalf the run executes.
startedAtstring | nullrequired — ISO-8601 timestamp when execution began.
completedAtstring | nullrequired — ISO-8601 timestamp when the run reached a terminal status.
createdAtstringreadonly required — ISO-8601 timestamp of creation.
updatedAtstringreadonly required — ISO-8601 timestamp of the last update.