Skip to main content
This template demonstrates how to search for products and extract information from search results pages. The workflow searches for women’s shampoo, identifies the cheapest option, and extracts key product details. Here, we will walk through how to build this workflow.

Build the workflow

For this workflow, we’ll use agentic calls to search for a product and extract information directly, without creating separate agents first. This approach is useful for search and extraction tasks where you need to navigate and gather information from a website.
// Create workflow session
const workflow = await client.createWorkflowSession({
  name: 'product-search-and-extract',
  url: 'https://www.amazon.com'
});

console.log('Livestream URL:', workflow.livestreamUrl);

// Search for the product
await workflow.agentic("Search for women's shampoo");

// Find the cheapest option in the results
await workflow.agentic("Find the cheapest one in the results");

// Extract product information
await workflow.agentic("Extract the cost, product name, and product information");

// Close the workflow session
await workflow.close();

Key concepts

This workflow demonstrates:
  • Direct agentic calls: Using workflow.agentic() without pre-configured agents for flexible, one-off tasks
  • Sequential information gathering: Breaking down complex tasks into simple, focused steps
  • Data extraction: Pulling specific information from web pages programmatically
The agentic calls will automatically determine which tools are needed (clicking, scrolling, reading text) to accomplish each task.