Skip to main content
Relay suits Slack: your app already receives the event, already knows who sent it, and Patchwork never talks to Slack directly. Needs an API key and a published agent. No connection required unless your agent calls your own endpoints.

Subjects are the whole design decision

A Slack user id is unique within a team, not globally. And the same human in two Slack workspaces should not share one memory partition. So compose both:
Prefixing by platform leaves room for wa: or email: later without collisions. See Subjects.

The handler

Persist the thread map

The Map above is illustrative. In production put it in your database, keyed by Slack team and thread — an in-memory map loses every conversation on deploy.

Questions and gates

If your agent can ask questions, settle will time out rather than return, because awaiting_input is not terminal. Handle it by polling GET /v1/loom/threads and reading pending_elicitation, then posting the user’s next Slack message as the answer. If any wired patch is Always ask, you also need an approval path — Slack Block Kit buttons that call the confirm endpoint are a natural fit, and pending_confirmation.summary is built to render as the prompt.

Do not leak the key

sk_… lives in your bot’s environment and never anywhere near a client. It can assert any subject in your workspace, which is exactly why the subject string above is computed from the verified Slack event and never from user input.