DocsWorkflowsComponentsMachinemachine:extension:prompt

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

NameTypeDescription
goalstringWhat the authored workflow should accomplish, in plain language
observationstringThe current page rendered as text, which is what machine:extension:observe returns
last_observationstringThe page as it was on the previous turn, so a turn that changed nothing visible is named as one instead of being repeated
last_resultstringWhat the previous turn's step returned, which is how the model reads prose an observation does not carry
steps[]StepThe steps the session has accepted so far, in order
  ↳ idstringUniquely names the step within its workflow, echoed on its StepResult.
  ↳ typestringIs the action to perform (click, fill, select, captureUrl, ...).
  ↳ labelstringIs a human-readable description shown in run progress UIs.
  ↳ selectorSelectorPicks the DOM node(s) the step acts on.
    ↳ cssstringIs a CSS selector.
    ↳ pathstringIs an explicit DOM path, used when CSS cannot express the target.
    ↳ indexes[]intNarrows a multi-match selector to these positions.
    ↳ enter[]stringNames 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.
    ↳ indexintNarrows a multi-match selector to a single position.
    ↳ allboolExpands the step to act on every match instead of the first.
  ↳ valuestringIs the input for value-taking steps such as fill and select. It may contain {{ variable }} placeholders.
  ↳ formatstringNames the shape extraction steps return their data in.
  ↳ attributestringNames the DOM attribute an extraction step reads.
  ↳ fieldsExtractFieldAre 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.
  ↳ limitintCaps 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.
  ↳ urlstringIs the address for navigation steps.
  ↳ fnstringNames the page function an eval step invokes.
  ↳ args[]anyAre the arguments passed to Fn.
  ↳ body_paramsmap[string]stringOverrides 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.
  ↳ methodstringIs the HTTP method a captureUrl step fetches its URL with, defaulting to GET.
  ↳ filenamestringRenames a captured file (captureDownload, captureUrl and capturePageFile). It may contain {{ variable }} placeholders.
  ↳ outputstringChooses where a captured file goes, and the controlling client is its only destination.
  ↳ waitWaitConfigBlocks the step until a page condition holds.
    ↳ selectorstringWaits for a matching element to appear (or disappear, see Absent).
    ↳ textstringWaits for this text to be present on the page.
    ↳ url_includesstringWaits for the page URL to contain this substring.
    ↳ absentboolFlips the wait to expect the selector to disappear rather than appear.
    ↳ delay_msintIs a fixed pause in milliseconds, applied on top of any condition.
    ↳ timeout_msintBounds the wait, in milliseconds.
  ↳ promptstringIs the text shown at a user gate asking for manual input.
  ↳ continue_onContinueConditionHolds the step until a user gate is cleared or a page condition is met.
    ↳ manualboolPauses the run for an explicit user continue.
    ↳ selectorstringResumes when a matching element appears.
    ↳ textstringResumes when this text is present on the page.
    ↳ url_includesstringResumes when the page URL contains this substring.
    ↳ timeout_msintBounds the hold, in milliseconds.
  ↳ timeout_msintOverrides the workflow's default step timeout, in milliseconds.
  ↳ optionalboolLets the run continue when this step fails.
  ↳ conditionConditionCondition, when set, gates the step. If it does not hold, the step is skipped rather than failed.
    ↳ selectorstringHolds when a matching element exists on the page.
    ↳ textstringHolds when the page (or the selected element) contains this text.
    ↳ url_includesstringHolds when the page URL contains this substring.
    ↳ matchstringDecides how the set predicates combine, "any" or "all".
    ↳ negateboolInverts the combined result.
  ↳ storestringNames a slot the step's data is saved under, readable by later steps and returned on the WorkflowResult.
  ↳ resumeResumePointResume, when set, marks this step as a point a re-run may start at, and carries the predicate recognizing a browser already standing there.
    ↳ idstringNames this point so a later point's Rewind can reach it. It is unique within one workflow.
    ↳ whenConditionRecognizes the browser standing at this point.
      ↳ selectorstringHolds when a matching element exists on the page.
      ↳ textstringHolds when the page (or the selected element) contains this text.
      ↳ url_includesstringHolds when the page URL contains this substring.
      ↳ matchstringDecides how the set predicates combine, "any" or "all".
      ↳ negateboolInverts the combined result.
    ↳ rewindRewindRewind, when set, is how the browser leaves this point for an earlier one.
      ↳ tostringNames the resume point this reaches, which must sit earlier in the step list than the point declaring it.
      ↳ urlstringNavigates the tab back to the earlier point.
      ↳ selectorstringClicks a control on the current page that leads back, for a flow whose way back is a button rather than an address.
      ↳ waitWaitConfigHolds until the page has settled after the rewind, before the target point's own predicate is checked again.
        ↳ selectorstringWaits for a matching element to appear (or disappear, see Absent).
        ↳ textstringWaits for this text to be present on the page.
        ↳ url_includesstringWaits for the page URL to contain this substring.
        ↳ absentboolFlips the wait to expect the selector to disappear rather than appear.
        ↳ delay_msintIs a fixed pause in milliseconds, applied on top of any condition.
        ↳ timeout_msintBounds the wait, in milliseconds.
  ↳ alwaysboolRuns the step even when re-entry starts the run past it, for work the page cannot report as already done.
