Class: ExecutionsResource#

Defined in: sdk-js/src/v4/resources/executions.ts:47

client.executions.* — read-only access to past workflow runs and a live SSE stream for in-flight ones. Workflow executions are created by the operator when a trigger fires (or by workflows.trigger for manual runs); this resource never creates them, only reads.

Constructors#

Constructor#

new ExecutionsResource(transport: Transport): ExecutionsResource;

Defined in: sdk-js/src/v4/resources/executions.ts:48

Parameters#

ParameterType
transportTransport

Returns#

ExecutionsResource

Methods#

list()#

list(params: ListExecutionsParams): Promise<{
  data: readonly object[];
  pageInfo: {
     hasNextPage: boolean;
     hasPreviousPage: boolean;
     startCursor?: string;
     endCursor?: string;
  };
}>;

Defined in: sdk-js/src/v4/resources/executions.ts:51

GET /executions

Parameters#

ParameterType
paramsListExecutionsParams

Returns#

Promise<{ data: readonly object[]; pageInfo: { hasNextPage: boolean; hasPreviousPage: boolean; startCursor?: string; endCursor?: string; }; }>


listForWorkflow()#

listForWorkflow(workflowId: string, params?: object): Promise<{
  data: readonly object[];
  pageInfo: {
     hasNextPage: boolean;
     hasPreviousPage: boolean;
     startCursor?: string;
     endCursor?: string;
  };
}>;

Defined in: sdk-js/src/v4/resources/executions.ts:59

GET /workflows//executions — convenience nested form.

Parameters#

ParameterType
workflowIdstring
params?{ before?: string; after?: string; limit?: number; }
params.before?string
params.after?string
params.limit?number

Returns#

Promise<{ data: readonly object[]; pageInfo: { hasNextPage: boolean; hasPreviousPage: boolean; startCursor?: string; endCursor?: string; }; }>


retrieve()#

retrieve(id: string, params: RetrieveExecutionParams): Promise<{
  id: string;
  workflowId: string;
  chainId?: number;
  index?: number;
  startAt: number;
  endAt?: number;
  status: "error" | "failed" | "pending" | "success";
  error?: string;
  steps?: readonly object[];
  executionFee?: {
     amount: string;
     unit: "USD" | "WEI" | "PERCENTAGE";
  };
  cogs?: readonly object[];
  valueFee?: {
     fee: {
        amount: string;
        unit: "USD" | "WEI" | "PERCENTAGE";
     };
     tier: "unspecified" | "tier1" | "tier2" | "tier3";
     valueBase?: string;
     classificationMethod?: "ruleBased" | "llm";
     confidence?: number;
     reason?: string;
  };
}>;

Defined in: sdk-js/src/v4/resources/executions.ts:70

GET /executions/?workflowId=...

Parameters#

ParameterType
idstring
paramsRetrieveExecutionParams

Returns#

Promise<{ id: string; workflowId: string; chainId?: number; index?: number; startAt: number; endAt?: number; status: "error" | "failed" | "pending" | "success"; error?: string; steps?: readonly object[]; executionFee?: { amount: string; unit: "USD" | "WEI" | "PERCENTAGE"; }; cogs?: readonly object[]; valueFee?: { fee: { amount: string; unit: "USD" | "WEI" | "PERCENTAGE"; }; tier: "unspecified" | "tier1" | "tier2" | "tier3"; valueBase?: string; classificationMethod?: "ruleBased" | "llm"; confidence?: number; reason?: string; }; }>


getStatus()#

getStatus(id: string, params: RetrieveExecutionParams): Promise<{
  id: string;
  workflowId?: string;
  status: "error" | "failed" | "pending" | "success";
  startAt?: number;
  endAt?: number;
  error?: string;
}>;

Defined in: sdk-js/src/v4/resources/executions.ts:78

GET /executions/:getStatus?workflowId=...

Parameters#

ParameterType
idstring
paramsRetrieveExecutionParams

Returns#

Promise<{ id: string; workflowId?: string; status: "error" | "failed" | "pending" | "success"; startAt?: number; endAt?: number; error?: string; }>


count()#

count(params?: CountExecutionsParams): Promise<{
  total: number;
}>;

Defined in: sdk-js/src/v4/resources/executions.ts:86

GET /executions:count

Parameters#

ParameterType
params?CountExecutionsParams

Returns#

Promise<{ total: number; }>


stats()#

stats(params?: ExecutionStatsParams): Promise<{
  total: number;
  succeeded: number;
  failed: number;
  pending?: number;
  avgExecutionTime?: number;
}>;

Defined in: sdk-js/src/v4/resources/executions.ts:94

GET /executions:stats

Parameters#

ParameterType
params?ExecutionStatsParams

Returns#

Promise<{ total: number; succeeded: number; failed: number; pending?: number; avgExecutionTime?: number; }>


stream()#

stream(id: string, params: StreamExecutionParams): AsyncGenerator<{
  id: string;
  workflowId?: string;
  status: "error" | "failed" | "pending" | "success";
  startAt?: number;
  endAt?: number;
  error?: string;
}, void, undefined>;

Defined in: sdk-js/src/v4/resources/executions.ts:108

GET /executions/:stream — yields one ExecutionStatusSummary per status change. The stream closes on terminal status, when signal aborts, or when the connection drops. Implementation uses fetch streaming + a minimal SSE parser so it works in Node 20+ and browsers without an external EventSource polyfill.

Parameters#

ParameterType
idstring
paramsStreamExecutionParams

Returns#

AsyncGenerator<{ id: string; workflowId?: string; status: "error" | "failed" | "pending" | "success"; startAt?: number; endAt?: number; error?: string; }, void, undefined>


waitForTerminal()#

waitForTerminal(id: string, params: StreamExecutionParams): Promise<{
  id: string;
  workflowId?: string;
  status: "error" | "failed" | "pending" | "success";
  startAt?: number;
  endAt?: number;
  error?: string;
}>;

Defined in: sdk-js/src/v4/resources/executions.ts:156

Poll-and-wait helper — yields the final ExecutionStatusSummary once the execution reaches a terminal status. Use stream() when you want every intermediate status update.

Parameters#

ParameterType
idstring
paramsStreamExecutionParams

Returns#

Promise<{ id: string; workflowId?: string; status: "error" | "failed" | "pending" | "success"; startAt?: number; endAt?: number; error?: string; }>