Defined in: sdk-js/src/v4/resources/workflows.ts:41
client.workflows.* — the primary surface for creating and
controlling automations. A "workflow" is one trigger + a DAG of
nodes that fires when the trigger condition matches. This resource
covers the full lifecycle: create, list, retrieve, pause / resume,
cancel, manual trigger, dry-run simulation, and fee estimation.
Executions produced by these workflows are read via
ExecutionsResource.
new WorkflowsResource(transport: Transport): WorkflowsResource;
Defined in: sdk-js/src/v4/resources/workflows.ts:42
| Parameter | Type |
|---|---|
transport | Transport |
WorkflowsResource
create(req: object): Promise<{
id: string;
name?: string;
owner: string;
smartWalletAddress: string;
chainId?: number;
trigger: object &
| object & object
| object & object
| object & object
| object & object
| object & object;
nodes: readonly object &
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object[];
edges?: readonly object[];
inputVariables?: {
[key: string]: unknown;
};
status: "failed" | "completed" | "running" | "disabled" | "enabled";
startAt?: number;
expiredAt?: number;
maxExecution?: number;
executionCount?: number;
createdAt?: number;
completedAt?: number;
}>;
Defined in: sdk-js/src/v4/resources/workflows.ts:45
POST /workflows
| Parameter | Type | Description |
|---|---|---|
req | { name?: string; smartWalletAddress: string; chainId?: number; trigger: object & | object & object | object & object | object & object | object & object | object & object; nodes: readonly object & | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object[]; edges?: readonly object[]; inputVariables?: { [key: string]: unknown; }; startAt?: number; expiredAt?: number; maxExecution?: number; } | - |
req.name? | string | - |
req.smartWalletAddress | string | - |
req.chainId? | number | Description Default chain. Triggers and nodes may override. |
req.trigger | object & | object & object | object & object | object & object | object & object | object & object | - |
req.nodes | readonly object & | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object[] | - |
req.edges? | readonly object[] | - |
req.inputVariables? | { [key: string]: unknown; } | - |
req.startAt? | number | Format: int64 |
req.expiredAt? | number | Format: int64 |
req.maxExecution? | number | Format: int64 |
Promise<{
id: string;
name?: string;
owner: string;
smartWalletAddress: string;
chainId?: number;
trigger: object &
| object & object
| object & object
| object & object
| object & object
| object & object;
nodes: readonly object &
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object[];
edges?: readonly object[];
inputVariables?: {
[key: string]: unknown;
};
status: "failed" | "completed" | "running" | "disabled" | "enabled";
startAt?: number;
expiredAt?: number;
maxExecution?: number;
executionCount?: number;
createdAt?: number;
completedAt?: number;
}>
list(params?: ListWorkflowsParams): Promise<{
data: readonly object[];
pageInfo: {
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor?: string;
endCursor?: string;
};
}>;
Defined in: sdk-js/src/v4/resources/workflows.ts:54
GET /workflows
| Parameter | Type |
|---|---|
params? | ListWorkflowsParams |
Promise<{
data: readonly object[];
pageInfo: {
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor?: string;
endCursor?: string;
};
}>
retrieve(id: string): Promise<{
id: string;
name?: string;
owner: string;
smartWalletAddress: string;
chainId?: number;
trigger: object &
| object & object
| object & object
| object & object
| object & object
| object & object;
nodes: readonly object &
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object[];
edges?: readonly object[];
inputVariables?: {
[key: string]: unknown;
};
status: "failed" | "completed" | "running" | "disabled" | "enabled";
startAt?: number;
expiredAt?: number;
maxExecution?: number;
executionCount?: number;
createdAt?: number;
completedAt?: number;
}>;
Defined in: sdk-js/src/v4/resources/workflows.ts:62
GET /workflows/
| Parameter | Type |
|---|---|
id | string |
Promise<{
id: string;
name?: string;
owner: string;
smartWalletAddress: string;
chainId?: number;
trigger: object &
| object & object
| object & object
| object & object
| object & object
| object & object;
nodes: readonly object &
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object[];
edges?: readonly object[];
inputVariables?: {
[key: string]: unknown;
};
status: "failed" | "completed" | "running" | "disabled" | "enabled";
startAt?: number;
expiredAt?: number;
maxExecution?: number;
executionCount?: number;
createdAt?: number;
completedAt?: number;
}>
cancel(id: string): Promise<void>;
Defined in: sdk-js/src/v4/resources/workflows.ts:72
DELETE /workflows/ — cancel is the public verb in v4 (Stripe convention) even though the engine removes the record.
| Parameter | Type |
|---|---|
id | string |
Promise<void>
pause(id: string): Promise<{
id: string;
name?: string;
owner: string;
smartWalletAddress: string;
chainId?: number;
trigger: object &
| object & object
| object & object
| object & object
| object & object
| object & object;
nodes: readonly object &
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object[];
edges?: readonly object[];
inputVariables?: {
[key: string]: unknown;
};
status: "failed" | "completed" | "running" | "disabled" | "enabled";
startAt?: number;
expiredAt?: number;
maxExecution?: number;
executionCount?: number;
createdAt?: number;
completedAt?: number;
}>;
Defined in: sdk-js/src/v4/resources/workflows.ts:80
POST /workflows/:pause
| Parameter | Type |
|---|---|
id | string |
Promise<{
id: string;
name?: string;
owner: string;
smartWalletAddress: string;
chainId?: number;
trigger: object &
| object & object
| object & object
| object & object
| object & object
| object & object;
nodes: readonly object &
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object[];
edges?: readonly object[];
inputVariables?: {
[key: string]: unknown;
};
status: "failed" | "completed" | "running" | "disabled" | "enabled";
startAt?: number;
expiredAt?: number;
maxExecution?: number;
executionCount?: number;
createdAt?: number;
completedAt?: number;
}>
resume(id: string): Promise<{
id: string;
name?: string;
owner: string;
smartWalletAddress: string;
chainId?: number;
trigger: object &
| object & object
| object & object
| object & object
| object & object
| object & object;
nodes: readonly object &
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object[];
edges?: readonly object[];
inputVariables?: {
[key: string]: unknown;
};
status: "failed" | "completed" | "running" | "disabled" | "enabled";
startAt?: number;
expiredAt?: number;
maxExecution?: number;
executionCount?: number;
createdAt?: number;
completedAt?: number;
}>;
Defined in: sdk-js/src/v4/resources/workflows.ts:88
POST /workflows/:resume
| Parameter | Type |
|---|---|
id | string |
Promise<{
id: string;
name?: string;
owner: string;
smartWalletAddress: string;
chainId?: number;
trigger: object &
| object & object
| object & object
| object & object
| object & object
| object & object;
nodes: readonly object &
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object
| object & object[];
edges?: readonly object[];
inputVariables?: {
[key: string]: unknown;
};
status: "failed" | "completed" | "running" | "disabled" | "enabled";
startAt?: number;
expiredAt?: number;
maxExecution?: number;
executionCount?: number;
createdAt?: number;
completedAt?: number;
}>
trigger(id: string, req: object): Promise<{
executionId: string;
status: "error" | "failed" | "pending" | "success";
startAt?: number;
endAt?: number;
error?: string;
}>;
Defined in: sdk-js/src/v4/resources/workflows.ts:96
POST /workflows/:trigger
| Parameter | Type | Description |
|---|---|---|
id | string | - |
req | { triggerType: "block" | "manual" | "event" | "fixedTime" | "cron"; triggerOutput?: { [key: string]: unknown; }; triggerInput?: { [key: string]: unknown; }; isBlocking?: boolean; } | - |
req.triggerType | "block" | "manual" | "event" | "fixedTime" | "cron" | - |
req.triggerOutput? | { [key: string]: unknown; } | Description Type-specific output payload (BlockTrigger.Output, EventTrigger.Output, etc.) that simulates what the operator would have observed. Defined alongside execution schemas. |
req.triggerInput? | { [key: string]: unknown; } | - |
req.isBlocking? | boolean | Description When true, wait for the execution to complete and return its result. |
Promise<{
executionId: string;
status: "error" | "failed" | "pending" | "success";
startAt?: number;
endAt?: number;
error?: string;
}>
simulate(req: object): 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/workflows.ts:105
POST /workflows:simulate — runs without persisting.
| Parameter | Type |
|---|---|
req | { chainId?: number; trigger: object & | object & object | object & object | object & object | object & object | object & object; nodes: readonly object & | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object[]; edges?: readonly object[]; inputVariables: { [key: string]: unknown; }; } |
req.chainId? | number |
req.trigger | object & | object & object | object & object | object & object | object & object | object & object |
req.nodes | readonly object & | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object[] |
req.edges? | readonly object[] |
req.inputVariables | { [key: string]: unknown; } |
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;
};
}>
estimateFees(req: object): Promise<{
chainId: number;
nativeToken?: {
symbol: string;
decimals: number;
};
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;
};
discounts?: readonly object[];
pricingModel?: string;
}>;
Defined in: sdk-js/src/v4/resources/workflows.ts:114
POST /workflows:estimateFees
| Parameter | Type | Description |
|---|---|---|
req | { chainId?: number; trigger: object & | object & object | object & object | object & object | object & object | object & object; nodes: readonly object & | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object[]; edges?: readonly object[]; runner?: string; createdAt: number; expireAt: number; maxExecution: number; inputVariables?: { [key: string]: unknown; }; } | - |
req.chainId? | number | - |
req.trigger | object & | object & object | object & object | object & object | object & object | object & object | - |
req.nodes | readonly object & | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object | object & object[] | - |
req.edges? | readonly object[] | - |
req.runner? | string | Description Smart wallet address used for gas estimation (overrides settings.runner). |
req.createdAt | number | Format: int64 |
req.expireAt | number | Format: int64 |
req.maxExecution | number | Format: int64 |
req.inputVariables? | { [key: string]: unknown; } | - |
Promise<{
chainId: number;
nativeToken?: {
symbol: string;
decimals: number;
};
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;
};
discounts?: readonly object[];
pricingModel?: string;
}>
count(params?: CountWorkflowsParams): Promise<{
total: number;
}>;
Defined in: sdk-js/src/v4/resources/workflows.ts:123
GET /workflows:count
| Parameter | Type |
|---|---|
params? | CountWorkflowsParams |
Promise<{
total: number;
}>