variablesmap[string]stringThe {{ }} placeholders the authored workflow may use, name to description
last_errorstringWhy the previous turn's step failed, fed back so the model corrects against the page
repairing[]StepThe steps of the fragment being repaired, absent on a first authoring
  ↳ idstringUniquely names the step within its workflow, echoed on its StepResult.
  ↳ typestringIs the action to perform (click, fill, select, captureUrl, ...).
  ↳ labelstringIs a human-readable description shown in run progress UIs.
  ↳ selectorSelectorPicks the DOM node(s) the step acts on.
    ↳ cssstringIs a CSS selector.
    ↳ pathstringIs an explicit DOM path, used when CSS cannot express the target.
    ↳ indexes[]intNarrows a multi-match selector to these positions.
    ↳ enter[]stringNames 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.
    ↳ indexintNarrows a multi-match selector to a single position.
    ↳ allboolExpands the step to act on every match instead of the first.
  ↳ valuestringIs the input for value-taking steps such as fill and select. It may contain {{ variable }} placeholders.
  ↳ formatstringNames the shape extraction steps return their data in.
  ↳ attributestringNames the DOM attribute an extraction step reads.
  ↳ fieldsExtractFieldAre 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.
  ↳ limitintCaps 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.
  ↳ urlstringIs the address for navigation steps.
  ↳ fnstringNames the page function an eval step invokes.
  ↳ args[]anyAre the arguments passed to Fn.
  ↳ body_paramsmap[string]stringOverrides 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.
  ↳ methodstringIs the HTTP method a captureUrl step fetches its URL with, defaulting to GET.
  ↳ filenamestringRenames a captured file (captureDownload, captureUrl and capturePageFile). It may contain {{ variable }} placeholders.
  ↳ outputstringChooses where a captured file goes, and the controlling client is its only destination.
  ↳ waitWaitConfigBlocks the step until a page condition holds.
    ↳ selectorstringWaits for a matching element to appear (or disappear, see Absent).
    ↳ textstringWaits for this text to be present on the page.
    ↳ url_includesstringWaits for the page URL to contain this substring.
    ↳ absentboolFlips the wait to expect the selector to disappear rather than appear.
    ↳ delay_msintIs a fixed pause in milliseconds, applied on top of any condition.
    ↳ timeout_msintBounds the wait, in milliseconds.
  ↳ promptstringIs the text shown at a user gate asking for manual input.
  ↳ continue_onContinueConditionHolds the step until a user gate is cleared or a page condition is met.
    ↳ manualboolPauses the run for an explicit user continue.
    ↳ selectorstringResumes when a matching element appears.
    ↳ textstringResumes when this text is present on the page.
    ↳ url_includesstringResumes when the page URL contains this substring.
    ↳ timeout_msintBounds the hold, in milliseconds.
  ↳ timeout_msintOverrides the workflow's default step timeout, in milliseconds.
  ↳ optionalboolLets the run continue when this step fails.
  ↳ conditionConditionCondition, when set, gates the step. If it does not hold, the step is skipped rather than failed.
    ↳ selectorstringHolds when a matching element exists on the page.
    ↳ textstringHolds when the page (or the selected element) contains this text.
    ↳ url_includesstringHolds when the page URL contains this substring.
    ↳ matchstringDecides how the set predicates combine, "any" or "all".
    ↳ negateboolInverts the combined result.
  ↳ storestringNames a slot the step's data is saved under, readable by later steps and returned on the WorkflowResult.
  ↳ resumeResumePointResume, when set, marks this step as a point a re-run may start at, and carries the predicate recognizing a browser already standing there.
    ↳ idstringNames this point so a later point's Rewind can reach it. It is unique within one workflow.
    ↳ whenConditionRecognizes the browser standing at this point.
      ↳ selectorstringHolds when a matching element exists on the page.
      ↳ textstringHolds when the page (or the selected element) contains this text.
      ↳ url_includesstringHolds when the page URL contains this substring.
      ↳ matchstringDecides how the set predicates combine, "any" or "all".
      ↳ negateboolInverts the combined result.
    ↳ rewindRewindRewind, when set, is how the browser leaves this point for an earlier one.
      ↳ tostringNames the resume point this reaches, which must sit earlier in the step list than the point declaring it.
      ↳ urlstringNavigates the tab back to the earlier point.
      ↳ selectorstringClicks a control on the current page that leads back, for a flow whose way back is a button rather than an address.
      ↳ waitWaitConfigHolds until the page has settled after the rewind, before the target point's own predicate is checked again.
        ↳ selectorstringWaits for a matching element to appear (or disappear, see Absent).
        ↳ textstringWaits for this text to be present on the page.
        ↳ url_includesstringWaits for the page URL to contain this substring.
        ↳ absentboolFlips the wait to expect the selector to disappear rather than appear.
        ↳ delay_msintIs a fixed pause in milliseconds, applied on top of any condition.
        ↳ timeout_msintBounds the wait, in milliseconds.
  ↳ alwaysboolRuns the step even when re-entry starts the run past it, for work the page cannot report as already done.
broken_stepstringThe id of the step of that fragment which stopped working
broken_reasonstringWhy that fragment stopped holding up, which is what the repair has to fix

Outputs

NameTypeDescription
systemstringThe standing instructions, which say what a step may be and how a ref is named
userstringThis turn, which is the goal, the accepted steps, the page and the last failure
textstringBoth 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 }}"