Skip to main content

Prerequisites

  • A Kadoa account with API key
  • SDK installed: npm install @kadoa/node-sdk or uv add kadoa-sdk
  • An existing workflow (create one first)

Scheduling Options

Configure when your workflow runs:
const workflow = await client
  .extract({
    urls: ["https://sandbox.kadoa.com/ecommerce/pagination"],
    name: "Scheduled Extraction",
    extraction: (builder) =>
      builder
        .entity("Product")
        .field("title", "Product name", "STRING", { example: "Sample" }),
  })
  .setInterval({
    schedules: ["0 9 * * MON-FRI", "0 18 * * MON-FRI"],
  })
  .create();

// Workflow runs automatically on schedule
console.log("Scheduled workflow:", workflow.workflowId);

Available Intervals

IntervalDescription
ONLY_ONCERun once
EVERY_10_MINUTESEvery 10 minutes
HALF_HOURLYEvery 30 minutes
HOURLYEvery hour
THREE_HOURLYEvery 3 hours
SIX_HOURLYEvery 6 hours
TWELVE_HOURLYEvery 12 hours
DAILYOnce per day
WEEKLYOnce per week
MONTHLYOnce per month
REAL_TIMEContinuous monitoring (Self-service: 10 workflows max)
CUSTOMUse cron expressions

Manual Execution

Run workflows on demand:
const workflow = await client.workflow.get(workflowId);
console.log(`Current workflow state: ${workflow.displayState}`);

const result = await client.workflow.runWorkflow(workflowId, {
  limit: 10,
});
console.log(`Workflow scheduled with runId: ${result.jobId}`);

Checking Workflow Status

Poll the workflow status to know when extraction is complete:
const extraction = await client
  .extract({
    urls: ["https://sandbox.kadoa.com/ecommerce/pagination"],
    name: "Paginated Extraction",
    navigationMode: "paginated-page",
    extraction: (builder) =>
      builder
        .entity("Product")
        .field("title", "Product name", "STRING", {
          example: "Sennheiser HD 6XX",
        })
        .field("price", "Product price", "MONEY"),
  })
  .create();

const result = await extraction.run({ limit: 10 });

// Fetch a single page with pagination info
const page = await result.fetchData({ page: 1, limit: 5 });
console.log("Page data:", page.data);
console.log("Pagination:", page.pagination);

// Or get all data at once
const allData = await result.fetchAllData({});
console.log("All data:", allData);
Workflow States:
  • IN_PROGRESS - Extraction is running
  • COMPLETED - Data is ready to retrieve
  • FAILED - Extraction failed (check errors field)

Proxy Locations

Specify geographic location for extraction:
const workflow = await client
  .extract({
    urls: ["https://sandbox.kadoa.com/magic"],
    name: "Geo-located Extraction",
    extraction: (builder) =>
      builder
        .entity("Product")
        .field("title", "Title", "STRING", { example: "example" }),
  })
  .setLocation({
    type: "manual",
    isoCode: "US",
  })
  .create();
Available locations:
  • US - United States
  • GB - United Kingdom
  • DE - Germany
  • NL - Netherlands
  • CA - Canada
  • auto - Automatic selection

Bypass Preview Mode

Skip manual review and activate workflows immediately:
const workflow = await client
  .extract({
    urls: ["https://sandbox.kadoa.com/magic"],
    name: "Direct Activation",
    extraction: (builder) =>
      builder
        .entity("Product")
        .field("title", "Title", "STRING", { example: "example" }),
  })
  .bypassPreview() // Skip review step
  .create();

// Workflow is immediately active

Next Steps