REMOTE EXECUTION
Remote execution distributes workflow steps to external machines. Workers connect to a Swamp server over WebSocket, receive dispatched steps, execute them locally, and stream results back through the server's data plane.
The server side is swamp serve, which exposes a WebSocket API for running
workflows and model methods. Workers enroll against a running server using
time-limited enrollment tokens, then maintain a persistent connection to receive
work.
Core Concepts
| Concept | Role |
|---|---|
| Server | swamp serve instance that accepts worker connections and dispatches steps |
| Worker | Machine running swamp worker that executes dispatched steps |
| Enrollment token | Short-lived credential that binds a worker to a server, consumed on first use |
| Pool | Named group of workers; workflow steps target a pool via placement fields |
| Placement | Step-level fields in workflow YAML that control which pool and constraints apply |
In This Section
- Worker Commands — CLI
reference for
swamp workerandswamp serve - Enrollment Tokens — token lifecycle, machine binding, expiry
- Workflow Placement — step placement fields and scheduling
- Failure Semantics — reconnection, in-flight dispatch, cancellation
- Security — trust model, credential isolation, reverse trust
Enrollment tokens authorize workers into the pool. Once enrolled, swamp serve
accepts their WebSocket connections and adds them to the dispatch roster.
Workflow steps that declare placement fields are matched against available
workers in the target pool. Matched workers execute steps through the
orchestrator's data plane, streaming output and status back to the server.