Skip to main content

List Workflows

const workflows = await client.workflow.list({ limit: 100 });

for (const workflow of workflows) {
  console.log(`${workflow.id}: ${workflow.name}`);
}

Get Workflow

const workflow = await client.workflow.get({
  workflowId: 'YOUR_WORKFLOW_ID'
});

Pause & Resume

// Pause
await client.workflow.pause({ workflowId: 'YOUR_WORKFLOW_ID' });

// Resume
await client.workflow.resume({ workflowId: 'YOUR_WORKFLOW_ID' });

Update

await client.workflow.update({
  workflowId: 'YOUR_WORKFLOW_ID',
  name: 'New Name',
  interval: 'DAILY',
});

Delete

This permanently deletes the workflow and all its data.
await client.workflow.delete({ workflowId: 'YOUR_WORKFLOW_ID' });

Templates

Workflows can be linked to templates that manage their prompt, schema, and notification settings. When linked, those fields become read-only on the workflow. See Templates for linking, unlinking, and applying template updates via the API.

Fetch Data

const workflows = await client.workflow.list({ limit: 100 });

for (const workflow of workflows) {
  const data = await client.extraction.fetchAllData({
    workflowId: workflow.id,
  });
  console.log(`${workflow.name}: ${data.length} records`);
}