Agent Workflow Operating Manual
Use this page when an agent needs to build or revise a Tandem workflow without guessing at hidden tools or undocumented runtime behavior.
First-time engine setup
If Tandem is not installed or the engine is not authenticated yet, help the user get to a working engine first. Do not jump into workflow compilation until the engine is reachable and the token source is clear.
Use the smallest setup path that matches the user’s environment:
- CLI only or headless engine: install the CLI binaries, generate a token, and start
tandem-engine serve. - Packaged control panel: install the panel, run
tandem panel init, and use the token the panel writes into its environment. - Desktop app: open the desktop app, verify the local engine/sidecar is running, and confirm the workspace and provider are configured.
If the user is on a clean machine, point them to:
Token rules:
- For direct engine access, use
TANDEM_API_TOKENor--api-tokenwithtandem-engine serve. - For the packaged control panel flow, use the
TANDEM_CONTROL_PANEL_ENGINE_TOKENcreated bytandem panel init. - Do not scan arbitrary files or shell history for secrets.
- Before workflow work begins, verify the engine with a health check such as
GET /global/health.
Agent creation permissions
An agent still needs a valid engine token, but actor classification adds one more gate:
x-tandem-agent-ididentifies the creating agentx-tandem-request-sourcedetermines whether Tandem applies agent-specific governance checks
Control panel automation calls default to control_panel, which is treated as human for safety.
Use a dedicated test path when you need the engine to enforce agent creation rules (AUTOMATION_V2_AGENT_* and
AUTOMATION_V2_CAPABILITY_ESCALATION_*).
Operating order
- Call
mcp_listfirst. - If the required MCP server or tool is missing, stop and tell the user to add or connect it.
- Decide whether the task is:
- a new generated workflow
- a revision of an existing planner session
- an import of a shared bundle
- a repair of a failed run
- Ask clarifying questions only when the answer changes compilation, scheduling, or tool access.
- Preview before applying.
- Apply only when the user or agent has confirmed the result is ready to persist.
- Schedule recurring work only after the workflow is durable.
- Repair or recover runs instead of rebuilding the whole workflow when the failure is local.
- If the task turns into code edits, follow Coding Tasks With Tandem for the workspace, diff, and verification loop.
If the task is a governed recursive automation or a Self-Operator loop, also follow Self-Operator Playbook and Automation Governance Lifecycle.
What to ask before compiling
Ask only the questions that change the plan:
- Is this one-off or recurring?
- Should the result become a saved workflow session, a runnable automation, or both?
- Which MCP servers are allowed?
- Should failures pause, retry, degrade, or continue?
- Is this a fresh workflow, an import, a fork, or a repair?
- Should schedule data stay staged until apply?
If the answer requires an unavailable MCP, stop and say so.
Build and revise
Use the planner loop when the intent is still fuzzy:
POST /workflow-plans/previewPOST /workflow-plans/chat/startPOST /workflow-plans/chat/messagePOST /workflow-plans/apply
When revising, preserve the existing session and refine the draft instead of starting over.
Import and reopen
Use imports when the workflow already exists as a bundle.
- Preview the bundle with
POST /workflow-plans/import/preview. - Check
import_validation.compatible. - Import with
POST /workflow-plans/import. - Reopen the stored planner session from the Workflow Center.
- Revise the imported draft before applying it.
Imported workflows are durable planner sessions, not runnable automations yet.
Schedule
Only schedule after the workflow is durable.
- One-off work should stay manual or run once.
- Recurring work should use the automation schedule fields.
- Imported schedules should be treated as staged until apply.
Repair and recover
Use repair surfaces when the run failed locally:
- recover paused or blocked runs
- repair the broken node or subtree
- inspect the run checkpoint and failure metadata
Do not throw away a valid workflow just because one stage failed.
Provenance
Agents should preserve and read provenance:
- source kind
- source bundle digest
- planner session id
- current plan id
- automation id
- run id
For the schema-level governance model behind those records, see Governance Reference. For the concrete review and pause state machine, see Automation Governance Lifecycle.
If you are helping a user find an older workflow, search from the Workflow Center first.
Minimal example
const inventory = await client.mcp.list();if (!inventory?.servers?.some((server: any) => server.name === "slack")) { throw new Error("Add the Slack MCP before compiling this workflow.");}
const preview = await client.workflowPlans.chatStart({ prompt: "Create a recurring workflow that summarizes failed runs and posts them to Slack.", planSource: "agent_workflow_manual", workspaceRoot: "/workspace/repos/tandem",});
const applied = await client.workflowPlans.apply({ planId: preview.plan.plan_id!, creatorId: "workflow-agent",});What not to do
- Do not invent tools that are not in
mcp_list. - Do not apply a workflow before validating it.
- Do not arm a recurring schedule on import without showing the user.
- Do not rebuild a failed workflow from scratch when repair or recover is enough.