You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 21955e0
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: apps/docs/content/docs/workflows/code/edit.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ Editing the name or description in `workflow('…')` renames or redescribes the
76
76
77
77
### Deploy
78
78
79
-
Saving writes the draft. Add `--deploy` to deploy right after the save, which also prints the URL of each webhook the workflow now serves. Add `--run '<input json>'` to dry-run the saved draft with that input first: with `--deploy`, it deploys only if the run completed. Without `--deploy`, a deployed workflow whose draft now differs prints the next command: the same apply with `--run` and `--deploy`, or `sim workflows deploy` after a completed run.
79
+
Saving writes the draft. Add `--deploy` to deploy right after the save, which also prints the URL of each webhook the workflow now serves. Add `--run '<input json>'` to dry-run the saved draft with that input first: with `--deploy`, it deploys only if the run completed. Without `--deploy`, a deployed workflow whose draft now differs prints the `sim workflows deploy`command to run, pinned to the draft this apply saved; after an apply without `--run`, it also names the apply that tests and deploys in one step.
Copy file name to clipboardExpand all lines: packages/sim-cli/src/commands/protocol/workflow-dir.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -254,7 +254,7 @@ Batch it: write every file first, then run steps 2 and 4 (with a test run and th
254
254
1. Edit \`${SOURCE_ENTRY_FILE}\` (and \`functions/*\`). \`${SOURCE_EXAMPLES_DIR}/\` holds correct examples to copy from: \`cookbook.ts\` (agent with structured output, condition, function, table query and upsert, knowledge search, Slack, human in the loop, loop, response), \`integrations.ts\` (webhook trigger, weekday cron schedule, HTTP request with headers, table update by row id, Gmail, an error path) and \`agents.ts\` (router, agent tools: custom tool, MCP tool, integration operation, child workflow; run a child workflow; parallel). Their resource keys are examples; this workspace's are in \`${WORKSPACE_TYPES_FILE}\`.
255
255
2. \`sim workflows source check --dir .\`: compiles with the server's compiler, in milliseconds and without a request. It catches what \`tsc\` cannot (duplicate names, cycles, literal secrets), and fails (exit 1) on ${STRICT_FINDINGS_CLAUSE} in a block you added (\`--strict\`: in every block). It then adds the blocks the source now uses to \`tsconfig.json\` and type-checks with it, using the TypeScript release the declarations are built for (installed once into the CLI's cache, on the first check; \`E_TYPE\` findings). That catches what the compile and \`apply --dry\` do not, such as a reference to a start input the trigger does not declare. Offline before that install, it warns \`W_TYPES_UNCHECKED\` and passes on the compile alone; \`--no-types\` skips it. \`apply --dry\` is the authority: a type error on a printed line you did not edit that it accepts can be skipped with \`--no-types\`.
256
256
3. \`sim workflows source status --dir .\`: the files you changed (\`sim workflows source diff --dir .\` shows the edits), whether the workflow changed on the server since the get, and the command to run next (\`--offline\`: skip the server). Then \`sim workflows source apply --dir . --dry\` until it exits 0.
257
-
4. \`sim workflows source apply --dir . --yes\`: saves the draft, refusing errors, block deletions without \`--allow-delete\` and a stale directory, so it needs no separate dry run (without \`--yes\` and a terminal it prints the plan and exits ${SOURCE_PLANNED_EXIT_CODE}). \`--run '{…}'\` then dry-runs that input on the saved draft (\`run\` in the result: status, output, side effects; a failed run exits 1 and maps the failing block to file:line), and \`--deploy\` deploys it only if that run completed (alone, it deploys right after the apply). Without \`--deploy\`, a deployed workflow's next is that same apply with \`--run '<input json>' --deploy\`, or \`sim workflows deploy <id> --expected-draft-fingerprint <fingerprint>\` after a completed \`--run\`; both deploy only the draft this apply saved. Its first line, \`summary\`, gives the counts, findings, test run and what is live; its last lines repeat \`errors\`, \`warnings\` and \`live\`, which says what serves: \`not deployed\`, \`version N, matches the draft\`, \`version N, draft has undeployed changes\`, or after \`--deploy\` \`version N still serving; version M activating\` until the deploy is live (\`sim workflows deployment status <id>\` shows when). It then rewrites \`${SOURCE_ENTRY_FILE}\` in canonical form (order, quoting, defaults left out).
257
+
4. \`sim workflows source apply --dir . --yes\`: saves the draft, refusing errors, block deletions without \`--allow-delete\` and a stale directory, so it needs no separate dry run (without \`--yes\` and a terminal it prints the plan and exits ${SOURCE_PLANNED_EXIT_CODE}). \`--run '{…}'\` then dry-runs that input on the saved draft (\`run\` in the result: status, output, side effects; a failed run exits 1 and maps the failing block to file:line), and \`--deploy\` deploys it only if that run completed (alone, it deploys right after the apply). Without \`--deploy\`, a deployed workflow's next is \`sim workflows deploy <id> --expected-draft-fingerprint <fingerprint>\`, which deploys only the draft this apply saved; after an apply without \`--run\` its reason names the same apply with \`--run '{…}' --deploy\`, which tests and deploys in one step. Its first line, \`summary\`, gives the counts, findings, test run and what is live; its last lines repeat \`errors\`, \`warnings\` and \`live\`, which says what serves: \`not deployed\`, \`version N, matches the draft\`, \`version N, draft has undeployed changes\`, or after \`--deploy\` \`version N still serving; version M activating\` until the deploy is live (\`sim workflows deployment status <id>\` shows when). It then rewrites \`${SOURCE_ENTRY_FILE}\` in canonical form (order, quoting, defaults left out).
258
258
5. Exit ${SOURCE_STALE_EXIT_CODE} (\`SOURCE_STALE\`, HTTP 409, or \`E_APPLY_STALE\` on a dry run): the workflow changed and nothing was saved. Run \`sim workflows source get <workflowId> --dir <fresh dir>\`, reapply your edit there, dry-run, apply. A get into this directory refuses to overwrite your unapplied edits unless you pass \`--force\`. Exit ${SOURCE_STALE_EXIT_CODE} right after an apply that ended without an answer (a timeout, a dropped connection) means the draft changed, by that apply or by someone else: get into a fresh directory and compare. Only when it holds your edit, run \`sim workflows source get <workflowId> --dir . --force\`; otherwise reapply your edit in the fresh directory.
259
259
260
260
Editing the \`workflow('…')\` name or description renames or redescribes the workflow; a name another workflow in its folder holds is refused with \`E_NAME_TAKEN\`. Lines starting \`note:\` explain something the write did differently than the source says; read them.
reason: `The workflow is deployed and its draft now differs from the live version: this tests the saved draft with that input and deploys it only if the run completes (\`${deployCommand}\` deploys it untested).`,
482
-
},
483
-
}
484
-
}
485
475
return{
486
476
next: {
487
477
command: deployCommand,
488
-
reason: `The workflow is deployed and its draft now differs from the live version: deploy to make the change live (or ${options.verb} with --deploy).`,
478
+
reason: `The workflow is deployed and its draft now differs from the live version: deploy to make the change live (or ${options.verb} with --deploy).${options.testedDeploy ? ` The draft is untested: \`${options.testedDeploy}\` tests and deploys it in one step.` : ''}`,
0 commit comments