DocsWorkflowsComponentsMachinemachine:extension:run

machine:extension:run

Runs one library fragment in the connected browser extension and blocks until its result comes back. One invocation is one workflow: the fragment is referenced by id (never inlined), so the extension only ever executes what its library author fixed, parameterized by variables. Under the hood the run travels as a single-ref sequence, the reference-only shape the trust boundary calls for.

Options

NameTypeDescription
workflow_idstringThe id of the library fragment to run in the browser extension
client_idstringThe extension client to run against, a hint the host may honour; empty leaves the choice of browser to the host
variablesmap[string]anyPer-run values injected into the fragment, overriding the extension's stored defaults
timeout_msintHow long to wait for the browser run before failing (default 10 minutes)

Outputs

NameTypeDescription
okboolWhether the fragment finished without error
storedmap[string]anyThe values the fragment's store steps captured, keyed by store name
steps[]StepResultThe per-step results of the fragment run
  ↳ step_idstringIs the id of the step this result belongs to.
  ↳ typestringEchoes the step's action type.
  ↳ okboolReports whether the step succeeded. Skipped steps are always ok.
  ↳ skippedboolIs true when the step's condition was not met, so it neither ran nor failed.
  ↳ formatstringNames the shape Data is in.
  ↳ dataanyIs the step's extracted output, if any.
  ↳ truncatedboolSays the step's own cap clipped its output, which is how a structured list read reports that the page held more items than it returned.
  ↳ fileCapturedFileCarries the bytes a capture step took. The extension lifts it onto a dedicated file message before the result is streamed, so it is normally nil by the time a result reaches this side.
    ↳ filenamestringIs the file's name, after any step-level rename.
    ↳ mimestringIs the file's content type.
    ↳ sizeintIs the byte length of Data.
    ↳ data[]byteIs the raw file content. It rides the JSON wire as base64, which encoding/json applies to a byte slice automatically, so neither side of the contract ever names the encoding.
  ↳ errorstringDescribes the failure when OK is false.
  ↳ started_atint64Is when the step began, in Unix milliseconds.
  ↳ finished_atint64Is when the step ended, in Unix milliseconds.

Examples

name: Log into the bank in the browser
actions:
  - name: login
    component: machine:extension:run
    vars:
      workflow_id: swedbank-01-login
      variables:
        user_id: "{{ var.user_id }}"
        phone: "{{ var.phone }}"

outputs:
  session: "{{ login.stored }}"

Chained

Chains browser fragments as pipeline steps. Each machine:extension:run invocation is one library fragment; a fragment's stored values flow to the next step through the pipeline's own variable resolution, so the pipeline owns the control flow between browser runs.

name: Fetch a bank statement fragment by fragment
actions:
  - name: login
    component: machine:extension:run
    vars:
      workflow_id: swedbank-01-login
      variables:
        user_id: "{{ var.user_id }}"
  - name: statement
    component: machine:extension:run
    vars:
      workflow_id: swedbank-03-open-statement
      variables:
        date_from: "{{ var.date_from }}"
        date_to: "{{ var.date_to }}"

outputs:
  files: "{{ statement.stored }}"