machine:extension:prompt
Renders one turn of the authoring loop as a prompt. It exists so a workflow document can run the loop step by step and still ask the model the same question the one-shot machine:extension:author component asks. Nothing about it touches the browser, so a run can render a turn and read it without a bridge.
Options
| Name | Type | Description |
|---|---|---|
goal | string | What the authored workflow should accomplish, in plain language |
observation | string | The current page rendered as text, which is what machine:extension:observe returns |
last_observation | string | The page as it was on the previous turn, so a turn that changed nothing visible is named as one instead of being repeated |
last_result | string | What the previous turn's step returned, which is how the model reads prose an observation does not carry |
steps | []Step | The steps the session has accepted so far, in order |
↳ id | string | Uniquely names the step within its workflow, echoed on its StepResult. |
↳ type | string | Is the action to perform (click, fill, select, captureUrl, ...). |
↳ label | string | Is a human-readable description shown in run progress UIs. |
↳ selector | Selector | Picks the DOM node(s) the step acts on. |
↳ css | string | Is a CSS selector. |
↳ path | string | Is an explicit DOM path, used when CSS cannot express the target. |
↳ indexes | []int | Narrows a multi-match selector to these positions. |
↳ enter | []string | Names the subtrees CSS has to resolve inside, outermost first. Each entry selects a shadow host or an iframe, resolved in the tree the previous entry opened, so a control inside a web component inside a same-origin frame is reachable by one Selector. Empty runs CSS against the top document. |
↳ index | int | Narrows a multi-match selector to a single position. |
↳ all | bool | Expands the step to act on every match instead of the first. |
↳ value | string | Is the input for value-taking steps such as fill and select. It may contain {{ variable }} placeholders. |
↳ format | string | Names the shape extraction steps return their data in. |
↳ attribute | string | Names the DOM attribute an extraction step reads. |
↳ fields | ExtractField | Are the named columns an extractList step reads out of each item its selector matched. Key order is the column order, and every returned item carries every key. |
↳ limit | int | Caps how many items an extractList step returns. The extension applies its own bound when this is zero, so a listing that lazily grew to ten thousand rows truncates and says so. |
↳ url | string | Is the address for navigation steps. |
↳ fn | string | Names the page function an eval step invokes. |
↳ args | []any | Are the arguments passed to Fn. |
↳ body_params | map[string]string | Overrides or adds form fields on the request a captureDownload re-issues, and carries the parameters a captureUrl sends, in the query for a GET and form-encoded otherwise. |
↳ method | string | Is the HTTP method a captureUrl step fetches its URL with, defaulting to GET. |
↳ filename | string | Renames a captured file (captureDownload, captureUrl and capturePageFile). It may contain {{ variable }} placeholders. |
↳ output | string | Chooses where a captured file goes, and the controlling client is its only destination. |
↳ wait | WaitConfig | Blocks the step until a page condition holds. |
↳ selector | string | Waits for a matching element to appear (or disappear, see Absent). |
↳ text | string | Waits for this text to be present on the page. |
↳ url_includes | string | Waits for the page URL to contain this substring. |
↳ absent | bool | Flips the wait to expect the selector to disappear rather than appear. |
↳ delay_ms | int | Is a fixed pause in milliseconds, applied on top of any condition. |
↳ timeout_ms | int | Bounds the wait, in milliseconds. |
↳ prompt | string | Is the text shown at a user gate asking for manual input. |
↳ continue_on | ContinueCondition | Holds the step until a user gate is cleared or a page condition is met. |
↳ manual | bool | Pauses the run for an explicit user continue. |
↳ selector | string | Resumes when a matching element appears. |
↳ text | string | Resumes when this text is present on the page. |
↳ url_includes | string | Resumes when the page URL contains this substring. |
↳ timeout_ms | int | Bounds the hold, in milliseconds. |
↳ timeout_ms | int | Overrides the workflow's default step timeout, in milliseconds. |
↳ optional | bool | Lets the run continue when this step fails. |
↳ condition | Condition | Condition, when set, gates the step. If it does not hold, the step is skipped rather than failed. |
↳ selector | string | Holds when a matching element exists on the page. |
↳ text | string | Holds when the page (or the selected element) contains this text. |
↳ url_includes | string | Holds when the page URL contains this substring. |
↳ match | string | Decides how the set predicates combine, "any" or "all". |
↳ negate | bool | Inverts the combined result. |
↳ store | string | Names a slot the step's data is saved under, readable by later steps and returned on the WorkflowResult. |
↳ resume | ResumePoint | Resume, when set, marks this step as a point a re-run may start at, and carries the predicate recognizing a browser already standing there. |
↳ id | string | Names this point so a later point's Rewind can reach it. It is unique within one workflow. |
↳ when | Condition | Recognizes the browser standing at this point. |
↳ selector | string | Holds when a matching element exists on the page. |
↳ text | string | Holds when the page (or the selected element) contains this text. |
↳ url_includes | string | Holds when the page URL contains this substring. |
↳ match | string | Decides how the set predicates combine, "any" or "all". |
↳ negate | bool | Inverts the combined result. |
↳ rewind | Rewind | Rewind, when set, is how the browser leaves this point for an earlier one. |
↳ to | string | Names the resume point this reaches, which must sit earlier in the step list than the point declaring it. |
↳ url | string | Navigates the tab back to the earlier point. |
↳ selector | string | Clicks a control on the current page that leads back, for a flow whose way back is a button rather than an address. |
↳ wait | WaitConfig | Holds until the page has settled after the rewind, before the target point's own predicate is checked again. |
↳ selector | string | Waits for a matching element to appear (or disappear, see Absent). |
↳ text | string | Waits for this text to be present on the page. |
↳ url_includes | string | Waits for the page URL to contain this substring. |
↳ absent | bool | Flips the wait to expect the selector to disappear rather than appear. |
↳ delay_ms | int | Is a fixed pause in milliseconds, applied on top of any condition. |
↳ timeout_ms | int | Bounds the wait, in milliseconds. |
↳ always | bool | Runs the step even when re-entry starts the run past it, for work the page cannot report as already done. |
variables | map[string]string | The {{ }} placeholders the authored workflow may use, name to description |
last_error | string | Why the previous turn's step failed, fed back so the model corrects against the page |
repairing | []Step | The steps of the fragment being repaired, absent on a first authoring |
↳ id | string | Uniquely names the step within its workflow, echoed on its StepResult. |
↳ type | string | Is the action to perform (click, fill, select, captureUrl, ...). |
↳ label | string | Is a human-readable description shown in run progress UIs. |
↳ selector | Selector | Picks the DOM node(s) the step acts on. |
↳ css | string | Is a CSS selector. |
↳ path | string | Is an explicit DOM path, used when CSS cannot express the target. |
↳ indexes | []int | Narrows a multi-match selector to these positions. |
↳ enter | []string | Names the subtrees CSS has to resolve inside, outermost first. Each entry selects a shadow host or an iframe, resolved in the tree the previous entry opened, so a control inside a web component inside a same-origin frame is reachable by one Selector. Empty runs CSS against the top document. |
↳ index | int | Narrows a multi-match selector to a single position. |
↳ all | bool | Expands the step to act on every match instead of the first. |
↳ value | string | Is the input for value-taking steps such as fill and select. It may contain {{ variable }} placeholders. |
↳ format | string | Names the shape extraction steps return their data in. |
↳ attribute | string | Names the DOM attribute an extraction step reads. |
↳ fields | ExtractField | Are the named columns an extractList step reads out of each item its selector matched. Key order is the column order, and every returned item carries every key. |
↳ limit | int | Caps how many items an extractList step returns. The extension applies its own bound when this is zero, so a listing that lazily grew to ten thousand rows truncates and says so. |
↳ url | string | Is the address for navigation steps. |
↳ fn | string | Names the page function an eval step invokes. |
↳ args | []any | Are the arguments passed to Fn. |
↳ body_params | map[string]string | Overrides or adds form fields on the request a captureDownload re-issues, and carries the parameters a captureUrl sends, in the query for a GET and form-encoded otherwise. |
↳ method | string | Is the HTTP method a captureUrl step fetches its URL with, defaulting to GET. |
↳ filename | string | Renames a captured file (captureDownload, captureUrl and capturePageFile). It may contain {{ variable }} placeholders. |
↳ output | string | Chooses where a captured file goes, and the controlling client is its only destination. |
↳ wait | WaitConfig | Blocks the step until a page condition holds. |
↳ selector | string | Waits for a matching element to appear (or disappear, see Absent). |
↳ text | string | Waits for this text to be present on the page. |
↳ url_includes | string | Waits for the page URL to contain this substring. |
↳ absent | bool | Flips the wait to expect the selector to disappear rather than appear. |
↳ delay_ms | int | Is a fixed pause in milliseconds, applied on top of any condition. |
↳ timeout_ms | int | Bounds the wait, in milliseconds. |
↳ prompt | string | Is the text shown at a user gate asking for manual input. |
↳ continue_on | ContinueCondition | Holds the step until a user gate is cleared or a page condition is met. |
↳ manual | bool | Pauses the run for an explicit user continue. |
↳ selector | string | Resumes when a matching element appears. |
↳ text | string | Resumes when this text is present on the page. |
↳ url_includes | string | Resumes when the page URL contains this substring. |
↳ timeout_ms | int | Bounds the hold, in milliseconds. |
↳ timeout_ms | int | Overrides the workflow's default step timeout, in milliseconds. |
↳ optional | bool | Lets the run continue when this step fails. |
↳ condition | Condition | Condition, when set, gates the step. If it does not hold, the step is skipped rather than failed. |
↳ selector | string | Holds when a matching element exists on the page. |
↳ text | string | Holds when the page (or the selected element) contains this text. |
↳ url_includes | string | Holds when the page URL contains this substring. |
↳ match | string | Decides how the set predicates combine, "any" or "all". |
↳ negate | bool | Inverts the combined result. |
↳ store | string | Names a slot the step's data is saved under, readable by later steps and returned on the WorkflowResult. |
↳ resume | ResumePoint | Resume, when set, marks this step as a point a re-run may start at, and carries the predicate recognizing a browser already standing there. |
↳ id | string | Names this point so a later point's Rewind can reach it. It is unique within one workflow. |
↳ when | Condition | Recognizes the browser standing at this point. |
↳ selector | string | Holds when a matching element exists on the page. |
↳ text | string | Holds when the page (or the selected element) contains this text. |
↳ url_includes | string | Holds when the page URL contains this substring. |
↳ match | string | Decides how the set predicates combine, "any" or "all". |
↳ negate | bool | Inverts the combined result. |
↳ rewind | Rewind | Rewind, when set, is how the browser leaves this point for an earlier one. |
↳ to | string | Names the resume point this reaches, which must sit earlier in the step list than the point declaring it. |
↳ url | string | Navigates the tab back to the earlier point. |
↳ selector | string | Clicks a control on the current page that leads back, for a flow whose way back is a button rather than an address. |
↳ wait | WaitConfig | Holds until the page has settled after the rewind, before the target point's own predicate is checked again. |
↳ selector | string | Waits for a matching element to appear (or disappear, see Absent). |
↳ text | string | Waits for this text to be present on the page. |
↳ url_includes | string | Waits for the page URL to contain this substring. |
↳ absent | bool | Flips the wait to expect the selector to disappear rather than appear. |
↳ delay_ms | int | Is a fixed pause in milliseconds, applied on top of any condition. |
↳ timeout_ms | int | Bounds the wait, in milliseconds. |
↳ always | bool | Runs the step even when re-entry starts the run past it, for work the page cannot report as already done. |
broken_step | string | The id of the step of that fragment which stopped working |
broken_reason | string | Why that fragment stopped holding up, which is what the repair has to fix |
Outputs
| Name | Type | Description |
|---|---|---|
system | string | The standing instructions, which say what a step may be and how a ref is named |
user | string | This turn, which is the goal, the accepted steps, the page and the last failure |
text | string | Both messages in one string, for a model call that takes a single prompt |
Example
Renders one turn of the authoring loop and asks a model for the next step. It is the middle of the api registry's aweehub/web/author-turn document, shown on its own so the shape of a turn is readable without the recursion.
name: Ask a model for the next browser step
connections:
- name: openrouter
provider: openrouter
actions:
- name: look
component: machine:extension:observe
vars:
url: https://example.com/login
- name: turn
component: machine:extension:prompt
vars:
goal: Log in with the email address and password the run supplies.
observation: "{{ look.text }}"
variables:
email: the account's email address
password: the account's password
- name: decide
component: llm:generate
connection: openrouter
vars:
provider: openrouter
model: anthropic/claude-sonnet-5
prompt: "{{ turn.text }}"
max_tokens: 2048
temperature: 0
outputs:
decision: "{{ decide.content }}"