DocsWorkflowsComponentsMachinemachine:extension:sequence

machine:extension:sequence

Runs an ordered list of library fragments in the connected browser extension as one logical job (one tab/session, one cancelable id) and blocks until the per-fragment results come back. Use it when fragments must share a live browser session; when they are independent, prefer chained machine:extension:run steps so the pipeline owns the control flow between them.

Options

NameTypeDescription
refs[]ExtSequenceRefThe ordered library fragments to run as one job in the same browser session
  ↳ workflow_idstringThe id of the library fragment
  ↳ variablesmap[string]anyValues scoped to just this fragment, merged over the sequence-wide bag
client_idstringThe extension client to run against, a hint the host may honour; empty leaves the choice of browser to the host
variablesmap[string]anySequence-wide values injected into every fragment
continue_on_errorboolKeep running later fragments when one fails
timeout_msintHow long to wait for the whole sequence before failing (default 10 minutes)

Outputs

NameTypeDescription
okboolWhether every fragment finished without error
storedmap[string]anyThe merged store outputs of all fragments, later fragments winning on name clashes
workflows[]WorkflowResultThe per-fragment results in run order
  ↳ workflow_idstringIs the id of the workflow this result belongs to.
  ↳ okboolReports whether the run succeeded.
  ↳ steps[]StepResultHolds each step's result, in run order.
    ↳ 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.
  ↳ storedmap[string]anyHolds the values the workflow's store steps captured, keyed by store name, so a sequence chains one fragment's output into the next and a caller can read them.
  ↳ errorstringDescribes what stopped the run when OK is false.
  ↳ refusedboolSays the browser declined the work rather than attempting it, which is what a browser set not to run for this app answers. It is separate from OK because a caller repairs a broken fragment and asks a person about a refusal, and the two must not read alike.
  ↳ started_atint64Is when the run began, in Unix milliseconds.
  ↳ finished_atint64Is when the run ended, in Unix milliseconds.

Example

name: Fetch a bank statement in one browser session
actions:
  - name: statement
    component: machine:extension:sequence
    vars:
      refs:
        - workflow_id: swedbank-01-login
        - workflow_id: swedbank-03-open-statement
        - workflow_id: swedbank-04-save-files
      variables:
        user_id: "{{ var.user_id }}"
        date_from: "{{ var.date_from }}"
        date_to: "{{ var.date_to }}"

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