Result: a new workflow created from a file, in the workspace you choose.
Steps
-
Write a starter into an empty directory:
Code Without
--dryor--yesthis creates nothing. It writes a starterworkflow.tswith that workspace's type declarations,tsconfig.jsonand.sim/AGENTS.md, and records the workspace in.sim/starter.json. The file starts with the// @sim-sdk 1line and default-exports oneworkflow('Name', {}, () => { ... }). -
Edit the starter and check it as in Edit a workflow.
-
Create the workflow:
Code The starter prints both commands with its workspace filled in. The command prints the new workflow ID and writes the same type declarations,
tsconfig.json, and.sim/files thatgetwrites, so you can continue editing withapply.
A create goes to the starter's workspace whatever your default workspace, unless --workspace names another. Until the workflow is created the directory has no .sim/base.json, so status, diff and apply refuse it.
If another workflow already has that name, the command exits 1 with SOURCE_NAME_TAKEN; pass --name to choose another. Without --yes and with no terminal to ask, create prints the plan, writes nothing and exits 14.
Fork a workflow
Copy its directory, delete the copy's .sim/, and create it under a new name. A copy has no stored workflow to take a saved secret from, so replace each stored() in the file, which get printed for a value it does not show, with env.NAME or the value; otherwise the create fails with E_STORED_VALUE_MISSING.