Working with Data & Files

Learn how to exchange data and files with browser automations in Kognitos.

Overview

Browser tasks in Kognitos can work with data from your automation, making your web automations both dynamic and flexible. You can pass information to browser tasks and retrieve results back to your automation, including downloaded files and extracted data.

Input Data

Pass data to your browser tasks by defining facts in your automation. Reference these facts in the Task Instructions of a Browser Automation widget using curly brackets {}.

You can pass data types like text, numbers, lists, and files. The browser agent automatically detects and uses these values during execution.

Example 1: Passing Text

In this example, we define the search term and the product name as facts with text values. These data elements are used to instruct the browser agent:

1

Define Data

the search term is "best wireless headphones 2025"
the product name is "Sony WH-1000XM5"
2

Provision a Browser

provision a browser
3

Perform Task and Reference Data

perform [the task] on the browser and get the visual log, the detailed plan, the result, and the browser run id

Replace [the task] with a widget by typing / in the editor and selecting Browser Automation. Reference the facts in the Task Instructions using curly brackets:

Task Name

Search for Product

Task Instructions

Go to www.google.com and search for {the search term}. Look through the results and find information about {the product name}. Return the average price found.

Information References Detected

the search term, the product name

The browser agent will use "best wireless headphones 2025" for the search term and "Sony WH-1000XM5" for the product name when it executes the task.

Example 2: Uploading a File

In this example, we upload an invoice file to a vendor portal by passing a file fact to the browser task.

1

Define Data

Define the invoice file as a fact:

the invoice file
2

Provision a Browser

provision a browser
3

Perform Task and Reference Data

perform [the task] on the browser

Replace [the task] with a widget by typing / in the editor and selecting Browser Automation. Reference the invoice file in the Task Instructions using curly brackets:

Task Name

Upload Invoice

Task Instructions

Go to https://vendor-portal.example.com, navigate to the upload section, and upload {the invoice file}.

Information References Detected

the invoice file


Output Data

Browser tasks can return information to your automation, including extracted data and downloaded files, allowing you to process web data and integrate it into your workflows.

Results

Extracted data is returned as the result, which can include information like prices, inventory status, account details, or any other data visible on a web page. To retrieve the result, explicitly request it when performing the browser task:

perform [the task] on the browser and get the result

Example: Extracting Product Information

1

Define Data

the product page is "https://example.com/product/headphones"
2

Provision a Browser

provision a browser
3

Perform Task and Extract Data

perform [the task] on the browser and get the result

Replace [the task] with a widget by typing / in the editor and selecting Browser Automation. Reference the facts in the Task Instructions using curly brackets:

Task Name

Get Product Details

Task Instructions

Go to {the product page} and extract the price and availability.

Output Format

{"Price": "", "Availability": ""}

Information References Detected

the product page

4

Use the Result

When the task completes, it returns structured data like this:

{
  "Price": "$499.99",
  "Availability": "In Stock"
}

You can access the complete result or individual fields:

# Returns the entire JSON object: {"Price": "$499.99", "Availability": "In Stock"}
get the result

# Returns the value of the 'Price' field: $499.99
get the result's Price

# Returns the value of the 'Availability' field: In Stock
get the result's Availability

Browser Files

When a browser task downloads one or more files during execution, they are automatically returned to your automation as the browser files. This allows you to use them in subsequent automation steps. You can use downloaded files for:

  • Document Processing: Extract data using Intelligent Document Processing

  • Email Attachments: Send emails with file attachments

  • Further Browser Tasks: Upload to another website

To retrieve the downloaded file(s), you must explicitly request them when performing the task:

perform [the task] on the browser and get the browser files

Example: Downloading and Processing Files

1

Provision Browser

provision a browser
2

Download Files from the Web

perform [the task] on the browser and get the visual log, the detailed plan, the result, the browser run id and the browser files

Replace [the task] with a Browser Automation widget by typing / and selecting Browser Automation:

Task Name

Download PDF

Task Instructions

Navigate to https://smallpdf.com/blog/sample-pdf and download the PDF file.

3

Use the Downloaded Files

After the task completes, access the downloaded file(s) in your automation:

the browser files

File Naming

When downloading PDFs from a PDF viewer, you can specify a custom filename in your task instructions:

Download the file from https://smallpdf.com/blog/sample-pdf with the filename "new_filename.pdf".

However, files downloaded directly from web applications will retain the name assigned by the web application.

Last updated

Was this helpful?