This walks through one change end to end: read a workflow as a file, edit it, check it, save it, and see the result in the workflow builder.
Before you start
- Workflows as code is enabled for your workspace. Where it is not, step 2 answers
403. - The Sim CLI is installed and you are signed in with a default workspace. See Your first command.
- Optional: npm (Node.js), which the type check in step 4 uses once to install TypeScript; without it
checkreportsW_TYPES_UNCHECKEDand the compile still runs.
1. Find the workflow ID
2. Read it as a file
This writes workflow.ts, the type declarations, and .sim/, which records which block is which. See Directory layout.
3. Change one setting
Open workflow.ts and change one value, such as an agent's model or a message's text. Each const is a block, and a change to one setting is a one-line diff. The forms you can write are in File syntax.
4. Check it
check compiles the file on your machine and type-checks it. Each problem prints with its line, the code around it, and a hint. The first check installs the TypeScript release the declarations are built for, once.
5. See what changed
status lists your edits, asks the server whether the workflow changed since the get, and ends with the one command to run next.
6. Save the draft
The dry run runs every check a save runs and writes nothing. --yes saves the draft and rewrites workflow.ts in canonical form, so read it again before the next edit.
7. See it in the builder
Open the workflow in the workflow builder. It shows your change, and updates for anyone who has the workflow open. The Code tab shows the same workflow as read-only source. Saving writes the draft only: deploy it when you are ready.
Create a new workflow
See Create a workflow.