Skip to main content
Figranium tasks are executed as ordered lists of actions. The Swift SDK exports typed static builders on the Actions enum that generate correctly shaped Action values with stable IDs, plus an action() helper for one-offs.

Import

Every helper returns an Action struct. Helpers assign a unique id if you do not pass one, so lists remain stable across saves.

Action types

Navigation and interaction

Navigate, click, type, press keys, wait, hover, and capture screenshots.

Extraction

Read content, run JavaScript, parse CSV, and make HTTP requests.

Control flow

Conditionals, loops, branches, repeats, and sub-task starts.

Variables and CAPTCHA

Set and merge variables, plus CAPTCHA solving actions.

Files and Cabinets

Upload the newest unuploaded Cabinet item and finalize attached items after success.

Extraction

request accepts method, headers, body, and varName. method defaults to GET when omitted by the server.

Control flow

Condition fields for if and while accept:
  • selector: a CSS selector to test
  • value: a free-form expression, when supported
  • variable: a variable name to test
  • variableType: "string", "number", or "boolean"
  • operation: the comparison operator
  • comparisonValue: the comparison target
Supported operation values include:
  • Strings: equals, not_equals, contains, starts_with, ends_with, matches
  • Numbers: equals, not_equals, gt, gte, lt, lte
  • Booleans: is_true, is_false
  • Selectors: exists, not_exists

Variables and CAPTCHA

captchaType is one of "recaptcha_v2", "recaptcha_v3", "hcaptcha", or "turnstile". See CAPTCHA Solving for setup and return-value shape. The exported variable(name) helper produces the {$name} template token Figranium expects when a value should be substituted from a runtime variable:
See Variables and templates for more.

Files and Cabinets

The SDK includes helpers for the Cabinet upload flow. When cabinetId is omitted on an upload action, Figranium uses the task’s cabinetId; if the task also omits it, the instance default Cabinet is used. Keeping finalization separate is useful when an upload should only be consumed after the surrounding workflow reaches a successful point.
See Cabinets resource for full Cabinet operations.

Typed one-off actions

For actions the helpers do not cover, construct an Action directly:
Actions.action(_ value: Action) assigns an ID if you do not provide one and preserves all valid fields.

Full task example

Variables and templates

Declare task variables and reference them with variable().

Tasks resource

Save, version, and execute tasks that use these actions.