create_task
Build persistent Figranium automation tasks with step-by-step browser actions, state variables, anti-bot stealth, and scheduling to eliminate manual web scraping and form-filling workflows.
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.MANDATORY AUTOMATIC TESTING: Unless the user explicitly prompts you NOT to test, you MUST immediately test and verify your newly created or updated tasks by calling the
task_executetool right after callingcreate_taskortask_update. Automatic testing is mandatory to ensure correctness.
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 realistic click on the element matching 'selector'.
'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.
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": {
"hn_stories": {
"type": "string",
"value": "[]"
}
},
"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. 'scrape' is fast and headless; 'agent' uses automated browser interaction; '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. Note: Variable reference 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 variables to store state and dynamic values. 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 | |
| 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 | Optional post-execution script to extract data. 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 | |
| statelessExecution | No | If set to true, clear browser cookies and session states between runs. Expected type: boolean. Example: false |