Supervisor MCP Reference
The Supervisor MCP (CoreMCP) is a global management interface that spans your entire AgentRQ account. Unlike Workspace MCP servers which are isolated to a single project, the Supervisor MCP allows an agent to manage all workspaces, monitor platform-wide stats, and orchestrate complex multi-agent workflows — including defining events, event triggers, and named workflow graphs that tie steps together, so an agent can wire up a system for you instead of you building it by hand in the UI. It can also mint an enrolment code for adding a new machine to run agents on.
Platform Orchestration
Perfect for "Manager" or "Orchestrator" agents that need to create workspaces dynamically for new projects or list existing ones to find relevant context.
Monitoring & Audit
Allows agents to pull statistics and task history across all workspaces for reporting, auditing, or platform-wide performance analysis.
Connection Details
The Supervisor MCP server uses OAuth2 for authentication. Most modern MCP clients (like Claude Desktop or Claude Code) will handle the OAuth handshake automatically when you provide the server URL.
Build a System, Not Just Tasks
A supervisor could always create workspaces and put tasks in them — but not the thing that turns those into a system. Now it can. An event is a named signal a workspace publishes when something happens; an event trigger is a standing instruction to create a task somewhere else when that signal fires. Wire the two together and a hand-off happens without the supervisor arranging it, task by task.
These are the same operations the Events UI performs. Each tool is a thin wrapper over the controller method the REST API calls, so an agent gets no path the UI does not have and no validation the UI does not enforce.
Wiring one up
// 1. Name the signal.
createEvent(
name: "qa_passed",
payloadGuidelines: "Include the build number and the pass/fail counts."
) // -> { id: "0hNRmEWoU5Z", ... }
// 2. Say what should happen when it fires.
createEventTrigger(
eventId: "0hNRmEWoU5Z",
workspaceId: "0eCTDeDXETx",
title: "Ship the release",
body: "QA signed off:\n{{EVENT_PAYLOAD}}",
emitEventId: "0hDXw48jLfd" // publishes deploy_finished on completion
)
// 3. Check the system is actually running.
listEventTasks(eventId: "0hNRmEWoU5Z")
Step 2's emitEventId is what makes this compose:
the spawned task publishes a second event when it completes, so one system hands off to the
next without anything in the middle.
Placeholders
| Variable | Replaced With |
|---|---|
{{EVENT_PAYLOAD}} |
The payload string the publishing agent sent |
{{EVENT_FAQ}} |
Extra Q&A context from the publishing agent, when it provided any |
Both are substituted in the task body only. A trigger's
title is used exactly as written, so a
placeholder there stays on screen as literal text.
What the server checks
| Rule | Detail |
|---|---|
| Event name | Must match
^[a-z][a-z0-9_]{0,128}$
and be unique for your account. A name already taken is reported as a duplicate,
not a server error. |
| Names are permanent | updateEvent
revises the payload guidelines only. To rename, create a new event. |
| Ownership | The event, the target workspace and any
emitEventId must all belong to you.
Anything else comes back as not found. |
| Cron granularity | A trigger's optional
cronSchedule is 5 fields, and the
minute must be a single fixed number 0–59 — no
*,
/,
- or
,. Hourly or coarser. |
| Updates are rewrites | updateEventTrigger
writes every field as given, so send the ones you want to keep as well as the ones
you are changing. |
| Default assignee | A trigger with no
assignee creates the task for
agent — a trigger exists to make
something happen without being asked. |
Workflows: The Graph Events Add Up To
Events and triggers were reachable one at a time — a workflow is the named graph they form: a start event, and the steps that react to it and to each other. Give it a name once, and every workspace it touches, every task it spawns and every event it chains is visible in one place instead of scattered across individual triggers.
These are the same operations the Workflows UI performs, so an agent gets no path the UI does not have and no validation the UI does not enforce — ownership of the workflow, of the events it names and of the workspaces its steps point at, and the cycle check that stops a graph emitting its way back into itself, are all decided server-side.
Building one
// 1. Create the graph around a start event.
createWorkflow(
name: "release-pipeline",
startEventId: "0hNRmEWoU5Z" // qa_passed
) // -> { id: "0hWfK92pXqL", ... }
// 2. Add a step: when the start event fires, create a task here.
createWorkflowStep(
workflowId: "0hWfK92pXqL",
eventId: "0hNRmEWoU5Z",
workspaceId: "0eCTDeDXETx",
title: "Ship the release",
body: "QA signed off:\n{{EVENT_PAYLOAD}}",
emitEventId: "0hDXw48jLfd" // publishes deploy_finished on completion
)
// 3. Check the system is actually running.
listWorkflowTasks(workflowId: "0hWfK92pXqL")
Two ways to write the same graph
createWorkflowStep and
deleteWorkflowStep edit one node at a time,
which is what an agent adding a branch to an existing workflow wants.
replaceWorkflowFromText writes the whole graph
from the indented document the UI's text mode uses (two spaces per level, alternating
- agent:<workspace> /
- event:<name> lines) — what
anything declarative wants, since an extension reconciling what it declared against
what exists compares two documents rather than diffing a graph node by node.
getWorkflowText reads that same document back;
both paths go through the same controller and the same rules, so neither is a shortcut past
the other.
What the server checks
| Rule | Detail |
|---|---|
| Partial updates | updateWorkflow
only changes the fields you send — a name-only edit does not detach the
workflow from its start event. |
| Cycle check | A step's emitEventId
cannot chain the graph back into an event it already reacts to — the
server rejects the cycle rather than looping a workflow into itself. |
| Text mode is resolved atomically | replaceWorkflowFromText
resolves every event and workspace name in the document before writing
anything — an unknown name on the last line leaves the workflow
untouched. |
| Deleted names are skipped, not broken | getWorkflowText
leaves out steps naming a deleted event or workspace, so the document it
returns always parses. |
| Ownership | The workflow, the events it names and the workspaces its steps point at must all belong to you. Anything else comes back as not found. |
Available Tools
Workspace Management
listWorkspaces
List all workspaces you have access to.
| Name | Type | Required | Description |
|---|---|---|---|
includeArchived |
boolean | optional | Include archived workspaces. Default: false |
{ workspaces: Workspace[] } — each with id, name, description, agentConnected, mcpUrl, and more.const { workspaces } = await listWorkspaces();
// -> [ { id: "0eCTDeDXETx", name: "billing-service", agentConnected: true, ... }, ... ]
createWorkspace
Create a new isolated environment dynamically.
| Name | Type | Required | Description |
|---|---|---|---|
name |
string | required | Workspace name |
description |
string | optional | Shown on the dashboard and to the agent as mission context |
notificationSettings |
object | optional | Per-event toggles (taskCreated, taskStatusUpdated, ...) and delivery channels |
selfLearningLoopNote |
string | optional | A note the workspace keeps for its own self-learning loop |
{ workspace: Workspace } — includes the new workspace’s own mcpUrl, the per-workspace MCP endpoint an agent connects to next.const { workspace } = await createWorkspace({
name: "billing-service",
description: "Stripe webhook handling and invoice reconciliation.",
});
console.log(workspace.id, workspace.mcpUrl);
// "0eCTDeDXETx" "https://mcp.agentrq.com/mcp/0eCTDeDXETx"
getWorkspace
Fetch detailed metadata for a specific workspace.
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | required | Workspace ID (base62 or integer) |
{ workspace: Workspace }.const { workspace } = await getWorkspace({ id: "0eCTDeDXETx" });
console.log(workspace.name, workspace.agentConnected);
updateWorkspace
Update name, description, or notification settings.
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | required | Workspace ID |
name |
string | optional | Only sent if it should change |
description |
string | optional | Only sent if it should change |
notificationSettings |
object | optional | Only sent if it should change |
selfLearningLoopNote |
string | optional | Only sent if it should change |
{ workspace: Workspace } — the full object after the update.await updateWorkspace({
id: "0eCTDeDXETx",
selfLearningLoopNote: "Prefer Stripe test-mode keys unless told otherwise.",
});
getWorkspaceStats
Fetch task performance and activity metrics.
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | required | Workspace ID |
range |
"7d" | "30d" | required | Time range, strictly one of these two strings |
from |
integer | optional | Unix timestamp, for a custom range |
to |
integer | optional | Unix timestamp, for a custom range |
{ summary, timeseries, heatmap } — summary counts (tasksCompleted, manualApprovals, autoApprovals, denies, ...), daily timeseries, and an hour/day activity heatmap.const stats = await getWorkspaceStats({ id: "0eCTDeDXETx", range: "7d" });
console.log(stats.summary.tasksCompleted, stats.summary.autoApprovals);
Task Discovery & Retrieval
listAllTasks
Search and filter tasks across all workspaces globally.
| Name | Type | Required | Description |
|---|---|---|---|
filter |
string | optional | Free-text search over title/body |
status |
string | optional | One status to filter by |
createdBy |
string | optional | "human" or "agent" |
limit |
integer | optional | Max tasks to return. Default 5, capped at 50 |
offset |
integer | optional | Number of tasks to skip |
{ tasks: Task[] }.const { tasks } = await listAllTasks({ status: "blocked", limit: 20 });
// every blocked task across every workspace you own
listTasks
List tasks for a specific workspace ID.
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | required | Workspace to list tasks from |
filter |
string | optional | Free-text search over title/body |
status |
string | optional | One status to filter by |
createdBy |
string | optional | "human" or "agent" |
limit |
integer | optional | Max tasks to return. Default 5, capped at 50 |
offset |
integer | optional | Number of tasks to skip |
{ tasks: Task[] }.const { tasks } = await listTasks({ workspaceId: "0eCTDeDXETx", status: "ongoing" });
getTask
Fetch a single task with full message history.
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | required | The task’s workspace |
taskId |
string | required | Task to fetch |
{ task: Task } — the full object, including messages, toolCalls and attachments (unlike the list tools above, which omit these).const { task } = await getTask({ workspaceId: "0eCTDeDXETx", taskId: "0ZRgCquBZ7R" });
console.log(task.status, task.messages.length);
Task Lifecycle & Controls
createTask
Create tasks in any workspace (requires workspaceId).
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | required | Workspace the task is created in |
title |
string | required | Task title |
body |
string | optional | Task body |
assignee |
"human" | "agent" | optional | Default: human here — the opposite of the default on the per-workspace MCP’s createTask, which defaults to agent |
cronSchedule |
string | optional | 5-field cron. Recurring (wildcard dom/month) is hourly at most; a fixed dom and month allows minute precision and makes it one-time |
parentId |
string | optional | Parent task ID, to create a subtask |
{ task: Task }.assignee here creates the task for a human, not an agent — a supervisor is usually creating work for a person to look at, not for itself.const { task } = await createTask({
workspaceId: "0eCTDeDXETx",
title: "Review: Stripe webhook signature check",
body: "Verify the new endpoint rejects unsigned payloads.",
assignee: "agent",
});
console.log(task.id); // "0ZRgCquBZ7R"
updateTaskStatus
Transition tasks through lifecycle states.
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | required | The task’s workspace |
taskId |
string | required | Task to update |
status |
"notstarted" | "ongoing" | "blocked" | "completed" | "rejected" | "cron" | required | The new status |
{ task: Task }.await updateTaskStatus({ workspaceId: "0eCTDeDXETx", taskId: "0ZRgCquBZ7R", status: "completed" });
updateTaskAssignee
Reassign tasks between humans and agents.
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | required | The task’s workspace |
taskId |
string | required | Task to update |
assignee |
"agent" | "human" | required | Who the task is assigned to |
{ task: Task }.await updateTaskAssignee({ workspaceId: "0eCTDeDXETx", taskId: "0ZRgCquBZ7R", assignee: "human" });
updateTaskOrder
Adjust task priority/sort order on the dashboard.
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | required | The task’s workspace |
taskId |
string | required | Task to reorder |
sortOrder |
number | required | New sort position |
{ task: Task }.await updateTaskOrder({ workspaceId: "0eCTDeDXETx", taskId: "0ZRgCquBZ7R", sortOrder: 1.5 });
updateTaskAllowAll
Toggle "YOLO Mode" (automatic command approval).
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | required | The task’s workspace |
taskId |
string | required | Task to update |
allowAll |
boolean | required | true lets the task run commands without asking for permission |
{ task: Task }.await updateTaskAllowAll({ workspaceId: "0eCTDeDXETx", taskId: "0ZRgCquBZ7R", allowAll: true });
updateScheduledTask
Manage cron-based or recurring agent tasks.
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | required | The task’s workspace |
taskId |
string | required | Scheduled task to update |
title |
string | optional | Only sent if it should change |
body |
string | optional | Only sent if it should change |
cronSchedule |
string | optional | Only sent if it should change |
isOneTime |
boolean | optional | Accepted by the schema, but not read by the server — one-time vs. recurring is inferred from cronSchedule’s own shape (a fixed dom and month makes it one-time), so this has no effect either way |
{ task: Task }.await updateScheduledTask({
workspaceId: "0eCTDeDXETx",
taskId: "0ZRgCquBZ7R",
cronSchedule: "0 9 * * *", // every day at 09:00
});
deleteTask
Delete a task, its messages and attachments. Cannot be undone.
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | required | The task’s workspace |
taskId |
string | required | Task to delete |
task deleted.updateTaskStatus with status: "rejected" instead.await deleteTask({ workspaceId: "0eCTDeDXETx", taskId: "0ZRgCquBZ7R" });
Communication & Interaction
respondToTask
Submit allow/deny responses to human approval tasks.
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | required | The task’s workspace |
taskId |
string | required | Task waiting on a permission request |
action |
"allow" | "allow_all" | "reject" | "text" | required | The decision. Note: it’s reject, not deny |
text |
string | optional | Free text, used with action: "text" to reply without deciding |
{ task: Task }.await respondToTask({ workspaceId: "0eCTDeDXETx", taskId: "0ZRgCquBZ7R", action: "allow" });
replyToTask
Post messages to any task thread remotely.
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | required | The task’s workspace |
taskId |
string | required | Task thread to post to |
text |
string | required | Message text |
{ task: Task }.await replyToTask({ workspaceId: "0eCTDeDXETx", taskId: "0ZRgCquBZ7R", text: "Checked the logs — looks clean." });
Media & Data
getAttachment
Download files and metadata from any workspace.
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | required | The attachment’s workspace |
attachmentId |
string | required | Attachment to fetch |
{ Data, Filename, MimeType } — Data is base64.const att = await getAttachment({ workspaceId: "0eCTDeDXETx", attachmentId: "att_abc123" });
const content = Buffer.from(att.Data, "base64");
Workspace Memory
listMemories
List a workspace’s memories: name, size, and when each was last changed. Content is not included — get one by name for that.
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | required | Workspace to list memories from |
{ memories: Memory[] } — each with id, name, sizeBytes, createdAt, updatedAt. content is omitted.const { memories } = await listMemories({ workspaceId: "0eCTDeDXETx" });
// [ { name: "MEMORY.md", sizeBytes: 1204, ... }, { name: "feedback-testing.md", ... } ]
getMemory
Get one of a workspace’s memories in full, by name. MEMORY.md is the index the others hang off.
| Name | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | required | Workspace the memory belongs to |
name |
string | required | The memory’s name, as listMemories reports it |
{ memory: Memory } — includes content in full.const { memory } = await getMemory({ workspaceId: "0eCTDeDXETx", name: "MEMORY.md" });
console.log(memory.content);
Events
listEvents
List the events defined for this account.
{ events: Event[] }.const { events } = await listEvents();
createEvent
Define a named signal workspaces can publish and triggers can react to.
| Name | Type | Required | Description |
|---|---|---|---|
name |
string | required | Lowercase and unique for this account: ^[a-z][a-z0-9_]{0,128}$ |
payloadGuidelines |
string | optional | What a publisher should put in the payload. Shown to the agent that publishes this event |
{ event: Event }.const { event } = await createEvent({
name: "qa_passed",
payloadGuidelines: "Include the build number and the pass/fail counts.",
});
console.log(event.id); // "0hNRmEWoU5Z"
getEvent
Fetch a single event by ID.
| Name | Type | Required | Description |
|---|---|---|---|
eventId |
string | required | Event ID (base62) |
{ event: Event }.const { event } = await getEvent({ eventId: "0hNRmEWoU5Z" });
updateEvent
Revise an event’s payload guidelines. Its name is fixed once created.
| Name | Type | Required | Description |
|---|---|---|---|
eventId |
string | required | Event to update |
payloadGuidelines |
string | required | Replaces the current guidelines entirely |
{ event: Event }.await updateEvent({ eventId: "0hNRmEWoU5Z", payloadGuidelines: "Also include the git SHA." });
deleteEvent
Delete an event. Its triggers stop firing.
| Name | Type | Required | Description |
|---|---|---|---|
eventId |
string | required | Event to delete |
event deleted.await deleteEvent({ eventId: "0hNRmEWoU5Z" });
listEventTasks
List the tasks an event has spawned, to see whether a wired-up system is running.
| Name | Type | Required | Description |
|---|---|---|---|
eventId |
string | required | Event to inspect |
{ tasks: Task[] }.const { tasks } = await listEventTasks({ eventId: "0hNRmEWoU5Z" });
Event Triggers
createEventTrigger
When an event fires, create a task in a workspace. Supports placeholders and event chaining.
| Name | Type | Required | Description |
|---|---|---|---|
eventId |
string | required | The event this trigger listens to |
workspaceId |
string | required | The workspace the task is created in |
title |
string | required | Used exactly as written — placeholders are not substituted here |
body |
string | optional | {{EVENT_PAYLOAD}} and {{EVENT_FAQ}} are replaced with what the publisher sent |
assignee |
"agent" | "human" | optional | Default: agent |
cronSchedule |
string | optional | For the spawned task. Hourly granularity at most |
allowAllCommands |
boolean | optional | Let the spawned task run commands without asking for permission |
emitEventId |
string | optional | Event to publish when the spawned task completes |
{ eventTrigger: EventTrigger }.const { eventTrigger } = await createEventTrigger({
eventId: "0hNRmEWoU5Z",
workspaceId: "0eCTDeDXETx",
title: "Ship the release",
body: "QA signed off:\n{{EVENT_PAYLOAD}}",
emitEventId: "0hDXw48jLfd",
});
listEventTriggers
List the triggers attached to an event — everything that happens when it fires.
| Name | Type | Required | Description |
|---|---|---|---|
eventId |
string | required | Event to inspect |
{ eventTriggers: EventTrigger[] }.const { eventTriggers } = await listEventTriggers({ eventId: "0hNRmEWoU5Z" });
getEventTrigger
Fetch a single event trigger by ID.
| Name | Type | Required | Description |
|---|---|---|---|
triggerId |
string | required | Event trigger ID (base62) |
{ eventTrigger: EventTrigger }.const { eventTrigger } = await getEventTrigger({ triggerId: "0hTr16erABC" });
updateEventTrigger
Rewrite a trigger. Every field is written as given, so send the ones to keep too.
| Name | Type | Required | Description |
|---|---|---|---|
triggerId |
string | required | Trigger to rewrite |
workspaceId |
string | required | The workspace the task is created in |
title |
string | required | Used exactly as written |
body |
string | optional | Supports {{EVENT_PAYLOAD}} / {{EVENT_FAQ}} |
assignee |
"agent" | "human" | optional | Default: agent |
cronSchedule |
string | optional | Hourly granularity at most |
allowAllCommands |
boolean | optional | Let the spawned task run commands without asking for permission |
emitEventId |
string | optional | Event to publish when the spawned task completes |
{ eventTrigger: EventTrigger }.await updateEventTrigger({
triggerId: "0hTr16erABC",
workspaceId: "0eCTDeDXETx",
title: "Ship the release", // unchanged fields must still be sent
body: "QA signed off:\n{{EVENT_PAYLOAD}}",
emitEventId: "0hDXw48jLfd",
});
deleteEventTrigger
Delete a trigger, leaving its event in place.
| Name | Type | Required | Description |
|---|---|---|---|
triggerId |
string | required | Trigger to delete |
event trigger deleted.await deleteEventTrigger({ triggerId: "0hTr16erABC" });
Workflows
listWorkflows
List the workflows defined for this account.
{ workflows: Workflow[] }.const { workflows } = await listWorkflows();
createWorkflow
Create an empty workflow around a start event. Add steps afterwards, one at a time or as a whole document.
| Name | Type | Required | Description |
|---|---|---|---|
name |
string | required | Workflow name |
description |
string | optional | What the workflow does |
startEventId |
string | optional | The event that starts this workflow. Its steps hang off this one |
{ workflow: Workflow }.const { workflow } = await createWorkflow({
name: "release-pipeline",
startEventId: "0hNRmEWoU5Z",
});
console.log(workflow.id); // "0hWfK92pXqL"
getWorkflow
Fetch a single workflow by ID.
| Name | Type | Required | Description |
|---|---|---|---|
workflowId |
string | required | Workflow ID (base62) |
{ workflow: Workflow }.const { workflow } = await getWorkflow({ workflowId: "0hWfK92pXqL" });
updateWorkflow
Revise a workflow’s name, description, start event, or canvas layout. Only the fields sent are changed.
| Name | Type | Required | Description |
|---|---|---|---|
workflowId |
string | required | Workflow to update |
name |
string | optional | Only sent if it should change |
description |
string | optional | Only sent if it should change |
startEventId |
string | optional | Only sent if it should change |
layout |
string | optional | Canvas positions, as the UI stores them. Leave this out unless you are moving nodes |
{ workflow: Workflow }.await updateWorkflow({ workflowId: "0hWfK92pXqL", description: "QA sign-off through to deploy." });
deleteWorkflow
Delete a workflow and its steps. The events it named are left alone.
| Name | Type | Required | Description |
|---|---|---|---|
workflowId |
string | required | Workflow to delete |
workflow deleted.await deleteWorkflow({ workflowId: "0hWfK92pXqL" });
createWorkflowStep
Add a step: when this event fires, create a task in this workspace, and optionally emit a second event when that task completes.
| Name | Type | Required | Description |
|---|---|---|---|
workflowId |
string | required | Workflow to add the step to |
eventId |
string | required | The event this step reacts to |
workspaceId |
string | required | The workspace the step’s task is created in |
title |
string | required | Used exactly as written — placeholders are not substituted here |
body |
string | optional | {{EVENT_PAYLOAD}} and {{EVENT_FAQ}} are replaced with what the publisher sent |
assignee |
"agent" | "human" | optional | Default: agent |
allowAllCommands |
boolean | optional | Let the spawned task run commands without asking for permission |
emitEventId |
string | optional | Event to publish when this step’s task completes |
{ workflowStep: WorkflowStep }.await createWorkflowStep({
workflowId: "0hWfK92pXqL",
eventId: "0hNRmEWoU5Z",
workspaceId: "0eCTDeDXETx",
title: "Ship the release",
body: "QA signed off:\n{{EVENT_PAYLOAD}}",
emitEventId: "0hDXw48jLfd",
});
listWorkflowSteps
List a workflow’s steps — everything that happens once it starts.
| Name | Type | Required | Description |
|---|---|---|---|
workflowId |
string | required | Workflow to inspect |
{ workflowSteps: WorkflowStep[] }.const { workflowSteps } = await listWorkflowSteps({ workflowId: "0hWfK92pXqL" });
deleteWorkflowStep
Remove one step from a workflow, leaving the rest of the graph in place.
| Name | Type | Required | Description |
|---|---|---|---|
workflowId |
string | required | Workflow the step belongs to |
stepId |
string | required | Workflow step ID (base62) |
workflow step deleted.await deleteWorkflowStep({ workflowId: "0hWfK92pXqL", stepId: "0hStPq9zXYZ" });
listWorkflowTasks
List the tasks a workflow has spawned, to see whether a wired-up system is running.
| Name | Type | Required | Description |
|---|---|---|---|
workflowId |
string | required | Workflow to inspect |
{ tasks: Task[] }.const { tasks } = await listWorkflowTasks({ workflowId: "0hWfK92pXqL" });
getWorkflowText
Read a workflow’s whole graph as the indented document the UI’s text mode edits.
| Name | Type | Required | Description |
|---|---|---|---|
workflowId |
string | required | Workflow to read |
- agent:<workspace> / - event:<name> lines. Steps naming a deleted event or workspace are left out, so it always parses.const text = await getWorkflowText({ workflowId: "0hWfK92pXqL" });
console.log(text);
// - event:qa_passed
// - agent:billing-service
// - event:deploy_finished
replaceWorkflowFromText
Replace a workflow’s entire graph with a document. Every name is resolved before anything is written.
| Name | Type | Required | Description |
|---|---|---|---|
workflowId |
string | required | Workflow to overwrite |
text |
string | required | The whole graph as an indented document. Events and workspaces are named, so they must already exist |
{ workflow: Workflow, stepCount: number }.await replaceWorkflowFromText({
workflowId: "0hWfK92pXqL",
text: `- event:qa_passed
- agent:billing-service
- event:deploy_finished`,
});
Machines
createEnrolmentCode
Mint a one-time code for enrolling a new machine with agentrqd. Shown once, and expires shortly.
{ code: string, expiresAt: string, enrolCommand: string } — enrolCommand is the full agentrqd enroll command, ready to hand to whoever is at the machine.enrolCommand on the target machine themselves, after installing agentrqd from agentrq.com/docs/daemon.const { code, enrolCommand } = await createEnrolmentCode();
// enrolCommand: "agentrqd enroll --server https://agentrq.example --code AB12CD34"