Task
A Task is a single automation job executed by an AI agent in a browser environment. Tasks contain your instructions for what the AI should accomplish.
What is a Task?
Examples:
- “Log into Gmail and count unread emails”
- “Search for top 10 Hacker News posts and return titles and URLs”
- “Extract product prices from an e-commerce site”
Key Properties
Required
task: Your instruction to the AI agent (1-50,000 characters)llm: AI model (default:"gemini-flash-latest")
Session & Environment
sessionId: Session where task runs (optional - auto-created with US proxy if not provided)startUrl: URL to navigate to before starting the taskmaxSteps: Maximum steps before stopping (default: 30, max: 10,000)
Agent Behavior
flashMode: Enable faster execution mode (default: false)thinking: Enable extended thinking for complex tasks (default: false)vision: Enable vision capabilities (default: true, can betrue,false, or"auto")highlightElements: Highlight interactive elements (default: false)systemPromptExtension: Custom system prompt addition (max 2,000 chars)
Secrets & Security
secrets: Key-value pairs for sensitive data (injected securely)allowedDomains: Restrict navigation to specific domainsopVaultId: 1Password vault ID for credential injection
Skills
skillIds: List of skill IDs to enable, or["*"]for all available skills
Judge (Task Evaluation)
judge: Enable AI judge to evaluate task success (default: false)judgeGroundTruth: Expected outcome for judge comparison (max 10,000 chars)judgeLlm: LLM model for judge evaluation
Output
structuredOutput: JSON schema string for structured response formatmetadata: Custom key-value pairs (up to 10 pairs)
Response Fields
status:created,started,finished, orstoppedoutput: Final result from the agentinputFiles/outputFiles: Files for input/outputisSuccess: Agent’s self-reported success statusjudgement: Judge evaluation result (if judge enabled)judgeVerdict: Boolean verdict from judge
Execution Models
Important: Proxy configuration is a session-level setting, not a task-level setting.
When you create a task without specifying a sessionId, an auto-session is created with US proxy by default. To use a different proxy location, you must:
- Create a session first with your desired
proxyCountryCode - Then create tasks within that session using
sessionId
See Stealth & Proxies for examples.
Auto-Session (Simple)
Best for: Simple tasks, no login required, proof of concepts
Auto-sessions use default settings: US proxy, standard browser dimensions. You cannot customize these settings per-task. For custom proxy locations or browser settings, create a session first.
Custom Session (Advanced)
Use custom sessions when you need to configure proxy location, browser dimensions, or run multiple related tasks.
Best for: Multi-step workflows, login required, related tasks, custom proxy locations, custom browser dimensions
Task Control
Files
Best Practices
Task Instructions:
- Be specific: “Extract product names and prices from first page” vs “get product info”
- Set boundaries: Specify pages to visit, items to process
- Include context: Mention login requirements, data format
Performance:
- Use auto-session for simple tasks
- Reuse sessions for related tasks