save_flow - kubed-io/selenium-flow GitHub Wiki

save_flow

Create or replace a flow.

MCP tool save_flow
HTTP PUT /flows/{name}

The same name updates, a new one creates. Always writes to this workspace's own library, never the shared one โ€” so workspace is required in practice: the shared global library is read-only, because every workspace lists and runs what is in it. The document is validated against the live tools and a refusal lists every problem at once.

Parameters

Name Type Required Default Notes
name string yes โ€”
description string no โ€”
parameters object no โ€”
timeout integer no โ€” Seconds the whole run may take before no further step starts. Defaults to 120; a step already running is bounded by its own wait_timeout.
steps array yes โ€”

Every call names its workspace: an X-Workspace header, or ?workspace=<name>. Sending both is refused. See Workspaces.

Returns

Field Type Notes
saved boolean
workspace string
name string
description string
parameters object
timeout integer Seconds the whole run may take before no further step starts. Defaults to 120; a step already running is bounded by its own wait_timeout.
warnings array Things that are valid and probably not what was meant โ€” a flow whose first step acts on whatever page the browser happens to be on. Present only when there are any; the flow is saved either way.
steps array

Errors

Status Means
400 The request cannot succeed as sent โ€” an unusable name, a flow that does not exist, a document that would not run, or a write aimed at the read-only shared library. Do not retry it unchanged.
401 Missing or wrong bearer token.
413 The body is over its cap: 1 MiB of JSON, 64 MiB of upload, 1 MiB of flow YAML. Send less; retrying it unchanged will fail again.
500 Something failed that this server did not expect.

Over MCP the same failures arrive as a tool error.

Example

MCP

save_flow(name="โ€ฆ", steps=[{"tool": "navigate", "args": {"url": "https://example.com"}}])

HTTP

curl -X PUT $SELENIUM_FLOW/flows/my-flow \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Workspace: $WORKSPACE" \
  -H 'Content-Type: application/json' \
  -d '{
    "steps": [
      {
        "tool": "navigate",
        "args": {
          "url": "https://example.com"
        }
      }
    ]
  }'

โ† All actions ยท Installing ยท Deployment

โš ๏ธ **GitHub.com Fallback** โš ๏ธ