{
  "schema_version": 1,
  "name": "Health-check a list of accounts",
  "version": 1,
  "description": "Rotate through a CSV of accounts and check each one is still healthy: log in, confirm the logged-in marker, screenshot the state, and stop that account cleanly on a checkpoint. A quick way to see which accounts survived. Point data.path at your CSV (columns: user, pass); run each in its own Orbe profile. No posting or risky actions — read-only health check.",
  "vars": {
    "login_url": "https://example.com/login",
    "submit_text": "Sign in",
    "healthy_marker": "My account"
  },
  "data": { "source": "csv", "path": "accounts.csv", "columns": ["user", "pass"] },
  "on_error": "screenshot_and_stop",
  "steps": [
    { "open": {} },
    { "repeat": { "for_each_row": true },
      "do": [
        { "goto": { "url": "{{login_url}}" } },
        { "wait_for": { "text": "{{submit_text}}", "timeout": 15 } },
        { "type": { "into": "Username", "text": "{{user}}" } },
        { "type": { "into": "Password", "text": "{{pass}}", "enter": true } },
        { "if": { "text_present": "Verify" },
          "then": [ { "set": { "name": "health", "value": "checkpoint" } },
                    { "screenshot": { "path": "checkpoint.png" } },
                    { "stop": { "reason": "checkpoint on this account" } } ] },
        { "wait_for": { "text": "{{healthy_marker}}", "timeout": 20 } },
        { "if": { "text_present": "{{healthy_marker}}" },
          "then": [ { "set": { "name": "health", "value": "healthy" } } ],
          "else": [ { "set": { "name": "health", "value": "unhealthy" } } ] },
        { "screenshot": { "path": "health.png" } }
      ] },
    { "close": {} }
  ]
}
