Every workflow can be read and written as one TypeScript file, and a whole workspace as a directory of files. The file and the workflow builder show the same workflow: edit either one and the other follows. Use it to review agent changes as a diff, keep workflows in git, or let a coding agent such as Claude Code build and change them for you.
Workflow or workspace
- A workflow is one
workflow.tsplus its function code files. Usesim workflows source. - A workspace is a directory with a folder for each kind of resource: tables, knowledge bases, files, custom tools, skills, MCP servers, secrets and credential bindings, deployments and workflows. Each workflow is written exactly as above. One apply creates the resources before the workflows that use them, so a coding agent can build a working setup from scratch. Use
sim workspaces source.
The file states what the workflow runs: its blocks, their settings, the connections between them, branches, loops, and variables. Layout and other builder-only details stay in the stored workflow, so the file stays short and a change to one setting is a one-line diff. Nothing in the file runs on your machine: Sim reads it statically, checks it against your workspace, and saves it as the workflow draft. Deploying stays a separate step.
The loop
Both commands follow the same five steps:
get writes the directory, check compiles it on your machine, status shows what changed and what to run next, a dry run checks everything a save checks, and apply --yes saves the draft.
Terms
- As code names the feature; source names its files and commands.
- A workflow directory is the directory
sim workflows source getwrites; a workspace directory is the onesim workspaces source getwrites. - Get reads from Sim and apply writes to Sim. Neither is a sync: fork, push and pull are a different feature.
- Check compiles offline. A dry run asks the server and saves nothing. The plan is what a dry run prints.
- Stale means an apply was refused because the server changed what you read (exit
5). Drift means the server changed since the get (statusexits12). A conflict is a resource changed on both sides. - A resource key is the file or folder name of a table, skill or other resource. A block key is a block's name lowercased with whitespace and dots removed, as in
$ref.triageagent.content.
For coding agents
Claude Code, Cursor, Codex and other coding agents work from a directory that get writes. get prints a summary with the edit loop and writes the primer and full guide to .sim/AGENTS.md. See Use with coding agents.
Related docs
- Get started: change one setting and see it in the builder
- Edit a workflow
- Manage a workspace as code
- Run in CI
- Bring existing workflows into code
- Troubleshooting
- How it works
- File syntax
- Exit codes, diagnostic codes and limits
- CLI workflow commands and workspace commands