Skip to main content
This guide walks you through creating a simple login automation from scratch. By the end, you’ll understand how to define actions, use parameters, and run your first Optexity workflow.
What you’ll learn: - How to record browser interactions with the Optexity Recorder - How to understand and edit automation JSON/Python - How to use parameters for dynamic values - How to run your automation via the API

Prerequisites

Before you begin, ensure you have:
  1. ✅ Completed the Installation guide
  2. ✅ Optexity running in your local environment
  3. ✅ Your API key from the dashboard

Install the Recorder Extension

Install the Optexity Recorder extension from the Chrome Web Store. This extension captures your browser interactions and converts them into automation workflows.
1

Install the extension

Click “Add to Chrome” on the Chrome Web Store page
2

Pin the extension

Click the puzzle icon in Chrome and pin Optexity Recorder for easy access
3

Add your API key

Click the extension icon and enter your API key from the dashboard

What We’re Building

Let’s create an automation that logs into a website. This simple example demonstrates the core concepts you’ll use in every Optexity workflow:

Step 1: Record the Automation

The fastest way to create an automation is by recording your actions directly in the browser.
1

Navigate to the target website

Open Chrome and go to the website you want to automate (e.g., https://example.com)
2

Start capturing

Click the Optexity Recorder extension icon and hit Start Capture
3

Perform your actions

Interact with the website naturally, click buttons, fill in forms, navigate pages. The recorder captures every interaction.
4

Stop and save

When finished, click Complete Capture. The automation is automatically saved to your dashboard as a JSON file.
Recording Tips: - Perform actions slowly and deliberately for better accuracy - Avoid unnecessary scrolling or hovering - The recorder captures clicks, text input, and form selections

Step 2: Understand the Automation Structure

Once recorded, your automation is saved as JSON on the dashboard. Let’s break down the structure using a login example.

The Complete Automation

Here is a sample automation:
Here’s what a login automation looks like in Python:

Breaking Down Each Component

The Automation object is the top-level container that holds your entire workflow:
Parameters define the data flowing through your automation. They’re divided into two types:Input Parameters — Values you provide before execution:
Generated Parameters — Values extracted during execution:
Values are stored as lists of strings. Access them using {variable_name[index]} syntax, where index is typically 0 for single values.
Each ActionNode represents a single atomic action. An ActionNode contains exactly one of these action types: | Action Type | Purpose | Example | |-------------|---------|---------| | interaction_action | Click, type, select, scroll, navigate | Clicking a button | | extraction_action | Extract data from the page | Scraping product prices | | assertion_action | Verify conditions | Check if logged in | | python_script_action | Run custom Python code | Data transformation | | fetch_2fa_action | Handle two-factor authentication | Get OTP from email | python ActionNode( interaction_action=InteractionAction( click_element=ClickElementAction( command="""get_by_role("button", name="Submit")""", prompt_instructions="Click the submit button", ) ), before_sleep_time=0.0, # Wait before action end_sleep_time=1.0, # Wait after action )
Optexity uses Playwright locators to find elements on the page. The command field accepts Playwright’s powerful locator syntax:
The prompt_instructions field provides a natural language fallback. If the locator fails, Optexity’s AI uses this description to find the element visually.

Step 3: Edit and Customize

After recording, you may want to customize your automation. Common edits include:

Parameterizing Values

Replace hardcoded values with parameters for flexibility:

Adding Descriptive Instructions

Improve the prompt_instructions for better AI fallback:

Adjusting Timing

Control execution speed with timing properties:

Step 4: Run Your Automation

Once your automation is defined, execute it through the inference API.

Using cURL

Understanding the Request

Expected Response

A successful run returns:

Common Patterns

Here are some patterns you’ll use frequently:

Clicking Elements

Filling Form Fields

Selecting Dropdowns

Handling New Tabs


Troubleshooting

Problem: The automation fails to find an element. Solutions: 1. Improve prompt_instructions with more visual details 2. Try a different locator strategy (role → label → text → CSS) 3. Add before_sleep_time to wait for the element to appear 4. Check if the element is inside an iframe
Problem: The page hasn’t loaded before the next action runs. Solution: Increase end_sleep_time on the previous action: python ActionNode( interaction_action=InteractionAction(...), end_sleep_time=3.0, # Wait 3 seconds after action )
Problem: You see {username[0]} instead of the actual value. Solutions: 1. Ensure the variable is defined in input_parameters 2. Check the index is correct (starts at 0) 3. Verify the syntax: {variable_name[index]}

Next Steps

Now that you’ve built your first automation, explore these topics to level up:

Core Concepts

Deep dive into the automation model, nodes, and execution flow

Locators

Master element location strategies for reliable automations

Interaction Actions

Explore all available interaction types: clicks, inputs, navigation

Extraction Actions

Learn to capture data from web pages into your workflow