DSL Reference
Complete reference for reArray's task automation language: structure, selectors, actions, conditions, and flow control.
reArray tasks are written in a domain-specific language (DSL) executed by agents against real browser sessions. This page is the canonical syntax reference.
Required structure
- Exactly one
flow { ... }block per script - Platforms are preconfigured on the agent β do not declare platforms in DSL
- Use configured platform handlers directly:
in login { ... }
Variable namespaces
| Prefix | Source |
|---|---|
$params.* | Execution inputs (UI form or API) |
$settings.* | Agent settings |
$store.* | Values extracted during the run |
$secrets.* | Platform vault credentials (only inside in handler { }) |
Syntax essentials
- Selector blocks always use braces:
{ css "#id" } extractsyntax:extract { css ".price" } as price- Assignment uses
=:let name = "John" - Comparison uses
==:if $params.mode == "fast" { ... } callarguments use=:call checkout(step = "payment")- Negation must wrap a condition:
not (exists { css ".error" }) - Comments use
//
Selectors
| Form | Example |
|---|---|
| CSS | { css "#submit" } |
| XPath | { xpath "//button[@type='submit']" } |
| Text | { text "Continue" } |
| Role | { role "button" } |
| Role + name | { role "button" "Continue" } |
| Fallback chain | { css "#submit" xpath "//button[@type='submit']" } |
| Frame scope | { frame "f0" css "#card-number" } |
Actions
click {selector}
fill {selector} value
select {selector} value
wait condition
wait condition timeout 30000
extract {selector} as variableName
extract {selector} as variableName timeout 5000
extract {selector} as variableName default value
extract {selector} as variableName timeout 5000 default "fallback"
assert condition
upload {selector} filePathOrValue
download {selector}
solve_captcha
extract waits for a non-empty value by default. Use timeout and default to control wait behavior and fallbacks.
Conditions
visible {selector}
exists {selector}
element_contains {selector} "text"
element_contains {selector} "text" exact true
element_contains {selector} "text" exact false
$params.name == "value"
not (condition)
element_contains is case-insensitive by default. Text can be any value, including $params.lastName.
Flow control
if condition { ... }
if condition { ... } else { ... }
for item in $params.items { ... }
while condition { ... }
while condition max 25 { ... }
break
terminate
terminate value
let variable = value
call blockName(arg = value)
in platformHandler { ... }
terminateends execution early;terminate valuesets the final resultwhile max Nlimits iterations (integer 1β100)breakonly works insidewhileloops- Reusable blocks: define with
block name { ... }and call withcall name(arg = value)
Platform blocks
Wrap site-specific steps in in handler { ... }:
flow {
in login_portal {
fill { css "#email" } $secrets.username
click { css "#submit" }
}
in crm {
extract { css ".account-name" } as accountName
}
}
$secrets.* is only valid inside the matching platform block.
Minimal valid template
flow {
in portal {
wait visible { css "#login-form" }
fill { css "#username" } $secrets.username
fill { css "#password" } $secrets.password
click { css "button[type='submit']" }
wait visible { css "#dashboard" } timeout 30000
extract { css "#welcome-message" } as welcomeMessage
}
}
Common mistakes
| Mistake | Fix |
|---|---|
Missing flow block | Wrap all statements in flow { ... } |
= in if instead of == | Use == for comparisons |
: in call args | Use = β call block(arg = value) |
| Missing selector braces | { css "#id" } not css "#id" |
| Unknown platform handler | Handler must match a platform attached to the agent |
$secrets outside in block | Move secrets usage inside in handler { } |
Missing with on decide/infer | Both require a with context clause |
break outside while | Only valid inside while loops |
Invalid while max | Must be integer 1β100 when provided |
Session-aware authentication
See Credentials for the recommended login pattern that handles both fresh and persisted sessions.