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
| Name | Type | Description |
|---|---|---|
workflow_id | string | The id of the library fragment to run in the browser extension |
client_id | string | The extension client to run against, a hint the host may honour; empty leaves the choice of browser to the host |
variables | map[string]any | Per-run values injected into the fragment, overriding the extension's stored defaults |
timeout_ms | int | How long to wait for the browser run before failing (default 10 minutes) |
Outputs
| Name | Type | Description |
|---|---|---|
ok | bool | Whether the fragment finished without error |
stored | map[string]any | The values the fragment's store steps captured, keyed by store name |
steps | []StepResult | The per-step results of the fragment run |
↳ step_id | string | Is the id of the step this result belongs to. |
↳ type | string | Echoes the step's action type. |
↳ ok | bool | Reports whether the step succeeded. Skipped steps are always ok. |
↳ skipped | bool | Is true when the step's condition was not met, so it neither ran nor failed. |
↳ format | string | Names the shape Data is in. |
↳ data | any | Is the step's extracted output, if any. |
↳ truncated | bool | Says 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. |
↳ file | CapturedFile | Carries 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. |
↳ filename | string | Is the file's name, after any step-level rename. |
↳ mime | string | Is the file's content type. |
↳ size | int | Is the byte length of Data. |
↳ data | []byte | Is 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. |
↳ error | string | Describes the failure when OK is false. |
↳ started_at | int64 | Is when the step began, in Unix milliseconds. |
↳ finished_at | int64 | Is 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 }}"