create_task
Build complete browser automation workflows with sequential actions, state variables, anti-bot stealth, and optional scheduling for recurring data extraction and web testing.
Instructions
Create a complete, fully-configured Figranium automation task including sequential action steps, state variables, anti-bot stealth mechanisms, and optional scheduling.
!!! IMPORTANT GUIDELINES FOR LLM AGENTS !!!
VARIABLE TEMPLATING SYNTAX: You MUST use
{$variable_name}(with a single curly brace and dollar sign, e.g.{$myVar}) for variable references/templating inside action values, URLs, headers, or body fields. NEVER use double curly braces like{{variable_name}}or JavaScript-style templates like${variable_name}, as these syntaxes are unsupported and will cause execution failures.TASK VALIDATION: Newly created or updated tasks are ordinarily intended to be validated against a real execution result so configuration, selectors, and extracted output can be checked.
MODE SELECTION: Use
agentmode by default, including for scraping tasks.scrapemode does not support action blocks and should be used only when extremely fast, action-free scraping is required. Useheadfulfor visible interactive debugging.
1. Purpose
Use this tool when you need to automate any recurring or complex web-based workflows, including data extraction (scraping), automated form-filling, dashboard testing, or dynamic visual monitoring. Tasks are stored permanently in Figranium and can be executed ad-hoc, triggered via API, or scheduled.
2. Execution Model
Figranium tasks run as a linear sequence of steps defined in the 'actions' array. Actions are processed in order from top to bottom. Control flow steps (such as 'if', 'while', 'repeat') allow loops and branching, while 'on_error' steps define fallback behaviors. Variables represent the state and can be updated dynamically during execution. Ensure all opened block structures (such as 'if', 'while', 'repeat', 'foreach') are closed with an 'end' action step.
3. Comprehensive Step Types
'navigate': Redirect browser to a new URL specified in the 'value' field.
'wait': Pause execution for N seconds specified in the 'value' field.
'wait_selector': Pause until the DOM element matching 'selector' is rendered.
'click': Simulate a single, double, or right click on the element matching 'selector'; set 'clickType' to 'double' or 'right' when needed.
'check' / 'uncheck': Idempotently set the checked state of a checkbox or radio control matching 'selector'.
'drag_and_drop': Drag from 'selector' to the required 'targetSelector'.
'reload': Reload the current page and wait for DOM content to load.
'select': Choose an option from a native select using 'selector' and its option 'value'.
'type': Type the 'value' into the 'selector' input element. Use 'typeMode' to clear/replace or append.
'hover': Move mouse pointer to the element matching 'selector'.
'press': Press a specific keyboard key (e.g., 'Enter') specified in the 'key' field.
'scroll': Scroll the page or target element to a specific coordinate or direction.
'javascript': Execute custom JavaScript on the page. Stored in 'value', outputs can be saved to 'varName'.
'screenshot': Capture and save a screenshot.
'http_request': Perform direct API requests.
'if', 'else', 'end': Conditional blocks based on variables.
'while', 'repeat', 'foreach': Looping blocks.
'stop': Halt task execution.
'set': Set or update a task variable.
'solve_captcha': Attempt to automatically solve a detected CAPTCHA challenge.
'wait_captcha': Pause until a CAPTCHA challenge is initialized/ready without solving it.
'upload': Attach the newest unuploaded file, ZIP, or folder from a Cabinet (see 'cabinetId') to a file input, chooser, or drop target matching 'selector'.
'finalize_uploads': Mark all Cabinet items attached during the execution as uploaded.
4. Selector Strategy & Fallbacks
When targeting elements, follow this hierarchy of selectors:
Unique IDs (e.g., '#submit-button')
ARIA roles and labels (e.g., '[aria-label="Search"]')
Reliable CSS classes or data attributes (e.g., '.btn-primary', '[data-testid="login"]')
Text matchers or XPath as a final resort. Fallback: If an element might be missing or slow to load, wrap the interaction inside an 'if' block evaluating a variable or use 'on_error' to catch failure.
5. Edge Cases & Retry Logic
Timeouts: Wait-selectors have a default timeout. Ensure critical steps use 'wait_selector' first to avoid clicking non-existent elements.
Stealth: Turning on options like 'naturalTyping', 'cursorGlide', and 'allowTypos' simulates authentic human speed and rhythm to prevent anti-bot blocking on protected sites.
Statelessness: Enable 'statelessExecution' to ensure execution is completely fresh without persistent browser storage/cookies.
6. Complex Real-World Multi-Step JSON Example:
{
"name": "HackerNews Custom Scraper",
"url": "https://news.ycombinator.com",
"mode": "agent",
"wait": 3,
"rotateUserAgents": true,
"stealth": {
"allowTypos": true,
"cursorGlide": true,
"naturalTyping": true
},
"actions": [
{
"type": "wait_selector",
"selector": ".hnname"
},
{
"type": "click",
"selector": "a.hnmore"
},
{
"type": "wait",
"value": "2"
},
{
"type": "javascript",
"value": "return Array.from(document.querySelectorAll('.athing')).map(tr => ({ id: tr.id, title: tr.querySelector('.titleline > a')?.innerText, href: tr.querySelector('.titleline > a')?.href }));",
"varName": "hn_stories"
},
{
"type": "navigate",
"value": "https://httpbin.org/post"
},
{
"type": "wait_selector",
"selector": "pre"
},
{
"type": "javascript",
"value": "console.log('Finished scraping and navigated successfully.');"
}
],
"variables": {},
"extractionFormat": "json"
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Initial URL to navigate to when the task starts. Expected type: string. Example: 'https://news.ycombinator.com' | |
| mode | Yes | Execution mode. Use 'agent' by default, including for scraping, because it supports action blocks. 'scrape' does not support action blocks and is only for exceptional, extremely fast action-free scraping. 'headful' runs in a visible browser window with human oversight. Expected type: string enum. Example: 'agent' | |
| name | Yes | Descriptive name of the automation task. Expected type: string. Example: 'HackerNews Scraper' | |
| wait | No | Standard delay in seconds to wait after navigation and page loads to let dynamic scripts complete. Expected type: number. Example: 5 | |
| actions | No | Sequential list of browser actions/control flow steps to execute. Action blocks require 'agent' or 'headful' mode and are not supported in 'scrape' mode. Note: Variable references MUST use '{$variable_name}' syntax. | |
| stealth | No | Configures realistic stealth, anti-bot, and human behavior simulation on the browser instance. | |
| schedule | No | Task automatic execution schedule. Expected type: object. | |
| selector | No | Default CSS selector to wait for on the page load before starting actions. Expected type: string. Example: '.main-content' | |
| variables | No | Task INPUT variables and caller-overridable configuration only. Do not declare output-only fields or transient runtime state here. Use Set Variable for mid-task state. Expected type: record object of variable configurations. | |
| description | No | Detailed description of what the task automates. Expected type: string. Example: 'Logs in and extracts weekly leads' | |
| humanTyping | No | Vary typing speeds and insert tiny delays to simulate organic human typing. Expected type: boolean. Example: true | |
| includeHtml | No | Whether to include the raw page HTML in the execution response. Expected type: boolean. Example: false | |
| translation | No | Optional page translation for Agent and headful runs. It is disabled by default and is not available in Scrape mode. | |
| rotateProxies | No | Rotate through configured proxy IPs to prevent IP-based rate limiting. Expected type: boolean. Example: false | |
| rotateViewport | No | Vary viewport resolutions randomly to simulate multiple desktop and mobile devices. Expected type: boolean. Example: true | |
| disableRecording | No | Disable video/VNC recording of this task to save storage. Expected type: boolean. Example: true | |
| extractionFormat | No | Target export format of any extracted data. Expected type: string enum. Example: 'json' | json |
| extractionScript | No | Post-execution extraction script for the task's actual final output. Final structured fields, lists, tables, parsing, and extraction logic belong here rather than in task variables or JavaScript action blocks. Expected type: string. Example: 'return Array.from(document.querySelectorAll("a")).map(el => el.href)' | |
| includeShadowDom | No | Whether to parse and resolve target elements residing in Shadow DOMs. Expected type: boolean. Example: true | |
| rotateUserAgents | No | Rotate user agents across requests to avoid pattern blocking and fingerprinting. Expected type: boolean. Example: true | |
| downloadCabinetId | No | Cabinet used for intercepted downloads; omitted uses the default Cabinet. Expected type: string. Example: 'cab_basic' | |
| statelessExecution | No | If set to true, clear browser cookies and session states between runs. Expected type: boolean. Example: false |