How Workers run
- Self-managed: the factory assigns each Worker a title and a clear brief.
- Factory-scoped permissions: Workers use the factory’s connected apps, skills, memory, and files, acting with the factory owner’s permissions and configured tool policies.
- Parallel execution: up to 20 Workers per factory can run simultaneously.
- Clean reporting: when a Worker finishes, fails, or is stopped, its outcome goes back to the factory—not directly into Room History. The factory decides how and what to communicate in the Room.
What Workers can and cannot do
Understanding a Worker’s execution boundaries helps you—and your coding agent—design the right split between Worklayer and external tools.What a Worker can do
- Call connected apps, custom MCP servers, and OpenAPI tools: A Worker can invoke any enabled tool connected to the factory (for example, GitHub, Sentry, PostHog, Stripe, Slack, PostgreSQL, Cursor Cloud Agents, or your own internal API). See Apps & integrations.
- Run sandboxed JavaScript and TypeScript orchestration scripts: When a task requires chaining calls, paginating APIs, looping, retrying, or filtering large payloads, a Worker can execute a JavaScript/TypeScript script inside an isolated sandbox (up to 2 minutes per script). Large intermediate results stay inside the script so only concise outputs return to the model.
- Work with factory files, memory, skills, and databases: Workers have a virtual shell (
grep,rg,jq, and standard text utilities) over scoped workspace directories:/scratch— per-Worker temporary working files and large tool outputs./files— persistent factory files shared across sessions (reports, evidence bundles, CSVs, HTML artifacts)./memory— long-term factory knowledge persisted across tasks./skills— read-only reusable playbooks (modified via Skills tools).- Structured factory databases for tabular records the factory needs to query, filter, or count.
- Create self-managed Monitors: A Worker can set up a timer-based check (for example, watching a pull request’s CI checks, waiting on a coding agent run, or polling a shipment status) and wake up automatically when state changes.
- Pause for human Review: Whenever a tool policy is set to Ask (or a Worker needs clarification or a missing app connection), it pauses safely in
waitingstate and creates a Review.
What a Worker cannot do directly
- No general-purpose VM, local shell, or direct git repository execution: Worklayer’s built-in code sandbox executes TypeScript/JavaScript orchestration scripts against connected tools—it does not provide a Linux dev container, package installer, or local git checkout. A Worker cannot clone a repository, edit code on disk, or run a test suite directly inside Worklayer.
- No arbitrary outbound HTTP from sandbox code: Sandbox scripts have no direct internet access and no host filesystem access. Any external API call must go through a built-in app, an uploaded OpenAPI spec, or a custom remote MCP server so credentials and approval policies stay enforced.
- No bypassing tool policies or accessing private user accounts: Workers cannot invoke disabled tools, skip Ask approval policies, or read personal app accounts belonging to individual team members.
Follow progress
1
List Workers in a Room
running or waiting). Pass status=all to retrieve every Worker, or pass a specific status value to filter.2
Check Worker status
To receive real-time transitions without polling, subscribe to the
worker.status Subscription event.3
Read Worker messages
Call
GET /v1/rooms/{roomId}/workers/{workerId}/messages to fetch the Worker’s saved transcript in AI SDK UIMessage format (id, role of user or assistant, and parts). Set order=asc (oldest first, default) or order=desc (newest first).web), you can access all Workers across the factory. Requesting a Worker outside the Room’s scope returns 404.
What Worker history omits
- Tool calls appear as
dynamic-toolparts withinput: null.outputis alsonull, except when the Worker presents files to a user (in which caseoutputcontains the file list). - Failed tool calls include
errorText: "Tool failed.". - Certain internal execution steps are omitted from the public transcript.
422 with code: "worker_history_group_too_large".
Steer a Worker
Send a message directly to a Worker to add context, redirect its work, or kick off a follow-up on anidle Worker:
text: 1 to 16,000 non-blank characters.delivery:queue(default) — runs as a new request once the Worker’s current work completes.steer— injects guidance mid-flight during the Worker’s active work.contextis not supported for Workers (it is only for Room Events) and returns400withSupply nonblank text within the composer limit and a valid delivery.
201 Created response returns the saved messageId and an optional status:
If the message could not be saved and execution could not start, the API returns
503 (safe to retry later) or 402 (billing issue—retrying will not resolve it).
Stream a run
Stream a Worker’s live output over Server-Sent Events withGET /v1/rooms/{roomId}/workers/{workerId}/stream:
- If the Worker is not actively running, the API returns
204 No Contentwith an empty body. - If the Worker is running, the API returns
200 OKwithContent-Type: text/event-streamandx-vercel-ai-ui-message-stream: v1, formatted as an AI SDK UI message stream.
data: <JSON chunk> line, terminated by data: [DONE]:
{"type":"error","errorText":"Worker run failed."}.
Consume stream chunks promptly: if a slow reader forces the server to buffer more than 4 MiB, Worklayer closes the connection.
When a Worker finishes
Once a Worker completes its work, its status returns toidle and its report is handed back to the factory. To show the final outcome to end users, read Room History or listen for the room.response Subscription event. You can also send a new message to an idle Worker anytime to continue working in the same Worker context.
Workers that fail or are stopped also report back to the factory so it can decide how to recover or inform your team.
Review
Unblock Workers waiting for human approval, answers, or app connections.
Rooms
Read the factory’s user-facing responses in Room History.