Skip to main content
Extraction actions capture data from web pages during automation—essential for scraping, validation, and feeding dynamic values into subsequent actions.

Extraction Types

TypePurposeBest For
llmAI-powered structured data extractionTables, forms, text content
locatorExtract text directly via Playwright locatorSingle values, fast extraction, no LLM tokens
network_callCapture API/AJAX responsesAPI data, JSON responses
api_callCall an external REST API directlyWebhooks, triggering jobs, polling for async results
screenshotSave visual snapshotReceipts, proofs, visual records
stateCapture page state (URL, title, storage, cookies)Debugging auth, navigation validation
two_fa_actionWait for and extract 2FA code2FA codes

LLM Extraction

The most powerful extraction method. Uses AI to parse page content into structured data.

Properties

PropertyTypeDefaultDescription
sourcelist["axtree" | "screenshot"]["axtree"]Data sources to analyze
extraction_formatdictRequiredExpected output structure
extraction_instructionsstrRequiredWhat to extract
output_variable_nameslist[str]NoneStore values as variables
llm_model_namestr"gemini-2.5-flash"LLM model to use

Source Selection

SourceBest For
["axtree"]Text, tables, forms (default, fastest)
["screenshot"]Charts, images, visual layouts
["axtree", "screenshot"]Complex pages needing both

Extraction Format

Define output structure with type hints:
Only str and List[str] are supported types.

Storing as Variables

Use output_variable_names to make extracted values available for subsequent actions:
After this action, use {order_ids[0]}, {order_ids[index]}, or iterate with for_loop_node.

Writing Good Instructions

Good examples:
Poor examples:
Be specific about where data appears, what it looks like, and expected format.

Locator Extraction

Extract text from a specific element on the page using a Playwright locator — no LLM tokens consumed. If the locator fails, it can fall back to LLM extraction.

Properties

PropertyTypeDefaultDescription
commandstrRequiredPlaywright locator command to find the element
output_variable_namestrRequiredVariable name to store the extracted text
extraction_formatdictRequiredMust contain output_variable_name as a key
extraction_instructionsstr | NoneNoneLLM fallback instructions if the locator fails
llm_provider"gemini""gemini"LLM provider to use for fallback
llm_model_namestr"gemini-2.5-flash"LLM model for fallback
extraction_format must contain output_variable_name as a key, or validation will fail.

Fallback Behavior

If the locator fails to find the element or find text content, two outcomes are possible:
  • With extraction_instructions — falls back to LLM extraction automatically
  • Without extraction_instructions — variable is set to None

When to Use Locator vs LLM

SituationUse
Element has a stable, reliable locatorlocator (faster, no cost)
Page structure changes oftenllm
Single known value to extractlocator with LLM fallback
Multiple fields at oncellm
Always provide extraction_instructions as a fallback. This makes the extraction resilient if the page structure changes.

Network Call Extraction

Capture data from API requests and responses:

Properties

PropertyTypeDefaultDescription
url_patternstr | NoneNoneURL substring to match
extract_from"request" | "response"NoneExtract from request or response
download_from"request" | "response"NoneDownload as file
download_filenamestr | NoneAuto-generatedFilename for download
Use network_call to intercept requests the page already makes. Use api_call (below) to initiate your own HTTP request to any external endpoint.

API Call Extraction

Make an outbound REST API call directly from the automation—useful for hitting webhooks, triggering backend jobs, enriching data from a third-party service, or polling an async endpoint until it’s ready. The full response is stored as a variable for use in later actions.

Properties

PropertyTypeDefaultDescription
urlstrRequiredEndpoint to call
method"GET" | "POST" | "PUT" | "PATCH" | "DELETE""GET"HTTP method
headersdict[str, str]{}Request headers
bodydict | str | NoneNoneRequest body. A dict is sent as JSON; a str is sent as raw content
query_paramsdict[str, str]{}URL query parameters
output_variable_nameslist[str]["api_result"]Variable name(s) to store the response under
timeoutfloat30.0Request timeout in seconds
poll_conditionstr | NoneNoneExpression to re-poll until satisfied (see Polling)
poll_intervalfloat5.0Seconds to wait between poll attempts
max_poll_attemptsint10Maximum number of poll attempts

Response Shape

The stored variable holds a dict with the following keys:
KeyTypeDescription
status_codeint | nullHTTP status code (null on a connection error or timeout)
headersdict[str, str]Response headers
bodyanyParsed JSON if the response is JSON, otherwise the raw text
errorstrPresent only on failure—"timeout" or "http_error"

Using the Response

Reference fields of the response in later actions with dot-path syntax: {var.field}, {var.nested.field}, and {var.array[0].field}. Both object keys and array indices are supported.
After this action, {create_result.body.id} resolves to the new customer’s ID, and {create_result.status_code} resolves to 201.
Dot-path resolution ({var.field}) applies only to dict-valued variables such as API responses. The existing list-indexing format {var[0]} from llm extraction is unaffected.

Polling

For asynchronous endpoints, set poll_condition to keep re-requesting until the condition is met (or max_poll_attempts is reached). The condition is a Python-style boolean expression evaluated against the response dict, supporting both top-level keys and dot-paths:
Example conditions:
ConditionMeaning
status_code == 200Stop once the request returns HTTP 200
body.status == 'completed'Stop once the response body’s status field is "completed"
body.progress >= 100Stop once progress reaches 100
If the condition is never met within max_poll_attempts, the last response is stored and the automation continues.

Screenshot Extraction

Save a screenshot for later analysis:
PropertyTypeDefaultDescription
filenamestrRequiredOutput filename
full_pageboolTrueEntire page or viewport only

State Extraction

Capture page state, including URL/title plus browser storage and cookies:

Output

state extraction appends an OutputData.json_data object with the following shape:
KeyTypeDescription
page_urlstrCurrent page URL
page_titlestrCurrent page title
local_storagedict[str, str | null]All localStorage key/value pairs
session_storagedict[str, str | null]All sessionStorage key/value pairs
cookieslist[dict]Cookies from the current browser context
document_cookiestrdocument.cookie string for the current page

Two-Factor Authentication Extraction

Wait for and extract 2FA code:

Properties

PropertyTypeDefaultDescription
action"email_two_fa_action" | "slack_two_fa_action" | "sms_two_fa_action"RequiredThe type of 2FA action to use
output_variable_namestrRequiredThe name of the variable to store the 2FA code in
instructionsstrNoneOptional Custom instructions for code extraction
max_wait_timefloat300.0The maximum time to wait for the 2FA code
check_intervalfloat10.0The interval to check for the 2FA code

Action Types

Action TypeDescription
email_two_fa_actionWait for and extract 2FA code from email
slack_two_fa_actionWait for and extract 2FA code from Slack
sms_two_fa_actionWait for and extract 2FA code from SMS via Twilio
For more information on how to use the 2FA code in your automation, please refer to the Two-Factor Authentication Integration documentation.

Timing

Extraction actions have different timing defaults to allow pages to fully load:
PropertyDefault for Extractions
before_sleep_time3.0 seconds
end_sleep_time0.0 seconds
Override if needed:

When to Use Each Type

ScenarioRecommended
Extract text/tables from pagellm with axtree
Extract a single known elementlocator
Extract with locator + LLM fallbacklocator with extraction_instructions
Charts, images, visual contentllm with screenshot
Intercept API data the page requestsnetwork_call
Call an external API / webhook directlyapi_call
Poll an async endpoint until readyapi_call with poll_condition
Visual proof/documentationscreenshot
Validate navigationstate