Working with Data & Files
Learn how to exchange data and files with browser automations in Kognitos.
New to browser automation? Get up and running with our Getting Started guide.
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:
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 idReplace [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.
Perform Task and Reference Data
perform [the task] on the browserReplace [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 resultSpecify the Output Format in the Browser Automation widget to define the structure of the data you want returned. This ensures predictable results that are easy to work with.
Example: Extracting Product Information
Perform Task and Extract Data
perform [the task] on the browser and get the resultReplace [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
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 AvailabilityBrowser 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 filesAlways use the browser files (plural), instead of the browser file (singular), regardless of how many files are downloaded.
Example: Downloading and Processing Files
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 filesReplace [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.
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?
