Execution API
ExecutionClient monitors and controls workflow executions — list, get, stop, retry, and manage tags.
This client is for run history and operational control, not workflow definition changes. Pair it with WorkflowClient when you need both deployment and runtime visibility.
Access
const execution = client.executions();
Methods
Common Tasks
- inspect recent failures
- fetch a single execution with payload data included
- stop running executions in bulk
- retry failed executions after updating the related workflow
list(params?)
List executions with optional filters.
const { data, nextCursor } = await client.executions().list({
limit: 25,
status: 'error',
workflowId: 'wf-123',
projectId: 'proj-1',
includeData: true,
redactExecutionData: false,
});
get(id, params?)
Get an execution by ID.
const execution = await client.executions().get(123, {
includeData: true,
redactExecutionData: false,
});
delete(id)
Delete an execution.
const deleted = await client.executions().delete(123);
retry(id, data?)
Retry a failed execution.
const retried = await client.executions().retry(123, {
loadWorkflow: true,
});
stop(id)
Stop a running execution.
const stopped = await client.executions().stop(123);
stopMany(data)
Stop multiple executions matching filters.
const { stopped } = await client.executions().stopMany({
status: ['running', 'queued', 'waiting'],
workflowId: 'wf-123',
startedAfter: '2024-01-01T00:00:00Z',
startedBefore: '2024-01-02T00:00:00Z',
});
getTags(id) / updateTags(id, tags)
Get or update tags on an execution.
const tags = await client.executions().getTags(123);
const updatedTags = await client.executions().updateTags(123, [
{ id: 'tag-1' },
]);
ExecutionResource
Use getResource() or listResources() to get a bound ExecutionResource instance.
const resource = await client.executions().getResource(123, {
includeData: true,
redactExecutionData: false,
});
listResources() preserves the includeData and redactExecutionData params you pass in, so each returned ExecutionResource will re-fetch with the same shape when you call refresh().
Properties
| Property | Type | Description |
|---|---|---|
id | number | Execution ID |
status | string | Execution status (e.g. success, error, running) |
Methods
| Method | Returns | Description |
|---|---|---|
refresh() | this | Re-fetch execution from the API (preserves original includeData/redactExecutionData) |
delete() | Execution | Delete the execution |
retry(data?) | this | Retry the execution |
stop() | this | Stop a running execution |
getTags() | Tag[] | List tags on the execution |
updateTags(tags) | Tag[] | Replace tags on the execution |
Snapshot management
refresh(), retry(), and stop() call replaceSnapshot() under the hood.
Typical Flow
const execution = client.executions();
const { data: failed } = await execution.list({ status: 'error', limit: 20 });
for (const run of failed) {
await execution.retry(run.id, { loadWorkflow: true });
}
Typical Flow with Resource
const runs = await client.executions().listResources({ status: 'error', limit: 20 });
for (const run of runs.data) {
await run.retry({ loadWorkflow: true });
await run.refresh();
console.log(run.data.status);
}