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

PrefixSource
$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" }
  • extract syntax: extract { css ".price" } as price
  • Assignment uses =: let name = "John"
  • Comparison uses ==: if $params.mode == "fast" { ... }
  • call arguments use =: call checkout(step = "payment")
  • Negation must wrap a condition: not (exists { css ".error" })
  • Comments use //

Selectors

FormExample
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 { ... }
  • terminate ends execution early; terminate value sets the final result
  • while max N limits iterations (integer 1–100)
  • break only works inside while loops
  • Reusable blocks: define with block name { ... } and call with call 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

MistakeFix
Missing flow blockWrap all statements in flow { ... }
= in if instead of ==Use == for comparisons
: in call argsUse = β€” call block(arg = value)
Missing selector braces{ css "#id" } not css "#id"
Unknown platform handlerHandler must match a platform attached to the agent
$secrets outside in blockMove secrets usage inside in handler { }
Missing with on decide/inferBoth require a with context clause
break outside whileOnly valid inside while loops
Invalid while maxMust be integer 1–100 when provided

Session-aware authentication

See Credentials for the recommended login pattern that handles both fresh and persisted sessions.