one-worker-for-a-single-session-credential

Run an integration whose credential is one account session without losing that session — a second worker on the same key reads as a hijack, and the key does not come back.

Procedure

  1. start start. Goes next to s1
  2. decision Is the scheduled worker stopped?. Goes if still_running to s10; if default to s2
  3. check No other copy is running on this machine. Goes on_fail to s3; next to s4
  4. decision Whose process is it?. Goes if abandoned to s4; if default to s10
  5. decision Is concurrency pinned to one everywhere?. Goes if not_pinned to s10; if default to s5
  6. action Start exactly one worker, RW (reversible-write). Goes on_fail to s10; next to s6
  7. decision Did a duplicate-authorisation error appear?. Goes if duplicate to s7; if default to s9
  8. decision Is the session still alive?. Goes if revoked to s8; if default to s10
  9. action The owner reissues the key by hand, IRR (irreversible), requires approval. Goes on_fail to s10; next to s9
  10. decision Did the run finish on its own?. Goes if stopped_early to s10; if default to s11
  11. escalate Stop, before the key is spent. Terminal
  12. action Write down what could not be reached, RO (read-only). Goes next to __end_success
  13. end success. Terminal

Open the graph on its own page — larger, printable, and an address you can send.

Walk it without running it — you answer what your environment would answer, and the path, the capabilities, the approvals and the distance back to an undo come out of the document. Nothing executes; there is no Run button here and there will not be one.

Trust

T2 · attested 2026-10-11 · runbooks.directory

Nobody has attested this record. That is the ordinary case: T2 is what the catalog can check on its own, and T3 needs somebody to run the procedure and sign for it.

  • Link liveness has not been checked: it needs a network and the catalog builds without one. Run pnpm gates --online where there is one.

Steps

  1. s1 decision — Is the scheduled worker stopped?
  2. s2 check — No other copy is running on this machine
  3. s3 decision — Whose process is it?
  4. s4 decision — Is concurrency pinned to one everywhere?
  5. s5 action — Start exactly one worker (reversible-write)
  6. s6 decision — Did a duplicate-authorisation error appear?
  7. s7 decision — Is the session still alive?
  8. s8 action — The owner reissues the key by hand (irreversible) — requires approval
  9. s9 decision — Did the run finish on its own?
  10. s11 action — Write down what could not be reached (read-only)
  11. s10 escalate — Stop, before the key is spent

Capabilities

This is a privilege request. Check it against your own allowlist before running.

  • cli:pgrep — used by s2

Provenance

Source
https://runbooks.directory/r/std/one-worker-for-a-single-session-credential/source.md
Fetched
2026-09-04
Source last checked
not since it was captured on 2026-09-04 — recorded as current
Licence
CC-BY-4.0
How it got here
Written by this catalog's maintainers and reviewed in full.
Highest risk in this procedure
irreversible

Take it with you

Run it under supervision

This procedure contains irreversible steps. Run it here, where the supervisor is the thing invoking the commands and therefore sees every one of them: each step is proposed before it happens and a gate stops for you. Nothing about the run leaves this machine.

# irreversible steps: every one stops for you before it runs.
npx @runbooks/cli run std/one-worker-for-a-single-session-credential@1.0.0 --as "$(whoami)" \
  --input worker=<the process name of the worker that holds the session>