diff --git a/.claude/rules/sim-workflow-code.md b/.claude/rules/sim-workflow-code.md index d7435063c05..24d4b87b2d8 100644 --- a/.claude/rules/sim-workflow-code.md +++ b/.claude/rules/sim-workflow-code.md @@ -48,6 +48,17 @@ workspace directory). | `apps/sim/blocks/sdk-names/.json` | Frozen SDK builder names, one file per block type | | `apps/sim/app/workspace/**/panel/components/code/` | The read-only Code tab | +Public docs live in `apps/docs/content/docs/workflows/code/`. The exit-code, diagnostic-code, limit +and per-kind layout tables of `exit-codes.mdx`, `diagnostics.mdx`, `limits.mdx` and `directory.mdx` sit between +`workflow-code-docs` markers and come from their owners (`source-exit-codes.ts`, SYNTAX.md and `workspace-code`'s +`diagnostics/codes.ts` TSDoc, the `*_LIMITS` constants, `WORKSPACE_KIND_SPECS`): edit the owner, then run +`bun run generate:workflow-code-docs` (`check:workflow-code-docs` fails on drift, a diagnostic code a page names that +no engine emits, a limit or diagnostic code with no docs entry, and a `typescript@x.y.z` pin other than the CLI's). +A limit also needs a label in the generator's `WORKFLOW_LIMIT_LABELS` or `WORKSPACE_LIMIT_LABELS`. +A new exit code also needs a `[#exit-]` section in `troubleshooting.mdx`, which the same check requires +for every non-zero code `sourceExitCodeRows` lists. Behaviour a user relies on (identity, stale, the three-way rule, +promotion) is explained once, in `how-it-works.mdx`; change it there when an engine changes it. + Dependencies point one way: `packages/workflow-types` → `packages/workflow-code` → `packages/workspace-code` and `packages/workflow-sdk` → the CLI and `apps/sim`. `check:boundaries` keeps both engines and `packages/table-cells` pure (no Node built-ins, `eval`, `globalThis`, dynamic import): they run in the browser, the CLI and the @@ -198,7 +209,7 @@ changed. | `.sim/base.json` (workspace) | `version: 1` | Same policy | | `workflow_source_meta` | `version: 1` | Same policy; a bump needs a data migration | | Fingerprints | `sf1:` (workflow), `rf1:` (resource) | Any change to canonicalize or a kind's `canonical()` output changes every stored fingerprint and makes every checkout stale; treat it as a format change | -| SDK surface | `// @sim-sdk 1`, `SDK_MAJOR`, `OLDEST_SDK_MAJOR` | Compile refuses a newer major and reads down to the floor | +| SDK surface | `// @sim-sdk 1`, `SDK_MAJOR` | Compile refuses any major but the server's | | `apps/sim/blocks/sdk-names/` | append-only | Never rename or remove a name | Nothing upgrades an old version: a bump is a hard refusal until a migration exists. A lock or base diff --git a/.cursor/rules/sim-workflow-code.mdc b/.cursor/rules/sim-workflow-code.mdc index 77d1474b0f1..100c3bdefe5 100644 --- a/.cursor/rules/sim-workflow-code.mdc +++ b/.cursor/rules/sim-workflow-code.mdc @@ -28,6 +28,17 @@ workspace directory). | `apps/sim/blocks/sdk-names/.json` | Frozen SDK builder names, one file per block type | | `apps/sim/app/workspace/**/panel/components/code/` | The read-only Code tab | +Public docs live in `apps/docs/content/docs/workflows/code/`. The exit-code, diagnostic-code, limit +and per-kind layout tables of `exit-codes.mdx`, `diagnostics.mdx`, `limits.mdx` and `directory.mdx` sit between +`workflow-code-docs` markers and come from their owners (`source-exit-codes.ts`, SYNTAX.md and `workspace-code`'s +`diagnostics/codes.ts` TSDoc, the `*_LIMITS` constants, `WORKSPACE_KIND_SPECS`): edit the owner, then run +`bun run generate:workflow-code-docs` (`check:workflow-code-docs` fails on drift, a diagnostic code a page names that +no engine emits, a limit or diagnostic code with no docs entry, and a `typescript@x.y.z` pin other than the CLI's). +A limit also needs a label in the generator's `WORKFLOW_LIMIT_LABELS` or `WORKSPACE_LIMIT_LABELS`. +A new exit code also needs a `[#exit-]` section in `troubleshooting.mdx`, which the same check requires +for every non-zero code `sourceExitCodeRows` lists. Behaviour a user relies on (identity, stale, the three-way rule, +promotion) is explained once, in `how-it-works.mdx`; change it there when an engine changes it. + Dependencies point one way: `packages/workflow-types` → `packages/workflow-code` → `packages/workspace-code` and `packages/workflow-sdk` → the CLI and `apps/sim`. `check:boundaries` keeps both engines and `packages/table-cells` pure (no Node built-ins, `eval`, `globalThis`, dynamic import): they run in the browser, the CLI and the @@ -178,7 +189,7 @@ changed. | `.sim/base.json` (workspace) | `version: 1` | Same policy | | `workflow_source_meta` | `version: 1` | Same policy; a bump needs a data migration | | Fingerprints | `sf1:` (workflow), `rf1:` (resource) | Any change to canonicalize or a kind's `canonical()` output changes every stored fingerprint and makes every checkout stale; treat it as a format change | -| SDK surface | `// @sim-sdk 1`, `SDK_MAJOR`, `OLDEST_SDK_MAJOR` | Compile refuses a newer major and reads down to the floor | +| SDK surface | `// @sim-sdk 1`, `SDK_MAJOR` | Compile refuses any major but the server's | | `apps/sim/blocks/sdk-names/` | append-only | Never rename or remove a name | Nothing upgrades an old version: a bump is a hard refusal until a migration exists. A lock or base diff --git a/.github/actions/image/action.yml b/.github/actions/image/action.yml index b4a3307c990..73654b5fae4 100644 --- a/.github/actions/image/action.yml +++ b/.github/actions/image/action.yml @@ -67,7 +67,7 @@ runs: # under 300 MB, sat at 249 GB. Sticky disks bill at ~$0.51/GB-month. - name: Set up Blacksmith builder if: inputs.provider == '' || inputs.provider == 'blacksmith' - uses: useblacksmith/setup-docker-builder@06dd9c83a5d541274d2e3ac67625560979275267 # v2 + uses: useblacksmith/setup-docker-builder@9657a6e02ca6445e6d6ce5ffaf370f4828dea50d # v2 with: cache-key: ${{ steps.cache-key.outputs.value }} diff --git a/.github/scripts/http-e2e.sh b/.github/scripts/http-e2e.sh index a27b9acd6bb..f67b72a5dbf 100755 --- a/.github/scripts/http-e2e.sh +++ b/.github/scripts/http-e2e.sh @@ -188,7 +188,7 @@ wait_ready() { case "$group" in scim) export NEXT_PUBLIC_FORCE_HOSTED=true - export BILLING_ENABLED=true NEXT_PUBLIC_BILLING_ENABLED=true + export BILLING_ENABLED=true export ENTERPRISE_ENABLED=true export SCIM_ENABLED=true export SSO_ENABLED=true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3505f145e3..c2e4e06a821 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -243,7 +243,7 @@ jobs: - name: Login to Amazon ECR id: login-ecr - uses: aws-actions/amazon-ecr-login@03f1aad4c6c7ffd436567f42f9384779290529bd # v2 + uses: aws-actions/amazon-ecr-login@7290e214a610b32bc0eef81748948b6d466a8783 # v2 - name: Login to Docker Hub uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4 @@ -409,7 +409,7 @@ jobs: - name: Login to Amazon ECR id: login-ecr - uses: aws-actions/amazon-ecr-login@03f1aad4c6c7ffd436567f42f9384779290529bd # v2 + uses: aws-actions/amazon-ecr-login@7290e214a610b32bc0eef81748948b6d466a8783 # v2 - name: Login to Docker Hub uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4 @@ -527,7 +527,7 @@ jobs: - name: Login to Amazon ECR id: login-ecr - uses: aws-actions/amazon-ecr-login@03f1aad4c6c7ffd436567f42f9384779290529bd # v2 + uses: aws-actions/amazon-ecr-login@7290e214a610b32bc0eef81748948b6d466a8783 # v2 # Deploy-tag moves must be monotonic: a re-run of an old run must never # retag latest/staging back to stale code. A superseded first-attempt diff --git a/.github/workflows/docs-negotiation.yml b/.github/workflows/docs-negotiation.yml index d1098a5f4f9..8e9cf5b492a 100644 --- a/.github/workflows/docs-negotiation.yml +++ b/.github/workflows/docs-negotiation.yml @@ -388,7 +388,7 @@ jobs: dotnet-version: '8.0.x' - name: Set up Go for copied request examples if: matrix.group == 'http' - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 + uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: go-version: '1.25.x' cache: false diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml index 03c176d3dce..68e538a3bba 100644 --- a/.github/workflows/helm.yml +++ b/.github/workflows/helm.yml @@ -403,7 +403,7 @@ jobs: push-to-registry: true - name: Set up ORAS - uses: oras-project/setup-oras@5e2f2482b30b0cb3e14e67f89a80c88c659a7c63 # v2.0.3 + uses: oras-project/setup-oras@ac735097e22fe643015b0d19645f7c9a69942128 # v2.0.4 # Artifact Hub reads repository metadata from the reserved `artifacthub.io` # tag on the chart's own OCI repository. Pushed on every run, including diff --git a/.github/workflows/publish-sim-cli.yml b/.github/workflows/publish-sim-cli.yml index 7932e49c88d..2d77a608bdf 100644 --- a/.github/workflows/publish-sim-cli.yml +++ b/.github/workflows/publish-sim-cli.yml @@ -40,8 +40,8 @@ jobs: with: persist-credentials: false - # Vitest 5 requires Node 22.12+; the published bundle is still - # smoke-tested on Node 20 below, its minimum supported runtime. + # Vitest 5 requires Node 22.12+; the published bundle is also + # smoke-tested below on Node 22.18.0, its minimum supported runtime. - name: Setup workspace uses: ./.github/actions/setup with: @@ -131,10 +131,10 @@ jobs: working-directory: packages/sim-cli run: bun pm pack --ignore-scripts --filename "$RUNNER_TEMP/package.tgz" --quiet - - name: Setup Node 20 for the bundle smoke test + - name: Setup the minimum supported Node for the bundle smoke test uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 with: - node-version: '20' + node-version: '22.18.0' - name: Smoke-test packed Node bundle env: diff --git a/README.md b/README.md index 390f646094b..a21e9aafb57 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ macOS 12+, Apple Silicon and Intel. See the [desktop docs](https://docs.sim.ai/d ## Security and governance -- SOC 2 Type II, ISO 27001, and GDPR: reports and policies are in the [Trust Center](https://trust.sim.ai/) +- SOC 2 Type II (Security criterion), GDPR, and ISO 27001 certification in progress: reports and policies are in the [Trust Center](https://trust.sim.ai/) - [Single sign-on](https://docs.sim.ai/platform/enterprise/sso) with SAML 2.0 or OIDC, including Microsoft Entra ID, Okta, and Google Workspace - [SCIM directory provisioning](https://docs.sim.ai/platform/enterprise/scim) from Microsoft Entra ID or Okta - [Audit logs](https://docs.sim.ai/platform/enterprise/audit-logs) and [permission groups](https://docs.sim.ai/platform/enterprise/access-control) that restrict models, blocks, and tools by workspace and member @@ -137,7 +137,7 @@ npx sim-setup reset # archive .env and wipe managed data The setup package detects how you're running and acts accordingly. Use `--dir ` to create or manage a deployment somewhere other than `./sim`. -Sim also supports local models via [Ollama](https://ollama.ai) and [vLLM](https://docs.vllm.ai/). See the [self-hosting docs](https://docs.sim.ai/self-hosting/docker) for details. +Sim also supports local models via [Ollama](https://ollama.ai), [vLLM](https://docs.vllm.ai/), and [LiteLLM](https://docs.litellm.ai/). See the [self-hosting docs](https://docs.sim.ai/self-hosting/docker) for details. ## Chat API Keys diff --git a/apps/docs/content/docs/cli/blocks.mdx b/apps/docs/content/docs/cli/blocks.mdx index 95b796011c2..098245dcfac 100644 --- a/apps/docs/content/docs/cli/blocks.mdx +++ b/apps/docs/content/docs/cli/blocks.mdx @@ -61,7 +61,8 @@ Reading it for `sim workflows operations apply`: inputDefinitions the block's inputs by name; one a pair of fields shares (tableId for tableSelector and manualTableId) is accepted in place of the pair outputs what it outputs on success; a failed block outputs {"error":"…"} - instead, read on its error path as + instead, read on its error path as (a Function also + outputs , the thrown message without line or code) Block settings such as retry are not fields: `sim workflows operations apply --help`. ``` diff --git a/apps/docs/content/docs/cli/index.mdx b/apps/docs/content/docs/cli/index.mdx index cccca7766cb..d44f4e9b9ee 100644 --- a/apps/docs/content/docs/cli/index.mdx +++ b/apps/docs/content/docs/cli/index.mdx @@ -7,7 +7,7 @@ Use `sim` to run workflows, query tables, move files, search knowledge bases, an ## Install -The installed CLI requires Node.js 20 or newer. Install it globally with Bun, then check the version: +The installed CLI requires Node.js 22.18 or newer on the 22 line, or 24.11 or newer. Install it globally with Bun, then check the version: ```bash bun add -g sim @@ -140,7 +140,7 @@ sim tables rows query --help | [`workflow-mcp-servers`](/cli/workflow-mcp-servers) | Expose deployed workflows as MCP tools | | [`meta`](/cli/meta) | Inspect API availability and credential status | -To edit a workflow as a TypeScript file, or a whole workspace as a directory, use `sim workflows source` and `sim workspaces source` (in preview). See [Workflows as code](/workflows/code) and [Workspace as code](/workflows/workspace-code). +To edit a workflow as a TypeScript file, or a whole workspace as a directory, use `sim workflows source` and `sim workspaces source` (in preview). See [Workflows as code](/workflows/code) and [Manage a workspace as code](/workflows/code/workspace). The [command overview](/cli/commands) lists global options and root commands. The [complete reference](/cli/reference) contains every subcommand, argument, and option on one page. Both are generated from the CLI. @@ -177,7 +177,7 @@ The repository is also a native Claude Code and Codex plugin, which exposes the The skills assume `sim` is installed and signed in, so complete [Your first command](#your-first-command) first. They never store or print API keys. These agent skills are separate from the workspace skills you manage with [`sim skills`](/cli/skills). -To have a coding agent edit workflow files directly, see [Workflows as code for coding agents](/workflows/code#for-coding-agents). +To have a coding agent edit workflow files directly, see [Use workflows as code with coding agents](/workflows/code/coding-agents). ## Related docs diff --git a/apps/docs/content/docs/cli/reference.mdx b/apps/docs/content/docs/cli/reference.mdx index da82b822c5d..76410565750 100644 --- a/apps/docs/content/docs/cli/reference.mdx +++ b/apps/docs/content/docs/cli/reference.mdx @@ -434,7 +434,8 @@ Reading it for `sim workflows operations apply`: inputDefinitions the block's inputs by name; one a pair of fields shares (tableId for tableSelector and manualTableId) is accepted in place of the pair outputs what it outputs on success; a failed block outputs {"error":"…"} - instead, read on its error path as + instead, read on its error path as (a Function also + outputs , the thrown message without line or code) Block settings such as retry are not fields: `sim workflows operations apply --help`. ``` @@ -5890,7 +5891,7 @@ sim tables columns create [options] | Option | Required | Description | | --- | --- | --- | -| `--column ` | Yes | Column definition to add. (JSON, or @path / @- to read a file or stdin). | +| `--column ` | Yes | Column definition to add: {"name":"status","type":"string"}. A column's type is one of string, number, currency, boolean, date, json, select; a select column also takes options. (JSON, or @path / @- to read a file or stdin). | @@ -6796,7 +6797,7 @@ sim tables create [options] | --- | --- | --- | | `--name ` | Yes | Identifier: letters, numbers, and underscores; cannot start with a number. | | `--description ` | No | Optional table description. | -| `--schema ` | Yes | Table schema: {"columns":[{"name":"email","type":"string"}]} (JSON, or @path / @- to read a file or stdin). | +| `--schema ` | Yes | Initial table column definitions: {"columns":[{"name":"email","type":"string"}]}. A column's type is one of string, number, currency, boolean, date, json, select; a select column also takes options. (JSON, or @path / @- to read a file or stdin). | | `--folder ` | No | Folder path as shown in the app; the leading / is optional. | @@ -7772,7 +7773,9 @@ Edges: connections maps a source handle to its targets: {"source":""}, {"source":["",""]}, or {"source":{"block":"","handle":""}}; "success" is an alias of "source". An add's connections create the new block's edges. An edit's connections REPLACE every - outgoing edge of that block, on every handle: list again each edge to keep. + outgoing edge of that block, on every handle: list again each edge to keep; {} removes them all. + A block moved into or out of a loop or parallel (parentId) loses every edge that would cross the + container's boundary: to leave the loop, wire its loop-end-source (parallel-end-source). To remove one edge, edit its source block with {"removeEdges":[{"targetBlockId":"","sourceHandle":"source"}]} (sourceHandle defaults to "source"). @@ -7785,12 +7788,14 @@ Source handles: parallel-start-source, parallel-end-source the same for a parallel Renames: An edit's {"name":"New name"} also rewrites every reference to the block, in - other blocks' inputs and in a loop's or parallel's collection and condition. + other blocks' inputs and in a loop's or parallel's collection and condition. Edits run after the + batch's adds, so a block added in the same batch is rewritten too. Inputs: inputs takes the field ids `sim blocks get ` lists (inputSchema, operationInputSchema), or the name a pair of them shares (inputDefinitions: tableId for tableSelector and manualTableId; a string goes to the typed field). Add the type it answers with: `blocks get - table` answers table_v2, and an add of legacy table is refused. + table` answers table_v2, and an add of legacy table is refused. An edit's inputs replace each + field they name whole (a responseFormat schema too) and keep the fields they do not name. conditions (condition): [{"title":"if","value":" > 3"},{"title":"else if","value":"…"}, {"title":"else","value":""}]; the last entry is the else. Each entry's id comes from its position (-if, -else-if-0, …, -else): an id you pass is replaced. @@ -7799,12 +7804,28 @@ Inputs: Block settings, beside inputs in an add's or edit's params: "retry":{"enabled":true,"maxTries":3,"waitBetweenTriesMs":1000} retries a failed block; null clears it. An api block's retries input repeats the request after a timeout, reset, 429 or - 5xx, not when the host does not resolve or refuses the connection; "retry" covers that. + 5xx, not when the host does not resolve or refuses the connection; "retry" covers that. They + nest: every try of "retry" runs the request with its retries. Outputs: A block that fails outputs {"error":""}: connect its error handle and read - there (without one, the run fails). A Workflow block's result is the child's + there (without one, the run fails). A Function's error leads with the line and + code that threw; its is the thrown message alone, the one to reply with. + A Workflow block's result is the child's output; a child ending in a Response block gives {data, status, headers}, so read - . + . A Table block's row holds its cells under data: read a cell as + (). +References: + Inside a loop or parallel body read and , or + and ; after it, . A reference to a block + that did not run (a branch not taken) is null as a whole value, in a condition or in a + Function's code, and '' inside text. +Order: + Operations run in phases whatever their order in the batch: deletes first, then + extract_from_subflow, adds, insert_into_subflow and edits; operations of one type keep the + order given, except insert_into_subflow, which runs a parent before its children. A delete plus an add with the same name therefore replaces the block in one batch. +Run logs: + `sim logs list --workflow ` lists a workflow's runs; `sim logs get --trace + --no-include-workflow-state` shows each block's resolved inputs, outputs and errors. ``` API request and response schemas: [applyWorkflowOperations](/api-reference/workflows/applyWorkflowOperations). @@ -8546,7 +8567,7 @@ sim workflows export [options] -Workspace bindings (a table, a child workflow, a knowledge base) print as null unless --include-workspace-bindings, and credentials always do: to read what a block is set to, use `sim workflows state get`. +Workspace bindings (a table, a child workflow, a knowledge base) print as null unless --include-workspace-bindings, and credentials always do: that is the export, not an unset block. To read what a block is set to, use `sim workflows outline` or `sim workflows state get`. API request and response schemas: [exportWorkflow](/api-reference/workflows/exportWorkflow). @@ -8639,6 +8660,7 @@ sim workflows source apply [workflowId] [options] | Option | Required | Description | | --- | --- | --- | | `--verbose` | No | Also list the info findings hidden by default: every one with --output json, blocks placed by autolayout in the display. | +| `--summary-file ` | No | Also write the plan as Markdown to this file (or set SIM_SUMMARY_FILE), replacing it each run; its first line is a comment that names the directory, for a CI step that updates one pull-request comment. | | `--dir ` | No | Source directory: workflow.ts, functions/*, .sim/lock.json and .sim/base.json. Defaults to `.`. | | `--dry-run` | No | Check the source and show the outcome without saving or writing files. | | `-y, --yes` | No | Apply without asking for confirmation. | @@ -8666,6 +8688,7 @@ sim workflows source create [options] | Option | Required | Description | | --- | --- | --- | | `--verbose` | No | Also list the info findings hidden by default: every one with --output json, blocks placed by autolayout in the display. | +| `--summary-file ` | No | Also write the plan as Markdown to this file (or set SIM_SUMMARY_FILE), replacing it each run; its first line is a comment that names the directory, for a CI step that updates one pull-request comment. | | `--dir ` | Yes | Source directory: workflow.ts and functions/*. Without workflow.ts, writes a starter and the types instead (an error with --dry-run or --yes). | | `--dry-run` | No | Check the source and show the outcome without creating anything. | | `--name ` | No | The workflow name (default: the source's). | @@ -8681,7 +8704,7 @@ API request and response schemas: [createWorkflowFromSource](/api-reference/work ### sim workflows source check -Compile a workflow source directory locally, without the server +Compile and type-check a workflow source directory locally, without the server ```bash sim workflows source check [options] @@ -8696,11 +8719,12 @@ sim workflows source check [options] | `--dir ` | No | Source directory: workflow.ts, functions/* and .sim/. Defaults to `.`. | | `--strict` | No | Fail on the warnings listed below in every block, not only new ones. | | `--no-strict` | No | Never fail on a warning an apply saves. | +| `--no-types` | No | Skip the type check (TypeScript 7.0.2 over tsconfig.json) that runs after the compile. | | `--verbose` | No | Also list the info findings hidden by default: every one with --output json, blocks placed by autolayout in the display. | -Compiles workflow.ts (and the function files it names) with the compiler the server runs, against the workspace's block catalog the last get or create cached, and prints the findings as the dry run does. No request is made. It covers the source itself (syntax, builders, params, references, wiring). In a workflow folder of a workspace directory (workflows/<key>), it reads the workspace's .sim/base.json and also checks env names, resource keys and table columns against what the directory declares. The dry run still checks what only the server knows (stored values, deployment), so run it before applying. A check also adds the blocks the source now uses to the CLI's tsconfig.json, so tsc type-checks a block the edit added; in a workspace directory it also regenerates .sim/sdk/workspace.d.ts, so tsc types each workflow's inputs as its files declare them. +Compiles workflow.ts (and the function files it names) with the compiler the server runs, against the workspace's block catalog the last get or create cached, and prints the findings as the dry run does. No request is made to Sim. It covers the source itself (syntax, builders, params, references, wiring). In a workflow folder of a workspace directory (workflows/<key>), it reads the workspace's .sim/base.json and also checks env names, resource keys and table columns against what the directory declares. The dry run still checks what only the server knows (stored values, deployment), so run it before applying. A check also adds the blocks the source now uses to the CLI's tsconfig.json, so a block the edit added is typed; in a workspace directory it also regenerates .sim/sdk/workspace.d.ts from the files, so each key and workflow input they declare is. Then it type-checks the directory with TypeScript 7.0.2 (the release the declarations are built for) over tsconfig.json. Each type error is an E_TYPE error, its message starting with TypeScript's code. One is left out on a line the compile already reports an error on, and in a file still as the last get or apply wrote it when that file had the same error then (against the declarations as that get or apply left them). The first check installs that release with npm into the CLI's cache, once; when it cannot (offline, no npm), the check warns W_TYPES_UNCHECKED and passes or fails on the compile alone. --no-types skips the type check. Exit codes: 0 no errors; 1 errors (each printed as file:line:column with its frame and hint), or no cached catalog (run the get once). With --output json, stdout is one document that also lists every finding under diagnostics. @@ -8720,6 +8744,7 @@ sim workflows source status [options] | Option | Required | Description | | --- | --- | --- | +| `--summary-file ` | No | Also write the plan as Markdown to this file (or set SIM_SUMMARY_FILE), replacing it each run; its first line is a comment that names the directory, for a CI step that updates one pull-request comment. | | `--dir ` | No | Source directory: workflow.ts, functions/* and .sim/. Defaults to `.`. | | `--offline` | No | Report local changes only, without asking the server. | | `--json` | No | Print the machine-readable status (same as --output json). | @@ -8791,10 +8816,11 @@ sim workflows source params [options] | Option | Required | Description | | --- | --- | --- | | `--dir ` | No | Source directory whose catalog to read. Defaults to `.`. | +| `--full` | No | Print every param with its type, enum, default and doc, not the brief form. | -Prints a builder's params (required first, with enums and defaults), the gate field that picks which others apply, and its outputs, from the block catalog the last get, create or check cached. No request is made. <builder> is the dotted builder path as source writes it: table.upsertRow, agent, trigger.schedule, slack.sendMessage (slack.tool.sendMessage names the same builder). A namespace (gmail, trigger.gmail) lists its builders; a block type prints the builder written for it (function is fn) or lists them (table_v2); a construct core.d.ts declares (loop, parallel, t, env) prints its declaration. Run it from a workflow or workspace source directory, or pass --dir. +Prints a builder in brief (an example call, the required params with types, the optional ones by name, the gate field that picks which others apply, and the outputs), from the block catalog the last get, create or check cached. --full prints every param with its type, enum, default and doc. A legacy builder names the one that replaces it. No request is made. <builder> is the dotted builder path as source writes it: table.upsertRow, agent, trigger.schedule, slack.sendMessage (slack.tool.sendMessage names the same builder). A namespace (gmail, trigger.gmail) lists its builders; a block type prints the builder written for it (function is fn) or lists them (table_v2); a construct core.d.ts declares (loop, parallel, t, env) prints its declaration. Run it from a workflow or workspace source directory, or pass --dir. Exit codes: 0 printed; 1 no builder or namespace of that name (the closest one is named), or no cached catalog (run a get once). @@ -10044,6 +10070,7 @@ sim workspaces source apply [options] | Option | Required | Description | | --- | --- | --- | | `--verbose` | No | Also list the info findings hidden by default: every one with --output json, blocks placed by autolayout in the display. | +| `--summary-file ` | No | Also write the plan as Markdown to this file (or set SIM_SUMMARY_FILE), replacing it each run; its first line is a comment that names the directory, for a CI step that updates one pull-request comment. | | `--dir ` | No | Workspace source directory written by `workspaces source get`. Defaults to `.`. | | `--dry-run` | No | Plan and check without writing anything. | | `-y, --yes` | No | Apply without asking for confirmation. | @@ -10060,7 +10087,7 @@ API request and response schemas: [applyWorkspaceSource](/api-reference/workflow ### sim workspaces source check -Compile every workflow of a workspace source directory locally, without the server +Compile and type-check every workflow of a workspace source directory locally, without the server ```bash sim workspaces source check [options] @@ -10075,13 +10102,14 @@ sim workspaces source check [options] | `--dir ` | No | Workspace source directory: the kind folders and .sim/base.json. Defaults to `.`. | | `--strict` | No | Fail on the warnings listed below in every block, not only new ones. | | `--no-strict` | No | Never fail on a warning an apply saves. | +| `--no-types` | No | Skip the type check (TypeScript 7.0.2 over tsconfig.json) that runs after the compile. | | `--verbose` | No | Also list the info findings hidden by default: every one with --output json, blocks placed by autolayout in the display. | -Compiles every workflows/<key>/workflow.ts (and the function files each names) with the compiler the server runs, against the workspace's block catalog the last get cached (in a fresh clone with no cache, such as CI, it downloads the catalog once with the profile's credentials). No other request is made. It checks, against what the directory declares: - env names (secrets.ts), with a did-you-mean - credential keys (credentials.ts) - the keys of tables, knowledge bases, skills, custom tools, MCP servers and workflows, with a did-you-mean, and a key holding a look-alike letter (a Cyrillic а) named by its code point - the columns and select options of a table row write - a child workflow call: an inputMapping key the child's Start trigger does not declare, and a child with no Start trigger - each tables/<key>.rows.jsonl: a malformed line, an undeclared column, a managed key two lines share, an empty required cell, a repeated unique value, a value its column's type or options cannot hold - block names whose words mix Latin with Cyrillic, Greek, Armenian or Cherokee letters The dry run still checks what only the server knows (stored values, MCP tool names, model ids, deployments, credential bindings), so run it before applying. A check also regenerates .sim/sdk/workspace.d.ts from the declarations (so tsc types a key added since the get, and each workflow's inputs) and adds the blocks the workflows now use to the CLI's tsconfig.json. +Compiles every workflows/<key>/workflow.ts (and the function files each names) with the compiler the server runs, against the workspace's block catalog the last get cached (in a fresh clone with no cache, such as CI, it downloads the catalog once with the profile's credentials). No other request is made to Sim. It checks, against what the directory declares: - env names (secrets.ts), with a did-you-mean - credential keys (credentials.ts) - the keys of tables, knowledge bases, skills, custom tools, MCP servers and workflows, with a did-you-mean, and a key holding a look-alike letter (a Cyrillic а) named by its code point - the columns and select options of a table row write - a child workflow call: an inputMapping key the child's Start trigger does not declare, and a child with no Start trigger - each tables/<key>.rows.jsonl: a malformed line, an undeclared column, a managed key two lines share, an empty required cell, a repeated unique value, a value its column's type or options cannot hold - block names whose words mix Latin with Cyrillic, Greek, Armenian or Cherokee letters The dry run still checks what only the server knows (stored values, MCP tool names, model ids, deployments, credential bindings), so run it before applying. A check also regenerates .sim/sdk/workspace.d.ts from the declarations (so a key added since the get is typed, and each workflow's inputs) and adds the blocks the workflows now use to the CLI's tsconfig.json. Then it type-checks the directory with TypeScript 7.0.2 (the release the declarations are built for) over tsconfig.json. Each type error is an E_TYPE error, its message starting with TypeScript's code. One is left out on a line the compile already reports an error on, and in a file still as the last get or apply wrote it when that file had the same error then (against the declarations as that get or apply left them). The first check installs that release with npm into the CLI's cache, once; when it cannot (offline, no npm), the check warns W_TYPES_UNCHECKED and passes or fails on the compile alone. --no-types skips the type check. -Exit codes: 0 no errors; 1 errors (each printed as file:line:column with its frame and hint), or no cached catalog (run the get once). With --output json, stdout is one document that also lists every finding under diagnostics. +Exit codes: 0 no errors; 1 errors (each printed as file:line:column with its frame and hint), or no cached catalog that could not be downloaded (a check downloads it once when none is cached, with the profile's credentials). With --output json, stdout is one document that also lists every finding under diagnostics. These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_CHILD_RESULT_PATH, W_BRANCH_UNWIRED, W_UNRESOLVED_REF, W_REF_OUT_OF_SCOPE, W_LOOP_CONDITION_SYNTAX. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict fails on none of them. In every mode, as the server refuses them: W_REF_OUT_OF_SCOPE is the error E_APPLY_REF_OUT_OF_SCOPE in any file of a block the edit added or changed; W_LOOP_CONDITION_SYNTAX is the error E_APPLY_LOOP_CONDITION_SYNTAX in any file of a block the edit added or changed; W_UNKNOWN_OPTION is the error E_APPLY_INVALID_SUBBLOCK_FIELD in workflow.ts on a block the edit added or changed; W_UNKNOWN_OUTPUT_PATH is the error E_APPLY_UNRESOLVED_REF in workflow.ts on a block the edit added or changed; W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in workflow.ts on a block the edit added or changed; W_UNKNOWN_BLOCK_TYPE is the error E_APPLY_INVALID_BLOCK_TYPE in workflow.ts on a block the edit added or changed; W_TYPE_NOT_ADDABLE is the error E_APPLY_TYPE_NOT_ADDABLE in workflow.ts on a block the edit added or changed; W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in a function file changed since the get; W_UNKNOWN_OUTPUT_PATH is the error E_APPLY_UNRESOLVED_REF in a function file changed since the get; W_CODE_FILE_REF_SYNTAX is the error E_APPLY_CODE_FILE_REF_SYNTAX in a function file changed since the get. A block counts as changed when the lock does not bind it, when the source moved it into another container, or when it compiles differently than in the source the last get or apply printed (.sim/stored-edges.json records a digest of each block). That last comparison needs the catalog the source was printed with in the cache: without it, a bound block that did not move counts as unchanged, so the server may refuse what the check passes. A $ref in a function file to a block the lock binds that the source no longer declares stays a warning, unless a warning cap left findings out: the server may infer that block was renamed and rewrite the reference, and refuses it otherwise. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block. @@ -10103,6 +10131,7 @@ sim workspaces source status [options] | Option | Required | Description | | --- | --- | --- | +| `--summary-file ` | No | Also write the plan as Markdown to this file (or set SIM_SUMMARY_FILE), replacing it each run; its first line is a comment that names the directory, for a CI step that updates one pull-request comment. | | `--dir ` | No | Workspace source directory written by `workspaces source get`. Defaults to `.`. | | `--only ` | No | Report only these kinds (comma-separated folders: secrets.ts, credentials.ts, tools, skills, mcp, tables, knowledge, files, workflows, deployments). | | `--offline` | No | Report local changes only, without asking the server. | diff --git a/apps/docs/content/docs/cli/scripting.mdx b/apps/docs/content/docs/cli/scripting.mdx index 5391ed9864a..921d08d70b4 100644 --- a/apps/docs/content/docs/cli/scripting.mdx +++ b/apps/docs/content/docs/cli/scripting.mdx @@ -112,11 +112,11 @@ Run the next command only when the cursor is non-null. `--limit` applies to each Results go to stdout; diagnostics go to stderr. JSON/YAML modes serialize API errors as `{error:{code,message,details?}}`. Display formats use `Error:` plus any supplied code/details. Configuration and argument-parser errors, run-wait outcome messages, and unexpected stack traces can remain text. Do not assume every stderr stream is a single JSON document. -`sim workflows source check`, `sim workspaces source check` and both `source apply` commands (dry run or not) print their findings on stderr as `file:line:column` with the code frame. In JSON output (the [default](/cli/output)) or `--output yaml`, stdout is one document holding the counts and every finding as well: +`sim workflows source check`, `sim workspaces source check` and both `source apply` commands (dry run or not) print their findings on stderr as `file:line:column` with the code frame. A check's `checked` lists what ran: `compile`, and `types` unless `--no-types` or an offline first run (`W_TYPES_UNCHECKED`) skipped the type check. In JSON output (the [default](/cli/output)) or `--output yaml`, stdout is one document holding the counts and every finding as well: ```json { - "checked": "compile", + "checked": ["compile", "types"], "errors": 1, "warnings": 0, "diagnostics": [ @@ -165,61 +165,7 @@ The CLI resends a request the API answers `429` only when sending it twice is sa | `3` | Committed operation requires configuration | | `4` | Wait timed out | -| Code | `sim workflows source apply` or `create` | -| --- | --- | -| `0` | Applied or created, or a dry run with no errors | -| `1` | The source has errors (each printed as `file:line:column` with its frame and hint), `create`'s workflow name is taken (`SOURCE_NAME_TAKEN`: pass `--name`), or command/request failure | -| `5` | The workflow changed since the directory was read (`409 SOURCE_STALE`): get it again, reapply the edit, and retry | -| `6` | The workflow or its folder is locked (`423`, `E_APPLY_LOCKED`); a locked block exits `1` (`E_APPLY_LOCKED_BLOCK`) | -| `7` | The source is over the size limits (`413`) | -| `9` | Still rate limited (`429`) after the CLI's retries; nothing was written | -| `10` | Busy, retry: another `sim` command is using `--dir`, or the workspace directory it is a workflow folder of (`SOURCE_DIR_BUSY`); nothing was read or written: run it again once the other finished | -| `13` | `AUTH_REQUIRED`: not logged in, or the server refused the credential; nothing was sent | -| `14` | Run without `--yes` and with no terminal to ask: the plan was printed with no errors and nothing was written; run the same command with `--yes` | -| `130` | Interrupted (Ctrl-C). A write already sent is finished and saved into the directory first, waiting up to 60s for its answer; a second Ctrl-C, or no answer by then, stops at once and prints that it may have been written and how to check | - -| Code | `sim workflows source status` or `sim workspaces source status` | -| --- | --- | -| `0` | Clean: nothing to apply, and the server changed nothing since the directory was read | -| `1` | Command/request failure | -| `7` | The source is too large for the server to read in one dry run | -| `10` | `sim workspaces source status` only: another `sim workspaces source` command is using the directory (`SOURCE_DIR_BUSY`); nothing was read: run it again once the other finished | -| `11` | Local changes only: applying writes them | -| `12` | The server changed since the directory was read (drift, or a conflict with local changes) | -| `13` | `AUTH_REQUIRED`: not logged in, or the server refused the credential; the local changes are still shown | - -| Code | `sim workflows source check` or `sim workspaces source check` | -| --- | --- | -| `0` | No errors (warnings may still print) | -| `1` | The source has errors, or a warning that fails the check on a block the edit added (see `--strict`), or no block catalog is cached: run the get once | -| `10` | `sim workspaces source check` only: another `sim workspaces source` command is using the directory (`SOURCE_DIR_BUSY`); nothing was read: run it again once the other finished | - -| Code | `sim workflows source get --dir` or `sim workspaces source get` | -| --- | --- | -| `0` | Written | -| `1` | The directory holds edits no apply has saved (`SOURCE_LOCAL_EDITS`) or another workflow's source (`SOURCE_WORKFLOW_MISMATCH`): apply them, get into another directory, or pass `--force`; it is the other kind of source directory (`SOURCE_DIR_KIND_MISMATCH`, even with `--force`); for a workspace, `--workspace` names another workspace than the one the directory was read from (`SOURCE_OTHER_WORKSPACE`) or a downloaded binary file does not match its listing (`SOURCE_BLOB_MISMATCH`); or command/request failure | -| `7` | The workflow, or a kind of resource, is too large for one directory | -| `9` | Still rate limited (`429`) after the CLI's retries; nothing was written | -| `10` | Busy, retry: another `sim` command is using the directory (or, for a workflow folder, its workspace directory) (`SOURCE_DIR_BUSY`); nothing was read or written: run it again once the other finished | -| `13` | `AUTH_REQUIRED`: not logged in, the login expired, or the server refused the credential; nothing was read or written: run `sim login` and the get again | -| `130` | Interrupted (Ctrl-C): run the get again | - -| Code | `sim workspaces source apply` | -| --- | --- | -| `0` | Applied, or a dry run with no errors | -| `1` | The source has errors, every change it would write was held back for a secret or credential the workspace cannot satisfy (nothing was written; its dry run exits `1` too), or command/request failure | -| `5` | A resource changed since the directory was read (`409 SOURCE_STALE`): get it again into a fresh directory, reapply the edit, and retry | -| `6` | A resource (a workflow or its folder, a table) is locked (`423`); a locked block exits `1` (`E_APPLY_LOCKED_BLOCK`) | -| `7` | The directory is over the size limits (`413`) | -| `8` | The apply stopped part-way: what was written is saved into the directory; apply again | -| `9` | Still rate limited (`429`) after the CLI's retries; nothing was written | -| `10` | Busy, retry: another apply is writing the workspace (`409 SOURCE_BUSY`), or another `sim workspaces source` command is using the same directory (`SOURCE_DIR_BUSY`); nothing was written: run the command again once the other finished | -| `13` | `AUTH_REQUIRED`: not logged in, or the server refused the credential; nothing was sent | -| `14` | Run without `--yes` and with no terminal to ask: the plan was printed with no errors and nothing was written; run the same command with `--yes` | -| `15` | Written in part: changes that use a declared secret with no value, or a credential key nothing binds to, were held back and the rest was applied and saved; set the secret or connect the credential, then apply again (a promotion with `--to` too). A dry run that would do so exits `15` too, having written nothing | -| `130` | Interrupted (Ctrl-C). A write already sent is finished and saved into the directory first, waiting up to 60s for its answer; a second Ctrl-C, or no answer by then, stops at once and prints that it may have been written and how to check | - -Earlier CLI releases exited `1` when an apply held changes back, whether or not it wrote the rest, and its dry run exited `1` in either case. A script that reads `1` as "held back" should test for `15` too. +The source commands (`sim workflows source` and `sim workspaces source`) have codes of their own, among them `5` stale, `10` busy, `11` and `12` for `status`, `14` for an apply without `--yes`, and `15` for an apply that held changes back. [Exit codes](/workflows/code/exit-codes) lists each one with what to do next. Both waits default to 3600 seconds; `--wait-timeout 0` waits indefinitely. `SIM_TIMEOUT_SECONDS` independently bounds one API request. A timeout does not cancel the underlying run or operation. @@ -381,63 +327,14 @@ exit "$status" ## Workspace source in CI -Keep a [workspace source directory](/workflows/workspace-code) in a repository, `.sim/` included, and let CI plan each pull request and apply each merge. The dry run exits `1` on errors, `5` when the workspace changed since the committed base, and `15` when the apply would hold back changes that use a secret with no value or a credential nothing binds to; `check` downloads the block catalog once on a fresh runner. On GitHub Actions (`GITHUB_ACTIONS=true`), every source command also annotates each error and warning at its file and line, so they show inline on the pull request, and `apply` (a dry run too) appends its plan and errors to the job's step summary. - -```yaml title=".github/workflows/sim-workspace.yml" -on: - pull_request: - paths: ['workspace/**'] - push: - branches: [main] - paths: ['workspace/**'] - -concurrency: sim-workspace - -permissions: - contents: write - -jobs: - workspace: - runs-on: ubuntu-latest - env: - SIM_API_KEY: ${{ secrets.SIM_API_KEY }} - SIM_WORKSPACE: ${{ vars.SIM_WORKSPACE }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '20' - - uses: oven-sh/setup-bun@v2 - - run: bun add -g sim - - run: sim workspaces source check --dir workspace - - run: bunx -p typescript@7.0.2 tsc -p workspace - - run: sim workspaces source apply --dir workspace --dry-run - - if: github.event_name == 'push' - run: sim workspaces source apply --dir workspace --yes - - if: ${{ !cancelled() && github.event_name == 'push' }} - run: | - git add -A workspace - if ! git diff --cached --quiet; then - git -c user.name=sim-bot -c user.email=sim-bot@users.noreply.github.com \ - commit -m "chore(workspace): files the apply rewrote [skip ci]" - git push - fi -``` - -`check` runs first because it is offline and fast, and it regenerates `.sim/sdk/workspace.d.ts`, so the `tsc` step after it types resources the pull request adds. A workspace API key can apply tables, rows, knowledge bases, files, custom tools, MCP servers and credential bindings. Workflows, skills, secrets and deployments need a member's personal API key, and deployments need an admin. Apply rewrites files under the directory (each `.sim/base.json`, ids it allocated, values the server normalized), and the next apply compares with them, so the last step commits them back to the branch; `[skip ci]` keeps that commit from running the job again. That step runs even when the apply failed (`!cancelled()`), because an apply can fail having written part of its plan: exit `15` means it held back changes that use a secret with no value or a credential nothing binds to and applied the rest, and exit `8` means it stopped part-way. Either way the directory records what was written, so committing it keeps the next run from being refused as stale (exit `5`) for resources this run wrote; the job still fails, so set the secret, connect the credential or fix the failure, and push again. Where the branch is protected, run `sim workspaces source get --dir workspace` on a new branch instead and open a pull request. After merging two branches that each applied, a dry run with no changes means the files match the workspace. Exit `5` means a resource changed since this branch's base: get the workspace into a fresh directory and carry the edit over. Exit `10` means another apply is writing the workspace (or another command is using the directory), so retry; the `concurrency` key keeps two runs of this job from overlapping. - -To promote the same directory to a second workspace, add a step with `--to` before the step that commits the files back: - -```bash -sim workspaces source apply --dir workspace --to "$PROD_WORKSPACE_ID" --yes -``` - -The promotion writes `workspace/.sim/targets/.json`, what it left in that workspace. Committing it lets the next run tell a change made in that workspace since (kept, or exit `5` when the directory changed the same resource) from one to promote. +Dry-run source on pull requests, apply on merge, comment the plan and detect drift on a schedule: see [Run in CI](/workflows/code/ci) for GitHub Actions recipes. ## Related docs - [Output formats](/cli/output) - [Workflow commands](/cli/workflows) +- [Workflows as code: run in CI](/workflows/code/ci) +- [Workflows as code: exit codes](/workflows/code/exit-codes) - [Workflow imports and workspace sync](/cli/workflow-sync) - [Organization commands](/cli/organizations) - [Troubleshooting](/cli/troubleshooting) diff --git a/apps/docs/content/docs/cli/tables.mdx b/apps/docs/content/docs/cli/tables.mdx index 589050deb8a..a92649e37e3 100644 --- a/apps/docs/content/docs/cli/tables.mdx +++ b/apps/docs/content/docs/cli/tables.mdx @@ -68,7 +68,7 @@ sim tables create [options] | --- | --- | --- | | `--name ` | Yes | Identifier: letters, numbers, and underscores; cannot start with a number. | | `--description ` | No | Optional table description. | -| `--schema ` | Yes | Table schema: {"columns":[{"name":"email","type":"string"}]} (JSON, or @path / @- to read a file or stdin). | +| `--schema ` | Yes | Initial table column definitions: {"columns":[{"name":"email","type":"string"}]}. A column's type is one of string, number, currency, boolean, date, json, select; a select column also takes options. (JSON, or @path / @- to read a file or stdin). | | `--folder ` | No | Folder path as shown in the app; the leading / is optional. | @@ -624,7 +624,7 @@ sim tables columns create [options] | Option | Required | Description | | --- | --- | --- | -| `--column ` | Yes | Column definition to add. (JSON, or @path / @- to read a file or stdin). | +| `--column ` | Yes | Column definition to add: {"name":"status","type":"string"}. A column's type is one of string, number, currency, boolean, date, json, select; a select column also takes options. (JSON, or @path / @- to read a file or stdin). | diff --git a/apps/docs/content/docs/cli/troubleshooting.mdx b/apps/docs/content/docs/cli/troubleshooting.mdx index 1b27eed3a54..5b7fb7591c4 100644 --- a/apps/docs/content/docs/cli/troubleshooting.mdx +++ b/apps/docs/content/docs/cli/troubleshooting.mdx @@ -148,6 +148,10 @@ Retain the original request/operation IDs and exact input. An operation may have A workflow wait timeout also leaves its run active. Inspect that run ID; do not assume another execution is a retry of the same work. +## A `sim workflows source` or `sim workspaces source` command failed + +These commands exit with codes of their own, such as `5` when the workflow changed since it was read and `10` when another apply is running, and print each problem with its file, line and code. [Workflows as code troubleshooting](/workflows/code/troubleshooting) covers each exit code and the common diagnostic codes. + ## Anything else For an unexpected stack trace, [open an issue](https://github.com/simstudioai/sim/issues) with the CLI version, command, sanitized trace, and relevant resolved settings. Remove credentials, sensitive inputs, and private file contents before posting. Debug output can contain request selectors. @@ -158,3 +162,4 @@ For an unexpected stack trace, [open an issue](https://github.com/simstudioai/si - [Configuration](/cli/configuration) - [Output formats](/cli/output) - [Scripting](/cli/scripting) +- [Workflows as code troubleshooting](/workflows/code/troubleshooting) diff --git a/apps/docs/content/docs/cli/workflow-sync.mdx b/apps/docs/content/docs/cli/workflow-sync.mdx index 7431f696b9b..7ce8308fe62 100644 --- a/apps/docs/content/docs/cli/workflow-sync.mdx +++ b/apps/docs/content/docs/cli/workflow-sync.mdx @@ -239,6 +239,7 @@ Validate provider connections in the destination environment as well as the plat - [Workspace forking](/platform/enterprise/forks) - [Workflow commands](/cli/workflows) - [Workspace commands](/cli/workspaces) +- [Promote to another workspace](/workflows/code/promote): copy a workspace directory kept in git to another workspace, without linking the two - [Selectors](/cli/selectors) - [Exit codes](/cli/scripting#exit-codes) - [Workflow-sync contributor harness](/api-reference/workflow-sync#related-docs) diff --git a/apps/docs/content/docs/cli/workflows.mdx b/apps/docs/content/docs/cli/workflows.mdx index 87fc3f80201..45d9a1c9ca4 100644 --- a/apps/docs/content/docs/cli/workflows.mdx +++ b/apps/docs/content/docs/cli/workflows.mdx @@ -342,7 +342,9 @@ Edges: connections maps a source handle to its targets: {"source":""}, {"source":["",""]}, or {"source":{"block":"","handle":""}}; "success" is an alias of "source". An add's connections create the new block's edges. An edit's connections REPLACE every - outgoing edge of that block, on every handle: list again each edge to keep. + outgoing edge of that block, on every handle: list again each edge to keep; {} removes them all. + A block moved into or out of a loop or parallel (parentId) loses every edge that would cross the + container's boundary: to leave the loop, wire its loop-end-source (parallel-end-source). To remove one edge, edit its source block with {"removeEdges":[{"targetBlockId":"","sourceHandle":"source"}]} (sourceHandle defaults to "source"). @@ -355,12 +357,14 @@ Source handles: parallel-start-source, parallel-end-source the same for a parallel Renames: An edit's {"name":"New name"} also rewrites every reference to the block, in - other blocks' inputs and in a loop's or parallel's collection and condition. + other blocks' inputs and in a loop's or parallel's collection and condition. Edits run after the + batch's adds, so a block added in the same batch is rewritten too. Inputs: inputs takes the field ids `sim blocks get ` lists (inputSchema, operationInputSchema), or the name a pair of them shares (inputDefinitions: tableId for tableSelector and manualTableId; a string goes to the typed field). Add the type it answers with: `blocks get - table` answers table_v2, and an add of legacy table is refused. + table` answers table_v2, and an add of legacy table is refused. An edit's inputs replace each + field they name whole (a responseFormat schema too) and keep the fields they do not name. conditions (condition): [{"title":"if","value":" > 3"},{"title":"else if","value":"…"}, {"title":"else","value":""}]; the last entry is the else. Each entry's id comes from its position (-if, -else-if-0, …, -else): an id you pass is replaced. @@ -369,12 +373,28 @@ Inputs: Block settings, beside inputs in an add's or edit's params: "retry":{"enabled":true,"maxTries":3,"waitBetweenTriesMs":1000} retries a failed block; null clears it. An api block's retries input repeats the request after a timeout, reset, 429 or - 5xx, not when the host does not resolve or refuses the connection; "retry" covers that. + 5xx, not when the host does not resolve or refuses the connection; "retry" covers that. They + nest: every try of "retry" runs the request with its retries. Outputs: A block that fails outputs {"error":""}: connect its error handle and read - there (without one, the run fails). A Workflow block's result is the child's + there (without one, the run fails). A Function's error leads with the line and + code that threw; its is the thrown message alone, the one to reply with. + A Workflow block's result is the child's output; a child ending in a Response block gives {data, status, headers}, so read - . + . A Table block's row holds its cells under data: read a cell as + (). +References: + Inside a loop or parallel body read and , or + and ; after it, . A reference to a block + that did not run (a branch not taken) is null as a whole value, in a condition or in a + Function's code, and '' inside text. +Order: + Operations run in phases whatever their order in the batch: deletes first, then + extract_from_subflow, adds, insert_into_subflow and edits; operations of one type keep the + order given, except insert_into_subflow, which runs a parent before its children. A delete plus an add with the same name therefore replaces the block in one batch. +Run logs: + `sim logs list --workflow ` lists a workflow's runs; `sim logs get --trace + --no-include-workflow-state` shows each block's resolved inputs, outputs and errors. ``` API request and response schemas: [applyWorkflowOperations](/api-reference/workflows/applyWorkflowOperations). @@ -1140,7 +1160,7 @@ sim workflows export [options] -Workspace bindings (a table, a child workflow, a knowledge base) print as null unless --include-workspace-bindings, and credentials always do: to read what a block is set to, use `sim workflows state get`. +Workspace bindings (a table, a child workflow, a knowledge base) print as null unless --include-workspace-bindings, and credentials always do: that is the export, not an unset block. To read what a block is set to, use `sim workflows outline` or `sim workflows state get`. API request and response schemas: [exportWorkflow](/api-reference/workflows/exportWorkflow). @@ -1338,7 +1358,7 @@ sim workflows mkdir API request and response schemas: [createWorkflowFolder](/api-reference/workflows/createWorkflowsFolder). -## Other commands +## Workflows as code ### Show a workflow’s draft as TypeScript source with its identity lock @@ -1384,6 +1404,7 @@ sim workflows source status [options] | Option | Required | Description | | --- | --- | --- | +| `--summary-file ` | No | Also write the plan as Markdown to this file (or set SIM_SUMMARY_FILE), replacing it each run; its first line is a comment that names the directory, for a CI step that updates one pull-request comment. | | `--dir ` | No | Source directory: workflow.ts, functions/* and .sim/. Defaults to `.`. | | `--offline` | No | Report local changes only, without asking the server. | | `--json` | No | Print the machine-readable status (same as --output json). | @@ -1409,6 +1430,7 @@ sim workflows source create [options] | Option | Required | Description | | --- | --- | --- | | `--verbose` | No | Also list the info findings hidden by default: every one with --output json, blocks placed by autolayout in the display. | +| `--summary-file ` | No | Also write the plan as Markdown to this file (or set SIM_SUMMARY_FILE), replacing it each run; its first line is a comment that names the directory, for a CI step that updates one pull-request comment. | | `--dir ` | Yes | Source directory: workflow.ts and functions/*. Without workflow.ts, writes a starter and the types instead (an error with --dry-run or --yes). | | `--dry-run` | No | Check the source and show the outcome without creating anything. | | `--name ` | No | The workflow name (default: the source's). | @@ -1445,6 +1467,7 @@ sim workflows source apply [workflowId] [options] | Option | Required | Description | | --- | --- | --- | | `--verbose` | No | Also list the info findings hidden by default: every one with --output json, blocks placed by autolayout in the display. | +| `--summary-file ` | No | Also write the plan as Markdown to this file (or set SIM_SUMMARY_FILE), replacing it each run; its first line is a comment that names the directory, for a CI step that updates one pull-request comment. | | `--dir ` | No | Source directory: workflow.ts, functions/*, .sim/lock.json and .sim/base.json. Defaults to `.`. | | `--dry-run` | No | Check the source and show the outcome without saving or writing files. | | `-y, --yes` | No | Apply without asking for confirmation. | @@ -1475,7 +1498,7 @@ sim workflows source catalog [options] API request and response schemas: [getSourceCatalog](/api-reference/catalog/getSourceCatalog). -### Compile a workflow source directory locally, without the server +### Compile and type-check a workflow source directory locally, without the server ```bash sim workflows source check [options] @@ -1490,11 +1513,12 @@ sim workflows source check [options] | `--dir ` | No | Source directory: workflow.ts, functions/* and .sim/. Defaults to `.`. | | `--strict` | No | Fail on the warnings listed below in every block, not only new ones. | | `--no-strict` | No | Never fail on a warning an apply saves. | +| `--no-types` | No | Skip the type check (TypeScript 7.0.2 over tsconfig.json) that runs after the compile. | | `--verbose` | No | Also list the info findings hidden by default: every one with --output json, blocks placed by autolayout in the display. | -Compiles workflow.ts (and the function files it names) with the compiler the server runs, against the workspace's block catalog the last get or create cached, and prints the findings as the dry run does. No request is made. It covers the source itself (syntax, builders, params, references, wiring). In a workflow folder of a workspace directory (workflows/<key>), it reads the workspace's .sim/base.json and also checks env names, resource keys and table columns against what the directory declares. The dry run still checks what only the server knows (stored values, deployment), so run it before applying. A check also adds the blocks the source now uses to the CLI's tsconfig.json, so tsc type-checks a block the edit added; in a workspace directory it also regenerates .sim/sdk/workspace.d.ts, so tsc types each workflow's inputs as its files declare them. +Compiles workflow.ts (and the function files it names) with the compiler the server runs, against the workspace's block catalog the last get or create cached, and prints the findings as the dry run does. No request is made to Sim. It covers the source itself (syntax, builders, params, references, wiring). In a workflow folder of a workspace directory (workflows/<key>), it reads the workspace's .sim/base.json and also checks env names, resource keys and table columns against what the directory declares. The dry run still checks what only the server knows (stored values, deployment), so run it before applying. A check also adds the blocks the source now uses to the CLI's tsconfig.json, so a block the edit added is typed; in a workspace directory it also regenerates .sim/sdk/workspace.d.ts from the files, so each key and workflow input they declare is. Then it type-checks the directory with TypeScript 7.0.2 (the release the declarations are built for) over tsconfig.json. Each type error is an E_TYPE error, its message starting with TypeScript's code. One is left out on a line the compile already reports an error on, and in a file still as the last get or apply wrote it when that file had the same error then (against the declarations as that get or apply left them). The first check installs that release with npm into the CLI's cache, once; when it cannot (offline, no npm), the check warns W_TYPES_UNCHECKED and passes or fails on the compile alone. --no-types skips the type check. Exit codes: 0 no errors; 1 errors (each printed as file:line:column with its frame and hint), or no cached catalog (run the get once). With --output json, stdout is one document that also lists every finding under diagnostics. @@ -1557,10 +1581,11 @@ sim workflows source params [options] | Option | Required | Description | | --- | --- | --- | | `--dir ` | No | Source directory whose catalog to read. Defaults to `.`. | +| `--full` | No | Print every param with its type, enum, default and doc, not the brief form. | -Prints a builder's params (required first, with enums and defaults), the gate field that picks which others apply, and its outputs, from the block catalog the last get, create or check cached. No request is made. <builder> is the dotted builder path as source writes it: table.upsertRow, agent, trigger.schedule, slack.sendMessage (slack.tool.sendMessage names the same builder). A namespace (gmail, trigger.gmail) lists its builders; a block type prints the builder written for it (function is fn) or lists them (table_v2); a construct core.d.ts declares (loop, parallel, t, env) prints its declaration. Run it from a workflow or workspace source directory, or pass --dir. +Prints a builder in brief (an example call, the required params with types, the optional ones by name, the gate field that picks which others apply, and the outputs), from the block catalog the last get, create or check cached. --full prints every param with its type, enum, default and doc. A legacy builder names the one that replaces it. No request is made. <builder> is the dotted builder path as source writes it: table.upsertRow, agent, trigger.schedule, slack.sendMessage (slack.tool.sendMessage names the same builder). A namespace (gmail, trigger.gmail) lists its builders; a block type prints the builder written for it (function is fn) or lists them (table_v2); a construct core.d.ts declares (loop, parallel, t, env) prints its declaration. Run it from a workflow or workspace source directory, or pass --dir. Exit codes: 0 printed; 1 no builder or namespace of that name (the closest one is named), or no cached catalog (run a get once). diff --git a/apps/docs/content/docs/cli/workspaces.mdx b/apps/docs/content/docs/cli/workspaces.mdx index 3f9f86374d0..785bf582b8b 100644 --- a/apps/docs/content/docs/cli/workspaces.mdx +++ b/apps/docs/content/docs/cli/workspaces.mdx @@ -724,6 +724,7 @@ sim workspaces source status [options] | Option | Required | Description | | --- | --- | --- | +| `--summary-file ` | No | Also write the plan as Markdown to this file (or set SIM_SUMMARY_FILE), replacing it each run; its first line is a comment that names the directory, for a CI step that updates one pull-request comment. | | `--dir ` | No | Workspace source directory written by `workspaces source get`. Defaults to `.`. | | `--only ` | No | Report only these kinds (comma-separated folders: secrets.ts, credentials.ts, tools, skills, mcp, tables, knowledge, files, workflows, deployments). | | `--offline` | No | Report local changes only, without asking the server. | @@ -752,6 +753,7 @@ sim workspaces source apply [options] | Option | Required | Description | | --- | --- | --- | | `--verbose` | No | Also list the info findings hidden by default: every one with --output json, blocks placed by autolayout in the display. | +| `--summary-file ` | No | Also write the plan as Markdown to this file (or set SIM_SUMMARY_FILE), replacing it each run; its first line is a comment that names the directory, for a CI step that updates one pull-request comment. | | `--dir ` | No | Workspace source directory written by `workspaces source get`. Defaults to `.`. | | `--dry-run` | No | Plan and check without writing anything. | | `-y, --yes` | No | Apply without asking for confirmation. | @@ -766,7 +768,7 @@ Exit codes: 0 applied (or a clean dry run); 1 the source has errors (each printe API request and response schemas: [applyWorkspaceSource](/api-reference/workflows/applyWorkspaceSource), [findMissingWorkspaceSourceBlobs](/api-reference/workflows/findMissingWorkspaceSourceBlobs), [stageWorkspaceSourceBlobs](/api-reference/workflows/stageWorkspaceSourceBlobs), [getWorkspaceSource](/api-reference/workflows/getWorkspaceSource), [getSourceCatalog](/api-reference/catalog/getSourceCatalog), [getWorkflowDeployment](/api-reference/workflows/getWorkflowDeployment). -### Compile every workflow of a workspace source directory locally, without the server +### Compile and type-check every workflow of a workspace source directory locally, without the server ```bash sim workspaces source check [options] @@ -781,13 +783,14 @@ sim workspaces source check [options] | `--dir ` | No | Workspace source directory: the kind folders and .sim/base.json. Defaults to `.`. | | `--strict` | No | Fail on the warnings listed below in every block, not only new ones. | | `--no-strict` | No | Never fail on a warning an apply saves. | +| `--no-types` | No | Skip the type check (TypeScript 7.0.2 over tsconfig.json) that runs after the compile. | | `--verbose` | No | Also list the info findings hidden by default: every one with --output json, blocks placed by autolayout in the display. | -Compiles every workflows/<key>/workflow.ts (and the function files each names) with the compiler the server runs, against the workspace's block catalog the last get cached (in a fresh clone with no cache, such as CI, it downloads the catalog once with the profile's credentials). No other request is made. It checks, against what the directory declares: - env names (secrets.ts), with a did-you-mean - credential keys (credentials.ts) - the keys of tables, knowledge bases, skills, custom tools, MCP servers and workflows, with a did-you-mean, and a key holding a look-alike letter (a Cyrillic а) named by its code point - the columns and select options of a table row write - a child workflow call: an inputMapping key the child's Start trigger does not declare, and a child with no Start trigger - each tables/<key>.rows.jsonl: a malformed line, an undeclared column, a managed key two lines share, an empty required cell, a repeated unique value, a value its column's type or options cannot hold - block names whose words mix Latin with Cyrillic, Greek, Armenian or Cherokee letters The dry run still checks what only the server knows (stored values, MCP tool names, model ids, deployments, credential bindings), so run it before applying. A check also regenerates .sim/sdk/workspace.d.ts from the declarations (so tsc types a key added since the get, and each workflow's inputs) and adds the blocks the workflows now use to the CLI's tsconfig.json. +Compiles every workflows/<key>/workflow.ts (and the function files each names) with the compiler the server runs, against the workspace's block catalog the last get cached (in a fresh clone with no cache, such as CI, it downloads the catalog once with the profile's credentials). No other request is made to Sim. It checks, against what the directory declares: - env names (secrets.ts), with a did-you-mean - credential keys (credentials.ts) - the keys of tables, knowledge bases, skills, custom tools, MCP servers and workflows, with a did-you-mean, and a key holding a look-alike letter (a Cyrillic а) named by its code point - the columns and select options of a table row write - a child workflow call: an inputMapping key the child's Start trigger does not declare, and a child with no Start trigger - each tables/<key>.rows.jsonl: a malformed line, an undeclared column, a managed key two lines share, an empty required cell, a repeated unique value, a value its column's type or options cannot hold - block names whose words mix Latin with Cyrillic, Greek, Armenian or Cherokee letters The dry run still checks what only the server knows (stored values, MCP tool names, model ids, deployments, credential bindings), so run it before applying. A check also regenerates .sim/sdk/workspace.d.ts from the declarations (so a key added since the get is typed, and each workflow's inputs) and adds the blocks the workflows now use to the CLI's tsconfig.json. Then it type-checks the directory with TypeScript 7.0.2 (the release the declarations are built for) over tsconfig.json. Each type error is an E_TYPE error, its message starting with TypeScript's code. One is left out on a line the compile already reports an error on, and in a file still as the last get or apply wrote it when that file had the same error then (against the declarations as that get or apply left them). The first check installs that release with npm into the CLI's cache, once; when it cannot (offline, no npm), the check warns W_TYPES_UNCHECKED and passes or fails on the compile alone. --no-types skips the type check. -Exit codes: 0 no errors; 1 errors (each printed as file:line:column with its frame and hint), or no cached catalog (run the get once). With --output json, stdout is one document that also lists every finding under diagnostics. +Exit codes: 0 no errors; 1 errors (each printed as file:line:column with its frame and hint), or no cached catalog that could not be downloaded (a check downloads it once when none is cached, with the profile's credentials). With --output json, stdout is one document that also lists every finding under diagnostics. These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_CHILD_RESULT_PATH, W_BRANCH_UNWIRED, W_UNRESOLVED_REF, W_REF_OUT_OF_SCOPE, W_LOOP_CONDITION_SYNTAX. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict fails on none of them. In every mode, as the server refuses them: W_REF_OUT_OF_SCOPE is the error E_APPLY_REF_OUT_OF_SCOPE in any file of a block the edit added or changed; W_LOOP_CONDITION_SYNTAX is the error E_APPLY_LOOP_CONDITION_SYNTAX in any file of a block the edit added or changed; W_UNKNOWN_OPTION is the error E_APPLY_INVALID_SUBBLOCK_FIELD in workflow.ts on a block the edit added or changed; W_UNKNOWN_OUTPUT_PATH is the error E_APPLY_UNRESOLVED_REF in workflow.ts on a block the edit added or changed; W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in workflow.ts on a block the edit added or changed; W_UNKNOWN_BLOCK_TYPE is the error E_APPLY_INVALID_BLOCK_TYPE in workflow.ts on a block the edit added or changed; W_TYPE_NOT_ADDABLE is the error E_APPLY_TYPE_NOT_ADDABLE in workflow.ts on a block the edit added or changed; W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in a function file changed since the get; W_UNKNOWN_OUTPUT_PATH is the error E_APPLY_UNRESOLVED_REF in a function file changed since the get; W_CODE_FILE_REF_SYNTAX is the error E_APPLY_CODE_FILE_REF_SYNTAX in a function file changed since the get. A block counts as changed when the lock does not bind it, when the source moved it into another container, or when it compiles differently than in the source the last get or apply printed (.sim/stored-edges.json records a digest of each block). That last comparison needs the catalog the source was printed with in the cache: without it, a bound block that did not move counts as unchanged, so the server may refuse what the check passes. A $ref in a function file to a block the lock binds that the source no longer declares stays a warning, unless a warning cap left findings out: the server may infer that block was renamed and rewrite the reference, and refuses it otherwise. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block. diff --git a/apps/docs/content/docs/integrations/slack.mdx b/apps/docs/content/docs/integrations/slack.mdx index a7260e75879..d97664d897d 100644 --- a/apps/docs/content/docs/integrations/slack.mdx +++ b/apps/docs/content/docs/integrations/slack.mdx @@ -31,6 +31,9 @@ Custom-bot Slack triggers can stream workflow outputs directly back into the con - Loop and parallel invocations each create their own Slack response. - The response status label defaults to `Running` and can be customized in the trigger's advanced settings. - Optional thinking and tool-call updates appear as Slack tasks in a timeline or plan. +- **Show progress from** (`streamTimelineSources`) shows an Agent's tool steps, and its thinking when enabled, without posting its text. Use it when an Agent's output is reviewed or reformatted by a later block: the steps and the first streamed answer share one Slack reply. Agents in child workflows can be selected. A block cannot be both an output to stream and a progress source. +- **Tool step labels** (`streamToolLabels`) renames tool steps by tool name, for example `lc_cur` → `Reading AWS cost data`. Unlisted tools use a generated name. Steps never show tool arguments. +- With PII block-output redaction on, Agent output is not streamed live, so no progress steps appear; selected outputs are still sent when their block completes. - Slack Agent Sessions remain in processing state for the run, return to active when it finishes, and the native Slack stop button cancels active workflow executions. Automatic trigger responses require a custom bot created by the Slack setup wizard. They are not available with the shared Sim Slack app. Where the deployment enables shared-app triggers, the Sim app can receive its subscribed event subset without automatic streaming. @@ -75,7 +78,7 @@ Sim requests these scopes when someone connects a Slack account. For a self-host | `reactions:write` | Add emoji reactions to messages | | `reactions:read` | View emoji reactions on messages | -Requested only when `SLACK_EXTENDED_SCOPES` and `NEXT_PUBLIC_SLACK_EXTENDED_SCOPES` are enabled. Enable them only after Slack approves the app for these scopes: +Requested only when `SLACK_EXTENDED_SCOPES` is enabled. Enable them only after Slack approves the app for these scopes: | Scope | Description | | ----- | ----------- | @@ -3867,6 +3870,8 @@ Trigger from Slack events, interactions, and slash commands | `threads` | string | No | Include thread replies, exclude them \(top-level only\), or fire only on thread replies. | | `streamResponse` | boolean | No | Create a Slack agent session and stream selected workflow outputs into the conversation that started this run. Custom bots only. | | `streamOutputs` | workflow-output-selector | No | Use `<blockName>.<outputPath>` for this workflow or `<childWorkflowId>.<blockName>.<outputPath>` for a child workflow. Selecting a child workflow applies to every invocation of it. Agent outputs stream live; other outputs are sent when the block completes. | +| `streamTimelineSources` | workflow-output-selector | No | Agent blocks, including ones in child workflows, whose tool steps appear in the reply while they run. Their text is never posted. No steps appear when PII block-output redaction is on. | +| `streamToolLabels` | table | No | Optional names for tool steps, keyed by tool name \(an MCP tool by its own name, like lc_cur\). Unlisted tools use a generated name. | | `streamTaskTitle` | string | No | Optional status Slack shows while each selected response is being produced. Leave empty to use Running. | | `streamTaskDisplayMode` | string | No | Choose how Slack displays thinking and tool progress. | | `streamIncludeThinking` | boolean | No | Show agent thinking as Slack task updates while the response is generated. | diff --git a/apps/docs/content/docs/integrations/table.mdx b/apps/docs/content/docs/integrations/table.mdx index 79a60a6957c..a7290d139be 100644 --- a/apps/docs/content/docs/integrations/table.mdx +++ b/apps/docs/content/docs/integrations/table.mdx @@ -52,6 +52,7 @@ Insert a new row into a table. IMPORTANT: You must use the "data" parameter (not | Parameter | Type | Description | | --------- | ---- | ----------- | +| `ignoredColumns` | array | Keys of the written data that name no column of the table, which the write dropped. Empty when every key matched a column. | | `success` | boolean | Whether row was inserted | | `row` | json | Inserted row data | | `message` | string | Status message | @@ -75,6 +76,7 @@ Insert multiple rows into a table at once (up to 1000 rows) | Parameter | Type | Description | | --------- | ---- | ----------- | +| `ignoredColumns` | array | Keys of the written data that name no column of the table, which the write dropped. Empty when every key matched a column. | | `success` | boolean | Whether rows were inserted | | `rows` | array | Inserted rows data | | `insertedCount` | number | Number of rows inserted | @@ -94,12 +96,13 @@ Insert or update a row based on unique column constraints. If a row with matchin | --------- | ---- | -------- | ----------- | | `tableId` | string | Yes | Table ID in the execution workspace. In a workflow, the table must belong to the same workspace as the workflow. | | `data` | object | Yes | Row data to insert or update | -| `conflictTarget` | string | No | Unique column to match on. Required only when the table has more than one unique column. | +| `conflictTarget` | string | No | Unique column \(name or id\) to match on. Required only when the table has more than one unique column. | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | +| `ignoredColumns` | array | Keys of the written data that name no column of the table, which the write dropped. Empty when every key matched a column. | | `success` | boolean | Whether row was upserted | | `row` | json | Upserted row data | | `operation` | string | Operation performed: insert or update | @@ -125,6 +128,7 @@ Update an existing row in a table. Supports partial updates - only include the f | Parameter | Type | Description | | --------- | ---- | ----------- | +| `ignoredColumns` | array | Keys of the written data that name no column of the table, which the write dropped. Empty when every key matched a column. | | `success` | boolean | Whether row was updated | | `row` | json | Updated row data | | `message` | string | Status message | @@ -150,6 +154,7 @@ Update multiple rows that match filter criteria. Data is merged with existing ro | Parameter | Type | Description | | --------- | ---- | ----------- | +| `ignoredColumns` | array | Keys of the written data that name no column of the table, which the write dropped. Empty when every key matched a column. | | `success` | boolean | Whether rows were updated | | `updatedCount` | number | Number of rows updated | | `updatedRowIds` | array | IDs of updated rows | diff --git a/apps/docs/content/docs/introduction/index.mdx b/apps/docs/content/docs/introduction/index.mdx index 78c208e0151..5e56aef065d 100644 --- a/apps/docs/content/docs/introduction/index.mdx +++ b/apps/docs/content/docs/introduction/index.mdx @@ -57,7 +57,7 @@ The core source is available on [GitHub](https://github.com/simstudioai/sim) und ## Security and compliance -Sim is SOC 2 Type II compliant. Find reports and security details in the [trust center](https://trust.sim.ai/). +Sim has completed a SOC 2 Type II audit covering the Security Trust Services Criterion, and ISO 27001 certification is in progress. Find reports and security details in the [trust center](https://trust.sim.ai/). Enterprise organizations can sign in through [SSO](/platform/enterprise/sso) with SAML 2.0 or OIDC, including Microsoft Entra ID, Okta, and Google Workspace. They can also sync members from Entra ID or Okta with [SCIM](/platform/enterprise/scim), review [audit logs](/platform/enterprise/audit-logs), and restrict models, blocks, and tools with [permission groups](/platform/enterprise/access-control). diff --git a/apps/docs/content/docs/meta.json b/apps/docs/content/docs/meta.json index 4a9220fc06b..46999555c52 100644 --- a/apps/docs/content/docs/meta.json +++ b/apps/docs/content/docs/meta.json @@ -11,6 +11,7 @@ "---Build---", "chat", "workflows", + "workflows/code", "agents", "---Workspace---", "knowledgebase", diff --git a/apps/docs/content/docs/platform/costs.mdx b/apps/docs/content/docs/platform/costs.mdx index 13a483821e9..4093afa7ae5 100644 --- a/apps/docs/content/docs/platform/costs.mdx +++ b/apps/docs/content/docs/platform/costs.mdx @@ -181,6 +181,12 @@ Current monthly pricing and allocations are: Pro and Max are available for individuals or teams. Team subscriptions pool credits across internal seats. For example, Max for Teams with three seats has a 75,000-credit monthly allocation and a 12,000-credit weekly refresh allowance. External collaborators do not add seats, but their work in an organization-owned workspace is billed to that organization. +### Pro free trial + +A new individual Pro subscriber gets a 14-day free trial. Checkout requires a card, which is charged for Pro when the trial ends unless you cancel first under **Settings → Subscription**. During the trial you get Pro features and Sim-hosted models and tools, with a fixed allowance of 2,000 credits: there is no weekly refresh, the usage limit cannot be raised, and nothing is billed past it. When the trial converts, the full Pro allowance applies. + +Each account and each card can start one trial. A checkout whose card already started a trial is charged right away instead. Team plans and Max don't include a trial. + See [current pricing](https://www.sim.ai/pricing) and **Settings → Subscription** for the plan available to your account. Internal membership, external eligibility, and workspace migration are explained in [Roles and permissions](/platform/permissions#internal-and-external-membership). ### Weekly refresh diff --git a/apps/docs/content/docs/platform/enterprise/self-hosted.mdx b/apps/docs/content/docs/platform/enterprise/self-hosted.mdx index 602ea92d74f..27fa5a70675 100644 --- a/apps/docs/content/docs/platform/enterprise/self-hosted.mdx +++ b/apps/docs/content/docs/platform/enterprise/self-hosted.mdx @@ -162,7 +162,7 @@ curl -X PATCH https://sim.example.com/api/v1/admin/organizations/$ORG_ID/session -When invitations are disabled with `DISABLE_INVITATIONS` and `NEXT_PUBLIC_DISABLE_INVITATIONS`, use the Admin API to manage organization membership and workspace access. Internal members join the organization. External workspace members receive access to a specific workspace without joining the organization. +When invitations are disabled with `DISABLE_INVITATIONS`, use the Admin API to manage organization membership and workspace access. Internal members join the organization. External workspace members receive access to a specific workspace without joining the organization. ### Read audit logs and permission groups diff --git a/apps/docs/content/docs/platform/self-hosting/authentication.mdx b/apps/docs/content/docs/platform/self-hosting/authentication.mdx index 9a459e00094..9cfd8b2d04a 100644 --- a/apps/docs/content/docs/platform/self-hosting/authentication.mdx +++ b/apps/docs/content/docs/platform/self-hosting/authentication.mdx @@ -189,8 +189,8 @@ Requests use a shared anonymous session. | Variable | Effect | | --- | --- | -| `DISABLE_INVITATIONS=true` / `NEXT_PUBLIC_DISABLE_INVITATIONS=true` | Disable workspace invitations globally. | -| `DISABLE_PUBLIC_API=true` / `NEXT_PUBLIC_DISABLE_PUBLIC_API=true` | Disable the public API globally. | +| `DISABLE_INVITATIONS=true` | Disable workspace invitations globally. | +| `DISABLE_PUBLIC_API=true` | Disable the public API globally. | | `ADMIN_API_KEY` | Enables Admin API GitOps operations and organization provisioning. | Set both server and `NEXT_PUBLIC_` flags where a pair is listed. The server flag enforces the restriction; its counterpart controls the UI. diff --git a/apps/docs/content/docs/platform/self-hosting/environment-variables.mdx b/apps/docs/content/docs/platform/self-hosting/environment-variables.mdx index 72e006b327b..9aba3b7f1b5 100644 --- a/apps/docs/content/docs/platform/self-hosting/environment-variables.mdx +++ b/apps/docs/content/docs/platform/self-hosting/environment-variables.mdx @@ -199,7 +199,7 @@ Plain JavaScript without imports runs in isolated-vm within Node child workers i | Variable | Description | |----------|-------------| -| `WORKFLOW_CODE` | Set to `true` to enable [workflows as code](/workflows/code) and [workspace as code](/workflows/workspace-code): the read-only **Code** tab in the workflow builder, and the source API and MCP operations that the `sim workflows source` and `sim workspaces source` CLI commands call. Off when unset; while off, those operations answer `403` | +| `WORKFLOW_CODE` | Set to `true` to enable [workflows as code](/workflows/code) and [workspace as code](/workflows/code/workspace): the read-only **Code** tab in the workflow builder, and the source API and MCP operations that the `sim workflows source` and `sim workspaces source` CLI commands call. Off when unset; while off, those operations answer `403` | ## Chat and PII [#chat--pii] @@ -268,7 +268,7 @@ Most `/api` routes also pass through Next.js Proxy, which buffers only the first ## Limits -With `BILLING_ENABLED` disabled, hosted-plan execution rates/timeouts and table/storage quotas are not enforced unless you set their free-tier variables. Independent protocol, body-size, concurrency, and security rate limits still apply. Billing-enabled deployments enforce their plan limits. Keep `BILLING_ENABLED` and `NEXT_PUBLIC_BILLING_ENABLED` consistent so enforcement and the UI agree. +With `BILLING_ENABLED` disabled, hosted-plan execution rates/timeouts and table/storage quotas are not enforced unless you set their free-tier variables. Independent protocol, body-size, concurrency, and security rate limits still apply. Billing-enabled deployments enforce their plan limits. Retention cleanup is separately opt-in through `DATA_RETENTION_ENABLED` or the enterprise suite. A configured retention policy still applies without billing; see [Data retention](/platform/enterprise/data-retention). diff --git a/apps/docs/content/docs/platform/self-hosting/integrations-oauth.mdx b/apps/docs/content/docs/platform/self-hosting/integrations-oauth.mdx index 0d125a545a7..51b0d71f48d 100644 --- a/apps/docs/content/docs/platform/self-hosting/integrations-oauth.mdx +++ b/apps/docs/content/docs/platform/self-hosting/integrations-oauth.mdx @@ -477,7 +477,7 @@ Webhook triggers receive callbacks from the provider and must be able to verify | Variable | Needed for | |---|---| | `SLACK_SIGNING_SECRET` | Verifying Slack event and slash-command signatures | -| `SLACK_EXTENDED_SCOPES` / `NEXT_PUBLIC_SLACK_EXTENDED_SCOPES` | Enabling the native Sim-app trigger and its broader Slack scope set; set both to the same value | +| `SLACK_EXTENDED_SCOPES` | Enabling the native Sim-app trigger and its broader Slack scope set | When enabling the native Sim Slack trigger, configure all three variables together. Enable the extended-scope flags only after Slack approves the app for `assistant:write`, `app_mentions:read`, and `im:history`; otherwise Slack rejects OAuth authorization. Slack OAuth actions can use `SLACK_CLIENT_ID` and `SLACK_CLIENT_SECRET` without enabling the native trigger or supplying a signing secret. diff --git a/apps/docs/content/docs/platform/self-hosting/sandboxes.mdx b/apps/docs/content/docs/platform/self-hosting/sandboxes.mdx index 763d5869541..2fca0deee9a 100644 --- a/apps/docs/content/docs/platform/self-hosting/sandboxes.mdx +++ b/apps/docs/content/docs/platform/self-hosting/sandboxes.mdx @@ -134,7 +134,7 @@ MOTHERSHIP_E2B_TEMPLATE_ID= DAYTONA_SHELL_SNAPSHOT_ID= ``` -These values do not replace `E2B_FUNCTION_TEMPLATE_ID` or `DAYTONA_FUNCTION_SNAPSHOT_ID`. Shell, Function, document, and Pi images have separate package contracts and release cadences. Pi also needs `E2B_PI_TEMPLATE_ID` or `DAYTONA_PI_SNAPSHOT_ID`; revealing a Pi mode with `NEXT_PUBLIC_E2B_ENABLED` does not supply that image. +These values do not replace `E2B_FUNCTION_TEMPLATE_ID` or `DAYTONA_FUNCTION_SNAPSHOT_ID`. Shell, Function, document, and Pi images have separate package contracts and release cadences. Pi also needs `E2B_PI_TEMPLATE_ID` or `DAYTONA_PI_SNAPSHOT_ID`; `E2B_ENABLED` reveals the Pi cloud modes but does not supply that image. ## Related docs diff --git a/apps/docs/content/docs/platform/self-hosting/security.mdx b/apps/docs/content/docs/platform/self-hosting/security.mdx index 2d1c1bad019..0babcb06fb5 100644 --- a/apps/docs/content/docs/platform/self-hosting/security.mdx +++ b/apps/docs/content/docs/platform/self-hosting/security.mdx @@ -195,13 +195,7 @@ no remote provider is configured. Without valid provider credentials and the required Function image, code that needs a remote sandbox fails with a configuration error. Verify readiness before enabling its browser controls. -The Function block's Sandbox selector, Shell, and **Settings → Sandboxes** follow the server's own readiness check; no browser variable is involved. One browser-side variable relates to sandbox readiness and is not derived automatically: - -| Variable | Effect when unset | -|---|---| -| `NEXT_PUBLIC_E2B_ENABLED` | The E2B-backed Pi block modes stay hidden; `sim-setup doctor` reports it as a mismatch against `E2B_ENABLED`. Revealing them is not enough to make them run — Pi executes on its own image, pinned with `E2B_PI_TEMPLATE_ID` or `DAYTONA_PI_SNAPSHOT_ID`, and fails closed without it | - -Set it only **after** the server-side configuration above is complete — it is an assertion about readiness, not a switch, and the server-side check has its own conditions beyond it. See [Sandboxes](/platform/self-hosting/sandboxes) for the base-image build and promotion procedure. `bunx sim-setup doctor` reports a mismatch in either direction. +The Function block's Sandbox selector, Shell, and **Settings → Sandboxes** follow the server's own readiness check; no browser variable is involved. The E2B-backed Pi block modes appear when `E2B_ENABLED` is set. Revealing them is not enough to make them run — Pi executes on its own image, pinned with `E2B_PI_TEMPLATE_ID` or `DAYTONA_PI_SNAPSHOT_ID`, and fails closed without it. See [Sandboxes](/platform/self-hosting/sandboxes) for the base-image build and promotion procedure. With the default local sandbox, treat everyone who can author a workflow as someone running code in your app container's security context. If your Sim instance is open to a wide or partly-trusted audience, use a remote sandbox provider and enable the NetworkPolicy egress restrictions. diff --git a/apps/docs/content/docs/platform/self-hosting/upgrades.mdx b/apps/docs/content/docs/platform/self-hosting/upgrades.mdx index 10c22694f2a..f4e9cecda22 100644 --- a/apps/docs/content/docs/platform/self-hosting/upgrades.mdx +++ b/apps/docs/content/docs/platform/self-hosting/upgrades.mdx @@ -75,7 +75,7 @@ Check the changes for every release between your current version and the target |---|---| | **Redis is required.** Sim refuses to start without `REDIS_URL`; there is no PostgreSQL or in-memory fallback. | Keep the bundled Redis, or point `REDIS_URL` at a managed instance before upgrading. App and realtime must reach the same Redis. See [Redis](/platform/self-hosting/redis). | | **`REGISTRATION_MODE` replaces `DISABLE_REGISTRATION`, `DISABLE_EMAIL_SIGNUP`, and `EMAIL_PASSWORD_SIGNUP_ENABLED`** (and its `NEXT_PUBLIC_` twin). The old variables are still honored as deprecated aliases, and the most restrictive setting wins. `NEXT_PUBLIC_EMAIL_PASSWORD_SIGNUP_ENABLED=false` now also disables email/password sign-in on the server. | Move to `REGISTRATION_MODE`. See [Control registration and sign-in](/platform/self-hosting/authentication#controlling-who-can-sign-up). | -| **Enterprise `NEXT_PUBLIC_*` flags and `NEXT_PUBLIC_SANDBOXES_ENABLED` are no longer read.** The browser reads the server's resolved settings. | Set the server variable for each feature. See the [feature flag reference](/platform/enterprise/self-hosted#feature-flag-reference). | +| **Enterprise `NEXT_PUBLIC_*` flags and `NEXT_PUBLIC_SANDBOXES_ENABLED` are no longer read, nor are `NEXT_PUBLIC_BILLING_ENABLED`, `NEXT_PUBLIC_E2B_ENABLED`, `NEXT_PUBLIC_SLACK_EXTENDED_SCOPES`, `NEXT_PUBLIC_DISABLE_INVITATIONS`, and `NEXT_PUBLIC_DISABLE_PUBLIC_API`.** The browser reads the server's resolved settings. | Set the server variable for each feature (`BILLING_ENABLED`, `E2B_ENABLED`, `SLACK_EXTENDED_SCOPES`, `DISABLE_INVITATIONS`, `DISABLE_PUBLIC_API`, …). See the [feature flag reference](/platform/enterprise/self-hosted#feature-flag-reference). | | **`ALLOW_PRIVATE_DATABASE_HOSTS` was removed.** The app logs an error at startup if it is still set. | Name your database, cache, and mail hosts in the egress allowlists. See [Upgrading from an earlier release](/platform/self-hosting/security#upgrading-from-an-earlier-release). | | **White-labeling was removed.** `NEXT_PUBLIC_BRAND_*`, `NEXT_PUBLIC_CUSTOM_CSS_URL`, `NEXT_PUBLIC_SUPPORT_EMAIL`, `NEXT_PUBLIC_DOCUMENTATION_URL`, `NEXT_PUBLIC_TERMS_URL`, `NEXT_PUBLIC_PRIVACY_URL`, `WHITELABELING_ENABLED`, and `NEXT_PUBLIC_WHITELABELING_ENABLED` are ignored. | Remove them at your convenience; leaving them set is harmless. | | **`docker-compose.ollama.yml` is now an overlay on `docker-compose.prod.yml`.** | A stack started from the previous standalone file needs its project name carried over, or it starts on an empty database. See [Migrating from the previous Ollama stack](/platform/self-hosting/docker#migrating-from-the-previous-ollama-stack). | diff --git a/apps/docs/content/docs/tables/using-in-workflows.mdx b/apps/docs/content/docs/tables/using-in-workflows.mdx index 71693f3e1a9..2192a27aefa 100644 --- a/apps/docs/content/docs/tables/using-in-workflows.mdx +++ b/apps/docs/content/docs/tables/using-in-workflows.mdx @@ -126,6 +126,8 @@ Use **Get Row by ID** for a point lookup and **Get Schema** for column definitio } ``` +A key that names no column is dropped, and the write still succeeds. Every insert, upsert, and update reports the dropped keys in ``, an empty list when every key matched, so a downstream condition can catch a misspelled column. Public v2 API writes reject an unknown column instead. + Upsert requires a unique column. If the table has several, select **Conflict Column** to choose the match target. Unlisted fields remain unchanged in a partial update. For different results per row, use a sequential Loop and **Update Row by ID**. A filter update applies the same values to every match; with no **Limit**, it walks all matches in batches. The 1,000 maximum applies to an explicitly supplied update limit, not the total for an unlimited filtered update. diff --git a/apps/docs/content/docs/workflows/blocks/agent.mdx b/apps/docs/content/docs/workflows/blocks/agent.mdx index 751799feead..fd5cc0c4e3b 100644 --- a/apps/docs/content/docs/workflows/blocks/agent.mdx +++ b/apps/docs/content/docs/workflows/blocks/agent.mdx @@ -32,7 +32,7 @@ Answer in two sentences, cite the doc you used, and never guess a price. ### Model -The model that runs the step. Defaults to `claude-sonnet-5-5`. Type or pick any model from OpenAI, Anthropic, Google, xAI, Groq, Cerebras, DeepSeek, Azure, AWS Bedrock, Google Vertex, or OpenRouter, or a local model through Ollama or vLLM. +The model that runs the step. Defaults to `claude-sonnet-5-5`. Type or pick any model from OpenAI, Anthropic, Google, xAI, Groq, Cerebras, DeepSeek, Azure, AWS Bedrock, Google Vertex, or OpenRouter, or a local or self-hosted model through Ollama, vLLM, or LiteLLM. For a custom cloud deployment, enter its provider prefix and model ID: `azure/my-deployment`, `azure-anthropic/my-deployment`, `bedrock/my-inference-profile`, or `vertex/my-gemini-model`. The prefix selects the provider and shows its credential fields even when the ID is absent from the catalog. Bedrock accepts full inference profile ARNs after `bedrock/`; Vertex uses the Gemini API and accepts Google model resource names. The deployment must support the selected provider's API. Custom IDs have no catalog pricing or token limits. diff --git a/apps/docs/content/docs/workflows/blocks/function.mdx b/apps/docs/content/docs/workflows/blocks/function.mdx index ef5d27b755b..17932ba1660 100644 --- a/apps/docs/content/docs/workflows/blocks/function.mdx +++ b/apps/docs/content/docs/workflows/blocks/function.mdx @@ -435,6 +435,15 @@ The lazy `sim.files` and `sim.values` helpers are available only in JavaScript f An uncaught error follows the connected error port or fails the run. Catch an error only when your code can return a meaningful recovery result. `console.log()`, `print()`, and ordinary Shell output appear in `stdout` and the run logs. +On the error path, the failed block has two outputs: + +| Output | What it is | +| --- | --- | +| `` | The message with the line and code that threw: ``Line 4: `throw new Error('invalid phone')` - invalid phone`` | +| `` | The thrown message alone: `invalid phone` | + +Use `` in a reply to a caller, such as a Response block's body, so the caller never sees your code. Use `` when you need the line to debug. A failure your code did not throw, such as a timeout, has no line, so both hold the same message. + Function uses the workflow's remaining execution time when a deadline exists. Without a workflow deadline, it still has a fallback timeout of 300,000 ms (5 minutes) by default, configurable through `EXECUTION_TIMEOUT_FREE`. An explicit internal timeout can replace that fallback or shorten the workflow budget; it cannot extend the workflow deadline. There is no separate timeout field in the current block editor. Exceeding the budget terminates execution and reports a block error. ## Related docs diff --git a/apps/docs/content/docs/workflows/blocks/human-in-the-loop.mdx b/apps/docs/content/docs/workflows/blocks/human-in-the-loop.mdx index 15eb134623c..15fb1ec23e1 100644 --- a/apps/docs/content/docs/workflows/blocks/human-in-the-loop.mdx +++ b/apps/docs/content/docs/workflows/blocks/human-in-the-loop.mdx @@ -76,7 +76,7 @@ HITL blocks are excluded from the selected-output picker because pause data is i ## Resume with the v2 API -A v2 execute call can return `data.status: "paused"`. Read `contextId` from `data.output.data._resume` and the paused run's ID from `data.runId`: +A v2 execute call can return `data.status: "paused"`. Read the run to resume from `data.paused.runId`, and the `contextId` of a waiting `human` point from `data.paused.points`: ```bash curl -X POST 'https://www.sim.ai/api/v2/workflows/WORKFLOW_ID/runs/RUN_ID/resume' \ @@ -102,12 +102,13 @@ For an originally synchronous run, the response waits for the resumed execution "error": null, "startedAt": "2026-10-13T10:00:00.000Z", "endedAt": "2026-10-13T10:00:01.234Z", - "durationMs": 1234 + "durationMs": 1234, + "paused": null } } ``` -A later Human block can pause the resumed run again, returning new pause data. The resumed attempt has its own `runId`. +A later Human block can pause the resumed run again. The response then has `status: "paused"` and new `paused.points`, and `paused.runId` names the run to resume next: the run you resumed, not the attempt's own `runId`. ### Asynchronous and originally streaming runs diff --git a/apps/docs/content/docs/workflows/blocks/pi.mdx b/apps/docs/content/docs/workflows/blocks/pi.mdx index 868d1c3b499..c7301eb3876 100644 --- a/apps/docs/content/docs/workflows/blocks/pi.mdx +++ b/apps/docs/content/docs/workflows/blocks/pi.mdx @@ -232,7 +232,7 @@ Enable the Pi sandbox as below and supply a provider BYOK key. For private repos Create PR runs in a sandbox image with the Pi CLI, Git, Node.js, and Bun baked in. Repository dependencies are not preinstalled; Pi can run `bun install` when a repository needs them. -1. **Enable sandbox execution.** On self-hosted Sim, set `E2B_ENABLED=true`, `E2B_API_KEY`, `E2B_PI_TEMPLATE_ID` (the Pi template id), and `NEXT_PUBLIC_E2B_ENABLED=true` (this reveals Plan, Create PR, Update PR, and Review Code in the UI). Build the template with `bun run apps/sim/scripts/build-pi-e2b-template.ts`. These modes stay hidden until `NEXT_PUBLIC_E2B_ENABLED` is set. +1. **Enable sandbox execution.** On self-hosted Sim, set `E2B_ENABLED=true`, `E2B_API_KEY`, and `E2B_PI_TEMPLATE_ID` (the Pi template id). Build the template with `bun run apps/sim/scripts/build-pi-e2b-template.ts`. Plan, Create PR, Update PR, and Review Code stay hidden until `E2B_ENABLED` is set. The repository template requests **4 vCPU and 8 GiB of RAM**. Confirm your account’s build and session limits against [E2B pricing](https://e2b.dev/pricing); account limits can be lower than Sim’s requested lifetime. Sizing is fixed when the template is built — E2B has no per-sandbox override — so changing it means rebuilding the template, not restarting Sim. Sandboxes are billed per second against the resources they are allocated, not the ones they use. Both numbers live in `apps/sim/scripts/pi-sandbox-packages.ts` and are shared with the Daytona snapshot so the failover image cannot drift from the primary. diff --git a/apps/docs/content/docs/workflows/blocks/router.mdx b/apps/docs/content/docs/workflows/blocks/router.mdx index f2a04ac3491..15570614a3b 100644 --- a/apps/docs/content/docs/workflows/blocks/router.mdx +++ b/apps/docs/content/docs/workflows/blocks/router.mdx @@ -22,7 +22,7 @@ Pass `` as Context, describe Sales, Support, and Billing routes, an | --- | --- | | **Context** | Text to analyze, often `` or ``. | | **Routes** | Each route has a title and a description of when to choose it. It adds a separate output port. | -| **Model** | Defaults to `claude-sonnet-5-5`. Select a supported model, including a compatible local Ollama or vLLM model. | +| **Model** | Defaults to `claude-sonnet-5-5`. Select a supported model, including a compatible local Ollama, vLLM, or LiteLLM model. | Make descriptions specific and distinguishable. For example, “Payments, invoices, and refunds” separates Billing from general product support. Test the routes on representative requests rather than assuming a larger model always routes more accurately. diff --git a/apps/docs/content/docs/workflows/code.mdx b/apps/docs/content/docs/workflows/code.mdx deleted file mode 100644 index 81d14deb04d..00000000000 --- a/apps/docs/content/docs/workflows/code.mdx +++ /dev/null @@ -1,224 +0,0 @@ ---- -title: Workflows as code -description: Read and edit a workflow as one TypeScript file, check it before saving, and review changes as diffs. ---- - -import { Callout } from '@/components/ui/callout' - -Every workflow can be read and written as a TypeScript file. 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. - - -Workflows as code is in preview. When it is [enabled on your Sim deployment](/platform/self-hosting/environment-variables#preview-features), the workflow builder shows a read-only **Code** tab and the [CLI](/cli) gains the `sim workflows source` commands. - - -## For coding agents [#for-coding-agents] - -Claude Code, Cursor, Codex and other coding agents work from a directory that `get` writes. `get` prints a short primer (the edit loop, how block identity, references and renames work, failures and retries, test runs, deletes, deploy, exit codes, and the params of each builder the workflow already uses; in JSON output, its `primer` field), and the same primer opens `.sim/AGENTS.md`, the full guide. The loop: - -1. `sim workflows source get --dir ` writes the workflow and the guide. -2. Edit `workflow.ts`. -3. `sim workflows source check --dir ` compiles it offline. -4. `sim workflows source status --dir ` shows what changed and what to run next. -5. `sim workflows source apply --dir --dry-run`, then `--yes`, saves the draft. - -To write a block the workflow does not use yet, `sim workflows source params ` (for example `table.upsertRow` or `trigger.schedule`) prints its params, required ones first with their options and defaults, and its outputs, from the cached block catalog without a request. A namespace such as `gmail` lists its builders. - -For a whole workspace, use `sim workspaces source` with the same steps; see [Workspace as code](/workflows/workspace-code). - -## What the file holds - -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. - -## Edit a workflow from the CLI - -1. Write the workflow into a directory: - - ```bash - sim workflows source get --dir ./support-triage - ``` - - This writes `workflow.ts`, any function code under `functions/`, and type declarations for the blocks the workflow uses and for your workspace's tables, credentials, knowledge bases, and environment variable names, with `.sim/sdk/INDEX.md` listing those blocks' builders. The declarations of every block are generated once per block catalog into the CLI's cache (`~/.sim/cache/source-catalog/`) and shared by every directory. It also writes a `tsconfig.json` that resolves them and type-checks the blocks the workflow uses, and a `tsconfig.full.json` that type-checks every block through that cache, unless the directory already has files of those names, which are left as they are. For coding agents it writes `.sim/AGENTS.md`, the primer `get` prints followed by a reference, and example workflows under `.sim/examples/` with one correct example of each common block to copy from. The examples name placeholder resources, so the tsconfig files leave them out of the type-check. - - `get` into a directory that already holds source refuses to overwrite edits you have not applied, and refuses a directory that holds a different workflow. Pass `--force` to replace them. A workspace source directory is always refused, `--force` included (and `sim workspaces source get` refuses a workflow directory the same way). - -2. Edit `workflow.ts`, then compile it on your machine with Sim's compiler, without a request: - - ```bash - sim workflows source check --dir ./support-triage - ``` - - It exits 1 on an error, and on the warnings `sim workflows source check --help` lists (a missing required field, an unknown option, an unwired condition or router branch, a literal secret and more) in a block you added since the get (`--strict` fails on these in every block, except an unwired branch on a block the get printed, which the stored workflow may hold; `--no-strict` never fails on a warning). It also adds the blocks the workflow now uses to `tsconfig.json`. Your editor type-checks the file against the generated declarations, and `bunx -p typescript@7.0.2 tsc -p ./support-triage` checks it from the command line with the TypeScript release the declarations are built for; `-p ./support-triage/tsconfig.full.json` type-checks against every block. - -3. See what changed, and whether someone changed the workflow since your `get`: - - ```bash - sim workflows source status --dir ./support-triage - sim workflows source diff --dir ./support-triage - ``` - - `status` lists the files you created, edited, or deleted, asks the server (with a dry run that saves nothing) whether the workflow changed since the `get`, and ends with the one command to run next. It exits `0` when nothing changed, `11` when only your edits are unsaved, and `12` when the workflow changed in the editor since the `get` (a conflict, if you edited it too). Without a connection it shows your edits only and says so; `--offline` skips the server. `diff` prints each edit as a unified diff, and `diff --server` compares the directory with the workflow as it is saved now. Both take `--json` (or `--output json`). - -4. Check the change without saving it: - - ```bash - sim workflows source apply --dir ./support-triage --dry-run - ``` - - `apply` reads the workflow ID from `.sim/base.json`. Pass it as `apply --dir …` to have the CLI confirm the directory holds that workflow. Every command that reads a source directory (`check`, `status`, `diff`, `params`, `apply`, and their `sim workspaces source` counterparts) defaults `--dir` to the current directory; `get` and `create`, which write one, always need `--dir`. - - Sim compiles the file and runs every check a save would run: unknown settings, missing required fields, broken references, permissions, and locked blocks. Each problem prints with its line, the code around it, and a hint: - - ``` - workflow.ts:56:7 error E_UNKNOWN_PARAM: Slack has no param chanel. - 54 | const notify = slack.sendMessage('Notify', { - 55 | credential: credential('support-slack'), - > 56 | chanel: 'C0SUPPORT', - | ^^^^^^^^^^^^^^^^^^^ - 57 | text: t`New ${classify.category} ticket: ${ticketIn.subject}`, - hint: Did you mean channel? - ``` - -5. Save the draft: - - ```bash - sim workflows source apply --dir ./support-triage --yes - ``` - - The workflow builder updates for anyone who has the workflow open. Deploy when you are ready, or add `--deploy` to deploy right after the save, which also prints the URL of each webhook the workflow now serves; without it, a deployed workflow whose draft now differs prints the `sim workflows deploy` command to run. `--yes` refuses everything a dry run would, so step 4 is optional: without `--yes`, and with no terminal to ask, `apply` prints the plan, writes nothing and exits `14`. The save rewrites `workflow.ts` in canonical form, so read it again before the next edit. - - Editing the name or description in `workflow('…')` renames or redescribes the workflow; a name another workflow in its folder already has is refused with `E_NAME_TAKEN`. Lines starting with `note:` report something the save did beyond what the file says; read them. - - A save that removes a block (its declaration is gone from `workflow.ts`) is refused with `E_APPLY_BLOCK_DELETE`, naming the blocks, and one that removes a workflow variable with `E_APPLY_VARIABLE_DELETE`. Pass `--allow-delete` when the deletion is intended. - -To create a new workflow, run `sim workflows source create --dir --workspace ` on an empty directory: without `--dry-run` or `--yes` it creates nothing and writes a starter `workflow.ts` with that workspace's type declarations, `tsconfig.json` and `.sim/AGENTS.md`, and records the workspace in `.sim/starter.json`. Edit the starter, check it, then run `sim workflows source create --dir --workspace --dry-run` and `--yes` (the starter prints both). 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. The file starts with the `// @sim-sdk 1` line and default-exports one `workflow('Name', {}, () => { ... })`. The command prints the new workflow ID and writes the same type declarations, `tsconfig.json`, and `.sim/` files that `get` writes, so you can continue editing with `apply`. If another workflow already has that name, the command exits `1`; pass `--name` to choose another. - -Keep the `.sim/` folder the commands write. `.sim/lock.json` ties each block in the file to the stored block, so renaming a block keeps the same block, with its webhook URL, schedules and run history. Changing its name string keeps it through the lock; renaming the variable too keeps it when the block's type, parent and connections are unchanged, and the dry run reports that as `W_MAT_INFERRED_RENAME`. Renaming two blocks of the same type in the same place in one save is ambiguous, so do those one save at a time. `.sim/base.json` records the version you read. - -## Example: support triage - -A webhook receives a ticket, an agent classifies it, billing tickets are logged to a table, and the team hears about every ticket in Slack. This is the file `sim workflows source get` prints for it: - -```ts title="workflow.ts" -// @sim-sdk 1 -import { - agent, - condition, - credential, - env, - js, - slack, - t, - table, - trigger, - workflow, -} from '@sim/workflow-sdk' - -export default workflow( - 'Support triage', - { variables: { escalations: { type: 'number', value: 0 } } }, - () => { - const ticketIn = trigger.webhook('Ticket in', { - requireAuth: true, - token: env.TICKETS_WEBHOOK_TOKEN, - inputFormat: { subject: 'string', body: 'string', contacts: 'array' }, - responseMode: 'custom', - responseStatusCode: 202, - responseBody: { ok: true }, - }) - const classify = agent('Classify', { - messages: [ - { role: 'system', content: 'Classify support tickets.' }, - { - role: 'user', - content: t`${ticketIn.subject} - -${ticketIn.body}`, - }, - ], - model: 'claude-sonnet-5-5', - responseFormat: { - name: 'ticket', - strict: true, - schema: { - type: 'object', - additionalProperties: false, - required: ['category', 'urgent'], - properties: { - category: { type: 'string', enum: ['billing', 'bug', 'other'] }, - urgent: { type: 'boolean' }, - }, - }, - }, - }) - const byCategory = condition('By category', { - billing: js`${classify.category} === 'billing'`, - else: true, - }) - const logTicket = table.insertRow('Log ticket', { - tableId: table('tickets'), - data: { subject: ticketIn.subject, category: classify.category }, - }) - const notify = slack.sendMessage('Notify', { - credential: credential('support-slack'), - channel: 'C0SUPPORT', - text: t`New ${classify.category} ticket (urgent: ${classify.urgent}): ${ticketIn.subject}`, - }) - - ticketIn.to(classify) - classify.to(byCategory) - byCategory.billing.to(logTicket) - byCategory.else.to(notify) - logTicket.to(notify) - logTicket.onError(notify) - } -) -``` - -How to read it: - -- Each `const` is a block. `agent`, `condition`, `table.insertRow`, and `slack.sendMessage` are the blocks you know from the workflow builder, with the same settings. -- `classify.category` is a typed reference to another block's output, the same as `` in the builder. `t` writes text with references in it; `js` writes code. -- `table('tickets')` and `credential('support-slack')` name workspace resources by a stable key. Renaming the table in Sim keeps the key. -- `env.TICKETS_WEBHOOK_TOKEN` reads an environment variable. Secret values are never printed: a key pasted into a password field prints as `stored()`, which keeps the saved value. -- `.to()` connects blocks, `byCategory.billing` is one branch of the condition, and `.onError()` follows the error path. `notify` has three incoming edges and runs once, after the branch that was taken. -- A webhook answers its caller as soon as the request is accepted and runs the workflow in the background, so the caller never sees a `response` block's output. `responseMode: 'custom'` sets that fixed answer (here `202` with `{ "ok": true }`; without it, `200` with `{ "message": "Webhook processed" }`). To answer with values the run computes, start the workflow with `trigger.start` and call it through the API; a `response` block then sets what the caller receives. - -## Function code - -Code that does not fit a block goes in a Function block, kept in its own file: - -```ts -const score = fn('Score lead', { code: codeFile('./functions/score-lead.js') }) -``` - -In the file, `$ref.block.path` reads another block's output and `$env.NAME` reads an environment variable. `block` is the block's key: its name lowercased with all whitespace and every `.` removed (`$ref.triageagent.content` for "Triage Agent", `$ref.v2result.text` for "V2. Result"). Inside a loop body, `$ref.loop.currentItem` and `$ref.loop.index` read the iteration's item and position; inside a parallel body, `$ref.parallel.currentItem` and `$ref.parallel.index`. A `$ref` that names no block is refused in a file you edited, because it would not resolve when the workflow runs. Python and shell files are saved as written, so `$ref` and `$env` mean nothing there: read an output as `` (``) and an environment variable as `{{NAME}}`. - -## Use it in CI - -Run `sim workflows source apply --dir --dry-run` in CI to catch a broken workflow before it is saved. It exits `0` when the workflow is valid and `1` when it has errors, so a failing check blocks the merge. It exits `5` when the workflow was changed in the editor after you committed the directory; run `get` again and reapply your edit. - -- **Commit** `workflow.ts`, `functions/`, `.sim/lock.json`, `.sim/base.json`, `.sim/written.json`, `tsconfig.json` and `.gitattributes`. CI finds the workflow from `workflowId` in `.sim/base.json`, and `status` and `get` use `.sim/written.json` to tell your edits apart from what the CLI last wrote. -- **Optionally gitignore** `.sim/sdk/`, the generated type declarations of the blocks in use (a few dozen files); `get` and `check` write them again. Gitignore `tsconfig.full.json`, which names the CLI's cache on your machine; `check` writes it again. A single-workflow directory gets no `.gitignore`, so add the lines yourself. -- **A whole workspace** in one repository, with dry runs on pull requests, apply on merge and promotion from one workspace to another, is covered in [Git and CI](/workflows/workspace-code#git-and-ci) and [Promote to another workspace](/workflows/workspace-code#promote-to-another-workspace). -- **Git provenance:** in a git repository, `apply` and `create` send the commit checked out (`HEAD`) and the `origin` remote URL, with any credentials, query or fragment removed, as `provenance.gitSha` and `provenance.repo`, each only when `git` can read it (a repository with no `origin` sends only the commit). A saved write records what was sent in its [audit log](/platform/enterprise/audit-logs) entry (`workflow.updated` or `workflow.created`). A directory outside a repository sends neither. -- **Credentials:** use a personal API key (**Settings → Sim API keys**, passed as `SIM_API_KEY`) or an OAuth login, not a workspace API key. Saving and dry-running source act as a person, so a workspace key is refused with `403`. Set `SIM_WORKSPACE` unless you pass `--workspace`, and `SIM_ENDPOINT` if you use a self-hosted Sim. See [Authenticating CI](/cli/authentication#authenticating-ci). - -## Working with other people - -- If someone changes the workflow after you read it, the save (or `--dry-run`) is refused with exit code `5` and nothing is overwritten. Run `get` into a new directory, reapply your edit, and save. -- Locked blocks cannot be changed from the file. Unlock them in the workflow builder first. -- Removing a block that serves a live webhook, schedule, chat, or MCP tool warns you: the deployed version keeps serving it until the next deploy. - -## Limits and known gaps - -- The file holds block declarations and connections only. Helper functions, loops that create blocks, and imports are refused; use Loop, Condition, and Workflow blocks instead. -- Function code is one file per block, with no imports between files. -- A change anyone makes while you edit means reading the workflow again; there is no automatic merge. -- Workflows run in Sim, not locally. `--dry-run` checks everything a save checks, without running the workflow. -- A workflow can have up to 2,000 blocks and 2,000 variables, and its source up to 4 MB across `workflow.ts` and its function files together. A larger workflow is refused when you read or save it, and the CLI exits with code `7`. - -To keep the tables, knowledge bases, tools and skills a workflow uses in the same directory, see [Workspace as code](/workflows/workspace-code). - -See [CLI workflow commands](/cli/workflows) for every flag. diff --git a/apps/docs/content/docs/workflows/code/adopt.mdx b/apps/docs/content/docs/workflows/code/adopt.mdx new file mode 100644 index 00000000000..1ac43570882 --- /dev/null +++ b/apps/docs/content/docs/workflows/code/adopt.mdx @@ -0,0 +1,84 @@ +--- +title: Bring existing workflows into code +description: Put workflows built in the workflow builder into git, keep editing them in the builder, and decide who owns each change. +--- + +Result: workflows you built in the workflow builder kept in a git repository, with edits from the builder and from the files brought together instead of overwritten. + +Nothing has to be converted. Every workflow already has a source form: `get` prints it, and the workflow keeps its ID, block IDs, webhook URLs, schedules and run history. + +## Choose what to put in git + +- **One workflow**: `sim workflows source get --dir ` writes one workflow directory. Use it when a few workflows change through code and the rest stay in the builder. +- **A whole workspace**: `sim workspaces source get --dir ` writes the workflows together with the tables, knowledge bases, files, custom tools, skills, MCP servers, secret names and credential keys they use. Use it when the repository should describe the workspace, so one apply can create what a workflow needs before the workflow. + +A workspace directory manages only the kinds whose folder or file it holds: to leave one kind in the builder only, read the rest with `--only`, such as `--only tables,workflows`. + +## 1. Read the workflows + +```bash +sim workspaces source get --dir ./workspace +``` + +`get` names everything it could not write, such as a resource over a [limit](/workflows/code/limits), and lists it in `.sim/skipped.json`. Each workflow lands in `workflows//workflow.ts`, keyed by its name. + +## 2. Confirm the files match Sim + +```bash +sim workspaces source check --dir ./workspace +sim workspaces source status --dir ./workspace +``` + +A fresh `get` applies back unchanged, so `check` reports no errors and `status` exits `0` until someone edits either side. A warning on a block you have not changed does not fail the check: it describes a value the workflow already stores, such as a required field left empty in the builder. Fix it in the file when you next change that block. + +## 3. Commit the directory + +Commit everything `get` wrote, `.sim/` included. The `.sim/` files are how a later apply recognizes each block and resource and knows which version you read. [Directory layout](/workflows/code/directory) lists what to commit for each kind of directory. + +## 4. Change it from the files + +Make the first change through the loop in [Edit a workflow](/workflows/code/edit) or [Manage a workspace as code](/workflows/code/workspace), then commit the files the apply rewrote. To review changes on pull requests and apply them on merge, see [Run in CI](/workflows/code/ci). + +## Keep editing in the workflow builder + +The builder stays fully editable. Its **Code** tab shows the same workflow as read-only source. The files and the builder never overwrite each other silently: + +- A builder edit since the `get` is **drift**: `status` exits `12`. When the directory holds no unapplied edits, its `Next:` line is a `get` into the same directory, which brings the files up to date. Commit them. +- When the files and the builder changed the same workflow, it is a **conflict**: an apply is refused with exit `5` and writes nothing; see [Exit 5](/workflows/code/troubleshooting#exit-5). There is no automatic merge. +- In a workspace directory, drift on a resource you did not edit is kept: the apply writes your changes and leaves the other resource as Sim holds it (`W_SERVER_CHANGED`). + +To find drift before an apply does, run `status` on a schedule; see [Detect drift on a schedule](/workflows/code/ci#detect-drift-on-a-schedule). + +## What stays in the builder + +Block positions, values in fields the current settings hide, and your comments stay in the stored workflow, and an apply keeps them; [How it works](/workflows/code/how-it-works#the-canonical-form) has the rules. An apply saves the draft only: deploy with `apply --deploy` or `sim workflows deploy`, or, in a workspace directory, with a file in `deployments/`. + +## Agree on who changes what + +Decide per workflow where its changes are made, and write it down for the team: + +- **Files first**: changes go through pull requests, and the builder is for viewing and quick fixes that someone brings back with a `get`. Run the scheduled drift check. +- **Builder first**: the repository is a record. Refresh it with a `get` on a schedule or after a change, and open a pull request with what changed. + +Locked blocks cannot be changed from the files, by anyone. Lock a block in the builder to keep it out of reach of an apply. + +## Roll back + +- **The deployed version**: `sim workflows rollback ` (workspace Admin) makes the previous deployment live again and leaves the draft and the directory as they are. +- **The draft, from a deployment**: `sim workflows revert create --yes` replaces the draft with that deployed version. The directory then has drift (`status` exits `12`); `get` brings it up to date. +- **The draft, from git**: restore the source files of an earlier commit but keep the current `.sim/`, then apply: + + ```bash + git restore --source= -- ./support-triage ':(exclude,glob)support-triage/**/.sim/**' + sim workflows source apply --dir ./support-triage --dry-run + ``` + + Applying an earlier commit as a whole, `.sim/` included, is refused as stale (exit `5`), because its `.sim/base.json` records an older version than Sim holds. A block or resource deleted since that commit comes back as a new one, without its run history, webhook URLs or schedules, and blocks added since are deletes the apply refuses without `--allow-delete`. + +## Related docs + +- [Edit a workflow](/workflows/code/edit) +- [Manage a workspace as code](/workflows/code/workspace) +- [Run in CI](/workflows/code/ci) +- [How it works](/workflows/code/how-it-works) +- [Troubleshooting](/workflows/code/troubleshooting) diff --git a/apps/docs/content/docs/workflows/code/ci.mdx b/apps/docs/content/docs/workflows/code/ci.mdx new file mode 100644 index 00000000000..4b96da36834 --- /dev/null +++ b/apps/docs/content/docs/workflows/code/ci.mdx @@ -0,0 +1,183 @@ +--- +title: Run in CI +description: Dry-run source on pull requests, apply on merge, comment the plan, detect drift on a schedule, and promote, with GitHub Actions recipes. +--- + +Result: a pull request that shows what an apply would change, an apply on merge, and a scheduled check that tells you when someone edited the workspace in Sim. + +## Credentials + +Saving and dry-running source act as a person. Use a personal API key (**Settings → Sim API keys**, passed as `SIM_API_KEY`) or an OAuth login. A workspace API key is refused with `403` for workflows, and for a workspace directory it can apply only the kinds it can write; see [Workspace API keys](/workflows/code/workspace#workspace-api-keys). Set `SIM_WORKSPACE` unless you pass `--workspace`, and `SIM_ENDPOINT` if you use a self-hosted Sim. See [Authenticating CI](/cli/authentication#authenticating-ci). + +## What to commit + +- **A workflow directory:** commit `workflow.ts`, `functions/`, `.sim/lock.json`, `.sim/base.json`, `.sim/written.json`, `.sim/stored-edges.json`, `tsconfig.json` and `.gitattributes`. CI finds the workflow from `workflowId` in `.sim/base.json`, and `status` and `get` use `.sim/written.json` to tell your edits apart from what the CLI last wrote. Gitignore `tsconfig.full.json`; `.sim/sdk/` is optional. +- **A workspace directory:** commit everything, including `.sim/`. Its generated `.gitignore` leaves out only temporary files. + +[Directory layout](/workflows/code/directory) lists every file. + +## One workflow + +Run `sim workflows source apply --dir --dry-run` on pull requests. It exits `0` when the workflow is valid, `1` when it has errors, and `5` when the workflow was changed in the workflow builder after you committed the directory, so a failing check blocks the merge. `check` is not needed: the dry run runs every check a save runs, and `check` fails on a fresh runner that has no cached block catalog. + +```yaml title=".github/workflows/sim-workflow.yml" +on: + pull_request: + paths: ['support-triage/**'] + +permissions: + contents: read + +jobs: + dry-run: + runs-on: ubuntu-latest + env: + SIM_API_KEY: ${{ secrets.SIM_API_KEY }} + SIM_WORKSPACE: ${{ vars.SIM_WORKSPACE }} + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version: 24 + - uses: oven-sh/setup-bun@v2 + - run: bun add -g sim + - run: sim workflows source apply --dir support-triage --dry-run +``` + +## A workspace + +Keep a [workspace directory](/workflows/code/workspace) in a repository, `.sim/` included, and let CI plan each pull request and apply each merge. The dry run exits `1` on errors, `5` when the workspace changed since the committed base, and `15` when the apply would hold back changes that use a secret with no value or a credential nothing binds to. `check` downloads the block catalog once on a fresh runner. On GitHub Actions (`GITHUB_ACTIONS=true`), every source command also annotates each error and warning at its file and line, so they show inline on the pull request, and an `apply` (a dry run too), `create` and `status` append the plan and errors to the job's step summary. `--summary-file ` (or `SIM_SUMMARY_FILE`) also writes the same Markdown to a file on any CI, replacing it each run. + +```yaml title=".github/workflows/sim-workspace.yml" +on: + pull_request: + paths: ['workspace/**'] + push: + branches: [main] + paths: ['workspace/**'] + +concurrency: sim-workspace + +permissions: + contents: write + +jobs: + workspace: + runs-on: ubuntu-latest + env: + SIM_API_KEY: ${{ secrets.SIM_API_KEY }} + SIM_WORKSPACE: ${{ vars.SIM_WORKSPACE }} + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version: 24 + - uses: oven-sh/setup-bun@v2 + - run: bun add -g sim + - run: sim workspaces source check --dir workspace + - run: sim workspaces source apply --dir workspace --dry-run + - if: github.event_name == 'push' + run: sim workspaces source apply --dir workspace --yes + - if: ${{ !cancelled() && github.event_name == 'push' }} + run: | + git add -A workspace + if ! git diff --cached --quiet; then + git -c user.name=sim-bot -c user.email=sim-bot@users.noreply.github.com \ + commit -m "chore(workspace): files the apply rewrote [skip ci]" + git push + fi +``` + +`check` runs first because it needs no server and is fast: it compiles every workflow and type-checks the directory after regenerating `.sim/sdk/workspace.d.ts`, so resources the pull request adds are typed. Each finding is also a GitHub annotation at its line. Apply rewrites files under the directory (each `.sim/base.json`, ids it allocated, values the server normalized), and the next apply compares with them, so the last step commits them back to the branch; `[skip ci]` keeps that commit from running the job again. That step runs even when the apply failed (`!cancelled()`), because an apply can fail having written part of its plan: exit `15` means it held back changes that use a secret with no value or a credential nothing binds to and applied the rest, and exit `8` means it stopped part-way. Either way the directory records what was written, so committing it keeps the next run from being refused as stale (exit `5`) for resources this run wrote; the job still fails, so set the secret, connect the credential or fix the failure, and push again. Where the branch is protected, run `sim workspaces source get --dir workspace` on a new branch instead and open a pull request. + +After merging two branches that each applied, a dry run with no changes means the files match the workspace. Exit `5` means a resource changed since this branch's base: get the workspace into a fresh directory and carry the edit over. Exit `10` means another apply is writing the workspace (or another command is using the directory), so retry; the `concurrency` key keeps two runs of this job from overlapping. Pull requests from forks do not receive repository secrets, so the dry run needs a branch in the same repository. + +### Comment the plan on the pull request + +The step summary appears on the run page, not in the pull request. To post the plan as one comment that later pushes edit instead of adding another, write the plan to a file with `--summary-file` in the step that runs the dry run and post that file, with `pull-requests: write` in `permissions`: + +```yaml + - if: github.event_name == 'pull_request' + env: + GH_TOKEN: ${{ github.token }} + run: | + status=0 + sim workspaces source apply --dir workspace --dry-run --summary-file plan.md || status=$? + gh pr comment "${{ github.event.pull_request.number }}" --edit-last --create-if-none --body-file plan.md + exit "$status" +``` + +Use this step in place of the plain dry-run step for pull requests. The comment lists the first 50 changes and errors and counts the rest. `--edit-last` edits the last comment from the same account, which is the Actions bot here, so do not post other comments from this token on the pull request. + +### Detect drift on a schedule + +A change made in Sim, such as a hotfix in the workflow builder, makes the next apply exit `5`. A scheduled job finds it first: `status` exits `12` when the server changed since the directory was read, and `11` when the committed directory holds edits no apply has saved, for example after a merge whose apply failed. + +```yaml title=".github/workflows/sim-drift.yml" +on: + schedule: + - cron: '17 6 * * 1-5' + workflow_dispatch: + +permissions: + contents: read + issues: write + +jobs: + drift: + runs-on: ubuntu-latest + env: + SIM_API_KEY: ${{ secrets.SIM_API_KEY }} + SIM_WORKSPACE: ${{ vars.SIM_WORKSPACE }} + GH_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version: 24 + - uses: oven-sh/setup-bun@v2 + - run: bun add -g sim + - run: | + status=0 + sim workspaces source status --dir workspace --output json > status.json || status=$? + if [ "$status" -eq 0 ] || [ "$status" -eq 11 ] || [ "$status" -eq 12 ]; then + [ "$(jq -r .server status.json)" = checked ] || { echo "Sim was not checked: $(jq -r .note status.json)"; exit 1; } + fi + case "$status" in + 0) exit 0 ;; + 11|12) ;; + *) exit "$status" ;; + esac + run_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" + body="sim workspaces source status exited $status ($run_url). Run it locally for the changes and the next command." + gh label create sim-drift --force + number=$(gh issue list --label sim-drift --state open --json number --jq '.[0].number // empty') + if [ -n "$number" ]; then + gh issue comment "$number" --body "$body" + else + gh issue create --label sim-drift --title "Sim workspace drift" --body "$body" + fi +``` + +`status` exits `0` or `11` without asking Sim when the server is unreachable, so the job reads the `server` field of its JSON output and fails unless it is `checked`. To bring the change into git instead, run `sim workspaces source get --dir workspace` on a new branch and open a pull request. + +### Promote in CI + +To promote the same directory to a second workspace, add a step with `--to` before the step that commits the files back: + +```bash +sim workspaces source apply --dir workspace --to "$PROD_WORKSPACE_ID" --yes +``` + +The promotion writes `workspace/.sim/targets/.json`, what it left in that workspace. Committing it lets the next run tell a change made in that workspace since (kept, or exit `5` when the directory changed the same resource) from one to promote. See [Promote to another workspace](/workflows/code/promote). + +## Git provenance + +In a git repository, `apply` and `create` send the commit checked out (`HEAD`) and the `origin` remote URL, with any credentials, query or fragment removed, as `provenance.gitSha` and `provenance.repo`, each only when `git` can read it (a repository with no `origin` sends only the commit). A saved write records what was sent in its [audit log](/platform/enterprise/audit-logs) entry (`workflow.updated` or `workflow.created` for a workflow, `workspace.updated` for a workspace apply). A directory outside a repository sends neither. + +## Related docs + +- [Exit codes](/workflows/code/exit-codes) +- [Promote to another workspace](/workflows/code/promote) +- [Scripting](/cli/scripting) +- [Authenticating CI](/cli/authentication#authenticating-ci) diff --git a/apps/docs/content/docs/workflows/code/coding-agents.mdx b/apps/docs/content/docs/workflows/code/coding-agents.mdx new file mode 100644 index 00000000000..42ec35a8469 --- /dev/null +++ b/apps/docs/content/docs/workflows/code/coding-agents.mdx @@ -0,0 +1,49 @@ +--- +title: Use with coding agents +description: What get gives a coding agent, how it edits and saves a workflow, and the MCP and API paths for the same operations. +--- + +Claude Code, Cursor, Codex and other coding agents work from a directory that `get` writes. + +## What get gives an agent + +- A **primer**, which opens `.sim/AGENTS.md`. `get` prints a short summary instead (the files written, the guide, and the `editLoop` command to run). It covers the edit loop, how block identity, references and renames work, failures and retries, test runs, deletes, deploy, exit codes, and the params of each builder the workflow already uses. +- **`.sim/AGENTS.md`**: the primer followed by a reference, by task. A workspace directory also gets `.sim/GUIDE-advanced.md`. +- **`.sim/examples/`**: one correct example of each common block to copy from. +- **`.sim/sdk/`**: the type declarations, with `.sim/sdk/INDEX.md` listing the builders. + +Point the agent at `.sim/AGENTS.md` before it edits. + +## The loop + +1. `sim workflows source get --dir ` writes the workflow and the guide. +2. Write every file the change needs. +3. Run one chained command, then fix whatever it reports in the next step: + + ```bash + sim workflows source check --dir && sim workflows source apply --dir --yes && sim workflows run --manual --input '{...}' + ``` + + A non-zero exit code stops the chain at the first failure. `apply` compiles the source and compares it with the saved draft again, so an agent can skip `--dry-run`. `check` also type-checks the directory, so the chain needs no separate `tsc`. People and CI use `apply --dry-run` to review the plan, and `status` shows what changed and what to run next. + +For a whole workspace, use `sim workspaces source` with the same steps; see [Manage a workspace as code](/workflows/code/workspace). + +## Look things up + +- `sim workflows source params ` prints a builder in brief (an example call, the required params with types, the optional ones by name and the outputs) from the cached block catalog without a request. `--full` prints every param with its type, options, default and doc. A legacy builder names the one that replaces it, and a namespace such as `gmail` lists its builders. +- `sim workflows source resources` lists the tables, knowledge bases, credentials, workflows, skills, custom tools, MCP servers and environment variable names the file can name. +- `sim workflows source catalog` shows the block catalog the source is checked against. + +## Exit codes and retries + +An agent can branch on the exit code: `5` means the workflow changed and it must `get` into a fresh directory, `14` means it forgot `--yes`, and `9` means wait a minute. See [Exit codes](/workflows/code/exit-codes). + +## Over MCP and the API + +`getWorkflowSource` returns a workflow as TypeScript source files with its `lock` and `base`. Edit the files and send them back, with the same `lock` and `base`, through `applyWorkflowSource`, first with `query: {"dryRun": true}`. One call replaces a batch of graph operations. See [MCP tools](/mcp/tools#workflow-source) and [Build and run workflows](/api-reference/build-and-run-workflows). + +## Related docs + +- [Edit a workflow](/workflows/code/edit) +- [File syntax](/workflows/code/syntax) +- [Directory layout](/workflows/code/directory) diff --git a/apps/docs/content/docs/workflows/code/create.mdx b/apps/docs/content/docs/workflows/code/create.mdx new file mode 100644 index 00000000000..eb571abb483 --- /dev/null +++ b/apps/docs/content/docs/workflows/code/create.mdx @@ -0,0 +1,45 @@ +--- +title: Create a workflow +description: Start a new workflow from a starter file, check it, and create it from a directory. +--- + +Result: a new workflow created from a file, in the workspace you choose. + +## Steps + +1. Write a starter into an empty directory: + + ```bash + sim workflows source create --dir ./lead-intake --workspace + ``` + + Without `--dry-run` or `--yes` this creates nothing. It writes a starter `workflow.ts` with that workspace's type declarations, `tsconfig.json` and `.sim/AGENTS.md`, and records the workspace in `.sim/starter.json`. The file starts with the `// @sim-sdk 1` line and default-exports one `workflow('Name', {}, () => { ... })`. + +2. Edit the starter and check it as in [Edit a workflow](/workflows/code/edit). + +3. Create the workflow: + + ```bash + sim workflows source create --dir ./lead-intake --workspace --dry-run + sim workflows source create --dir ./lead-intake --workspace --yes + ``` + + 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 that `get` writes, so you can continue editing with `apply`. + +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`. + +```bash +sim workflows source create --dir ./copy --workspace --name "New name" --yes +``` + +## Related docs + +- [Get started](/workflows/code/get-started) +- [Edit a workflow](/workflows/code/edit) +- [Exit codes](/workflows/code/exit-codes) diff --git a/apps/docs/content/docs/workflows/code/diagnostics.mdx b/apps/docs/content/docs/workflows/code/diagnostics.mdx new file mode 100644 index 00000000000..cbd3060b1e0 --- /dev/null +++ b/apps/docs/content/docs/workflows/code/diagnostics.mdx @@ -0,0 +1,379 @@ +--- +title: Diagnostic codes +description: Every error, warning and info code that workflow and workspace source report, grouped by where it comes from. +--- + +Every finding that `check`, `status` and `apply` print has a code. The first letter is its severity: `E_` is an error, `W_` a warning and `I_` information. An error refuses the apply and makes `check` exit `1`. A warning is reported and the apply saves the source as written, except where a row below says the apply refuses it as the matching `E_APPLY_…` error. Information never blocks anything. + +A finding prints as `file:line:column` with the code around it and a hint; in `--output json` it is an entry of `diagnostics` (see [Scripting](/cli/scripting#exit-codes) for the shape). The codes are frozen at release, so a script can match on them. + +{/* workflow-code-docs:diagnostics:begin — generated by `bun run generate:workflow-code-docs`; do not edit between markers */} + +### Workflow source + +#### Compile and print + +Reading and writing `workflow.ts`. + +| Code | Meaning | +| --- | --- | +| `E_SYNTAX` | Babel could not parse the file. | +| `E_INVALID_CHARACTER` | A NUL or an unpaired UTF-16 surrogate, raw or escaped in a string, in the file or a code file: a workflow cannot store either. | +| `E_NUMBER_NOT_FINITE` | A number literal too large to store (`1e999` reads as `Infinity`). | +| `W_NUMBER_PRECISION` | A number literal whose digits a number cannot hold; write it as a string. | +| `E_SDK_HEADER` | Line 1 is not `// @sim-sdk N`. | +| `E_SDK_MAJOR` | The header's major is not the one the server reads. | +| `E_UNSUPPORTED_SYNTAX` | A construct outside this grammar; the hint names the supported form. | +| `E_WORKFLOW_EXPORT` | Not exactly one `export default workflow(…)`. | +| `E_LIMIT_EXCEEDED` | Over the block, edge, total-byte, depth or `codeFile()` reference cap (`SOURCE_LIMITS`). Apply answers 413. | +| `E_TOO_MANY_ERRORS` | The compile stopped after 100 errors; fix those and compile again to see the rest. | +| `I_FINDINGS_TRUNCATED` | 100 warnings, or 20 of one code, were listed and the rest omitted, so a flood of one finding never hides another. A finding repeated at the same place is listed once. Infos are capped apart (100, the rest dropped), so they never displace a warning, and errors are never displaced by either. An answer that merges findings from several stages is capped the same way as a whole; when that cuts it, it ends in one `I_FINDINGS_TRUNCATED` counting what it left out, in place of the stages' own. | +| `E_DUPLICATE_NAME` | Two blocks normalize to one key. | +| `E_RESERVED_NAME` | A block name normalizes to `loop`, `parallel` or `variable`. | +| `E_KEY_OVERRIDE` | A `meta.key` that is not a legacy key the stored workflow already has. | +| `E_EMPTY_NAME` | An empty block name. | +| `E_NAME_NOT_LITERAL` | A block or workflow name that is not a string literal. | +| `E_LOOKALIKE_NAME` | Two block names whose keys differ only by Unicode normalization (NFC vs NFD), or a block name with a word that mixes Latin letters with Cyrillic, Greek, Armenian or Cherokee ones (`Сlaude`); the message names the code point. | +| `W_LOOKALIKE_NAME` | A look-alike pair the stored workflow already holds, kept so it round-trips. | +| `W_SUSPICIOUS_CHARACTER` | A block or workflow name holds a bidi control or zero-width character. | +| `E_UNKNOWN_IDENTIFIER` | An identifier that names nothing in scope; the hint has a did-you-mean, says to write the value for a const refused for holding one, and points `process.env` at `env.NAME`. | +| `E_OUT_OF_SCOPE` | A ref or wiring into a sibling subflow's child. | +| `E_UNKNOWN_VARIABLE` | `vars.x` names no declared variable. | +| `E_DUPLICATE_VARIABLE` | Two variables with one key. | +| `E_VARIABLE_NAME_MISMATCH` | A variable's `name` does not normalize to its key. | +| `E_INVALID_ENV_NAME` | `env.X` with an invalid name. | +| `W_ENV_UNKNOWN` | `env.X`, or a code file `$env`, naming a variable the workspace does not hold (checked only when the env names are known); the hint has a did-you-mean. An offline check in a workspace directory knows only the names `secrets.ts` declares, so there the finding says `secrets.ts` does not declare it, and the hint points there. | +| `W_CHILD_INPUT_UNKNOWN` | A child workflow call's `inputMapping` sets an input the child's Start trigger does not declare (`sim workspaces source check`, with the child in the same directory); the hint names the nearest input. | +| `W_CHILD_NO_START` | A child workflow call names a workflow of the same directory that has no Start trigger (`sim workspaces source check`). | +| `W_CHILD_RESULT_PATH` | A reference to a child workflow call's `result.` whose child (in the same directory) ends at a Response block on every run, where `` is not `data`, `status` or `headers`: the child's result is its Response output, so the path reads nothing (`sim workspaces source check`); the hint names `result.data.`. The dry run reports the same reference as a `W_APPLY_LINT` warning. | +| `E_UNKNOWN_SUBFLOW_PROPERTY` | `p.` that a loop or parallel does not have. | +| `W_FORWARD_REF` | A ref to a block declared later; it resolves. | +| `W_REF_NOT_NORMALIZED` | Hand-written `` text that is not in key form. | +| `E_REF_UNREPRESENTABLE` | A reference to a block whose key holds a character a reference cannot carry (`Q&A`, `x>y`); rename the block. | +| `E_EDGE_SCOPE` | An edge across subflow scopes. | +| `E_EDGE_NOTE` | An edge to or from a note. | +| `E_TARGET_TRIGGER` | An edge into a trigger. | +| `E_NO_DEFAULT_OUTPUT` | `.to()` on a condition or router; wire a branch. | +| `E_DUPLICATE_EDGE` | The same edge twice. | +| `E_ERROR_PORT_UNSUPPORTED` | `onError` on a block with no error port. | +| `W_ERROR_PORT_STORED` | `onError` on a block with no error port (a loop or parallel) that the stored workflow already wires; kept so it round-trips. An offline check, which cannot read the stored workflow, reports it for any such edge between two blocks the lock binds: an apply keeps it only if the stored workflow holds it. | +| `E_UNKNOWN_BRANCH` | `x.key.to()` where `key` is not a branch of `x`. | +| `E_DUPLICATE_BRANCH_KEY` | Two rows with one key. | +| `E_BRANCH_KEY_COLLIDES` | A branch key equal to an output name, `to` or `onError`. | +| `E_BRANCH_ELSE_LAST` | Two or more condition rows that do not end with `else`. | +| `W_RAW_HANDLE` | `edge()` with a handle kept verbatim. | +| `W_SUBFLOW_HANDLE_SCOPE` | `edge()` from a loop or parallel's start handle to a block outside it (the executor runs it as the container's exit), or from another of its handles into its own child. The canvas never draws one; stored ones print this way so they round-trip. | +| `E_EDGE_CYCLE` | Wiring that closes a cycle among enabled blocks, a self-loop included: no block on it ever runs. Framed at the edge back to a block declared earlier, the one to remove; repeat work with `loop()`/`parallel()`. | +| `W_EDGE_CYCLE` | A cycle the stored workflow already holds, kept so it round-trips; none of it runs. An offline check reports it for a cycle among blocks the lock binds, which an apply keeps only if the stored workflow holds every edge of it. | +| `W_BRANCH_UNWIRED` | A condition or router branch no edge leaves, so a run that takes it ends there; the hint names the wiring. Not reported for a branch the stored workflow already leaves unwired. | +| `E_UNKNOWN_BUILDER` | A builder path the catalog does not have, a bare builder-shaped call (`apii('Name', …)`) nothing binds, or a namespace the SDK lacks or the file did not import; `hint` names the builder a common other name stands for (`http.request` → `api`), then prefers a synonymous verb (`postMessage` → `sendMessage`), then the closest path, then the namespace's builders. | +| `E_UNKNOWN_PARAM` | A param the block does not have; the hint has a did-you-mean, or for block meta written there (`retry`, `disabled`, `locked`, `errorPort`) the third argument that takes it. | +| `E_FIXED_PARAM` | A param the builder already pins. | +| `W_FIELD_NOT_APPLICABLE` | A param not visible under the block's values; apply keeps the stored value and the written-back source drops it. | +| `W_REQUIRED_MISSING` | A required field left empty, including `todo()`; not repeated for a field an `E_UNKNOWN_PARAM` did-you-mean names, or one written with a value that failed to compile. | +| `W_UNKNOWN_OPTION` | A dropdown value none of its options names; `hint` lists them. | +| `E_UNKNOWN_OPERATION` | An `operation` the block does not offer; `hint` lists them. A retired one the stored block holds is `W_UNKNOWN_OPTION`. | +| `W_UNKNOWN_MODEL` | A `model` the catalog does not list (kept: custom models are free text). | +| `W_LEGACY_BLOCK_TYPE` | A new block of a legacy or deprecated type; `hint` names the replacement's builders. | +| `I_SCHEDULE_UTC` | A schedule created from source with no `timezone`, which runs in UTC (the editor would have seeded the viewer's zone). | +| `E_STORED_VALUE_MISSING` | `stored()` where the stored workflow holds no value. | +| `W_VALUE_KIND` | A value whose JSON type differs from the field's. | +| `W_OUT_OF_RANGE` | A literal slider value outside the catalog `min`/`max`, off its `step`, or fractional where it takes whole numbers; kept as written, and the executor forwards it unclamped. | +| `W_TABLE_FILTER_SHAPE` | A literal table filter the runtime refuses: the legacy `$` operator grammar, or predicate and builder rows mixed. | +| `W_LITERAL_SECRET` | A password field (an API key, a token) holding literal text instead of an env reference, or any field holding a detected credential (a token format, an `Authorization` header, a credential-named property or query parameter); get prints it as `stored()`. For a literal token in a credential field, the hint says `credential('')`. | +| `W_SUBFLOW_COUNT` | A loop or parallel count, or a parallel batch size, the runtime replaces or clamps. | +| `W_UNKNOWN_OUTPUT_PATH` | A ref path the block's outputs do not have; the hint has a did-you-mean or lists the outputs. | +| `W_OUTPUT_PATH_UNDECLARED` | A path the block does not declare that the run still accepts: an undeclared `inputFormat` input, or `x.error` with no error edge. Never refused. | +| `W_JSON_REF_UNTYPED` | A bare ref in a JSON literal whose type nothing declares. | +| `W_LOOP_CONDITION_SYNTAX` | A while or do-while condition that is not a JavaScript expression once each reference stands in as a value, as the run evaluates it (`return Boolean()`): the run fails there. Refused as `E_APPLY_LOOP_CONDITION_SYNTAX` on a loop the edit added or changed. A loop reading its own `index` (or `currentItem`, `items`) by its name in its condition is `W_REF_OUT_OF_SCOPE`: the condition is evaluated outside the loop's body, so only `` reads the iteration there. | +| `W_REF_OUT_OF_SCOPE` | A loop or parallel iteration field (`index`, `currentItem`, `items`) read from a block outside that container: `lp.index` after the loop, `$ref.loop.index` or `` in a block in no loop. The run fails (or reads nothing) there. Refused as `E_APPLY_REF_OUT_OF_SCOPE` on a block the edit changed. | +| `W_UNKNOWN_BLOCK_TYPE` | A new block of a type the catalog does not hold; refused as `E_APPLY_INVALID_BLOCK_TYPE`. A block the stored workflow or the lock already holds keeps its type quietly. | +| `W_TYPE_NOT_ADDABLE` | A new block of a type the catalog keeps only for blocks already using it; refused as `E_APPLY_TYPE_NOT_ADDABLE`. | +| `E_CODE_FILE_MISSING` | `codeFile()` names a file the request did not send. | +| `E_CODE_FILE_PATH` | A code file path outside the directory, or with the wrong extension. | +| `W_CODE_FILE_INLINED` | Print: the code could not round-trip through a file and was inlined. | +| `W_CODE_FILE_REF_SYNTAX` | `$ref.key.path` or `$env.NAME` in a Python or shell code file, which runs as text; the hint names the `` or `{{NAME}}` form. Refused as `E_APPLY_CODE_FILE_REF_SYNTAX` in a file the edit changed. | +| `W_UNRESOLVED_REF` | Print: a stored `` token that resolves to nothing. Compile: a code file `$ref` chain that does. Either is kept as text. | +| `W_FORWARD_REF_LITERALIZED` | Print: a ref in a cycle printed as text. | +| `W_COMMENT_MOVED` | A comment hoisted to the nearest anchor. | +| `W_COMMENT_DROPPED` | A comment whose block no longer exists. | + +#### Lock and source meta + +Reading `.sim/lock.json`. Each finding names a JSON `path`. + +| Code | Meaning | +| --- | --- | +| `E_LOCK_JSON`, `E_SOURCE_META_JSON` | Not valid JSON. | +| `E_LOCK_VERSION`, `E_SOURCE_META_VERSION` | `version` missing or not `1`. | +| `E_LOCK_SHAPE`, `E_SOURCE_META_SHAPE` | A required field missing or of the wrong type or format. | +| `E_LOCK_UNKNOWN_FIELD`, `E_SOURCE_META_UNKNOWN_FIELD` | A field the schema does not define (`x-` keys are allowed). | +| `E_LOCK_KEY` | A block or variable key not in normalized form. | +| `E_LOCK_IDENT`, `E_SOURCE_META_IDENT` | An ident that is not a JS identifier, or is reserved. | +| `E_LOCK_DUPLICATE_IDENT`, `E_SOURCE_META_DUPLICATE_IDENT` | Two blocks with one ident. | +| `E_LOCK_DUPLICATE_ID` | One block, variable or branch id under two keys. | +| `E_LOCK_PARENT` | A parent naming no block, itself, or forming a cycle. | +| `E_LOCK_BRANCH` | A branch key that is not a JS identifier. | +| `E_LOCK_CODE_FILE_PATH` | A `codeFile` that is absolute, escapes the directory, or uses backslashes. | +| `E_SOURCE_META_ANCHOR` | A comment key that is not a valid anchor. | + +#### Canonicalize + +Reading the stored workflow in a get. + +| Code | Meaning | +| --- | --- | +| `E_CANON_LEGACY_NAME_COLLISION` | Two stored names normalize alike; the loser is keyed `key~n`. | +| `E_CANON_EDGE_SCOPE` | A stored edge crosses subflow scopes. | +| `W_CANON_RESERVED_NAME` | A stored name normalizes to a reserved key. | +| `W_CANON_DANGLING_EDGE` | A stored edge to a missing block; dropped. | +| `W_CANON_DANGLING_PARENT` | A parent that does not exist; the block is placed at the root and the raw parent kept. | +| `W_CANON_RAW_HANDLE` | An unknown edge handle, kept as a raw port. | +| `W_CANON_UNKNOWN_BLOCK_TYPE` | A type the catalog does not have; params kept. | +| `W_CANON_UNRESOLVED_ID` | A resource id with no key; kept verbatim. | +| `W_CANON_TITLE_OVERRIDE` | A branch title that differs from its positional title. | +| `W_CANON_SUBFLOW_REPAIRED` | A loop or parallel config the loader would repair. | +| `W_CANON_SUBBLOCK_TYPE_DRIFT` | A stored subBlock type differs from the catalog's. | +| `W_CANON_UNDECODABLE_JSON` | A stored JSON-text field that does not parse, kept as text; or a branch list that is not rows with distinct ids, kept verbatim. | + +#### Materialize + +Matching the compiled file to the stored blocks. + +| Code | Meaning | +| --- | --- | +| `E_MAT_DUPLICATE_LOCK_ID` | Two lock keys carry one block id. | +| `E_MAT_UNKNOWN_RESOURCE` | A resource key with no live resource in this workspace. | +| `E_MAT_UNKNOWN_VARIABLE` | A `vars.x` reference to a variable the workflow does not declare. | +| `W_MAT_DELETED_SINCE_PULL` | A lock entry whose block was deleted since the read; re-created. | +| `W_MAT_INFERRED_RENAME` | A rename inferred from type, parent and edges (the key and the ident both changed). | +| `W_MAT_RETYPE_RECREATED` | A key kept with a new type: delete plus create, so webhook URLs and schedules change. | +| `W_MAT_LOCK_ID_CLAIMED` | A lock id another workflow holds, ignored: the block binds to the stored block it matches, or gets a new id. | +| `I_MAT_NEEDS_LAYOUT` | A new block with no position, or one moved into or out of a loop or parallel; placed by autolayout. | + +#### Apply + +Saving the workflow draft. + +| Code | Meaning | +| --- | --- | +| `E_APPLY_STALE` | The workflow changed since the source was read (HTTP 409). | +| `E_APPLY_WORKFLOW_MISMATCH` | `base.workflowId` names another workflow (HTTP 400). | +| `E_APPLY_LOCKED_BLOCK` | The change touches a locked block or a child of a locked container. | +| `E_APPLY_TYPE_NOT_ADDABLE` | A new block of a type that may stay but not be added. | +| `E_APPLY_INVALID_STATE` | The resulting graph fails validation. | +| `E_APPLY_BLOCK_NOT_FOUND`, `E_APPLY_INVALID_BLOCK_TYPE` | A block or type the engine cannot place. | +| `E_APPLY_BLOCK_NOT_ALLOWED`, `E_APPLY_MODEL_NOT_ALLOWED`, `E_APPLY_TOOL_NOT_ALLOWED` | Refused by the workspace's permission group. | +| `E_APPLY_INVALID_EDGE_SOURCE`, `E_APPLY_INVALID_EDGE_SCOPE`, `E_APPLY_INVALID_SOURCE_HANDLE`, `E_APPLY_INVALID_TARGET_HANDLE` | An edge the engine refuses. | +| `E_APPLY_INVALID_SUBBLOCK_FIELD`, `E_APPLY_MISSING_REQUIRED_PARAMS` | A field the engine refuses, or required params missing. | +| `E_APPLY_RETRY_NOT_SUPPORTED` | A new or changed retry policy on a block that always runs once (triggers, human-in-the-loop, containers). | +| `E_APPLY_DUPLICATE_TRIGGER`, `E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK` | A second trigger or single-instance block. | +| `E_APPLY_DISABLED_ANCESTOR` | An enabled block inside a disabled container. | +| `E_APPLY_CREDENTIAL_UNREACHABLE` | A credential the acting user cannot use. | +| `W_APPLY_CREDENTIAL_KEPT` | A credential key the caller cannot resolve stands where the workflow stores a credential the caller cannot see; the stored one is kept, whatever the key. | +| `E_APPLY_SANDBOX_PLAN_REQUIRED` | The sandbox needs a plan the workspace does not have. | +| `W_APPLY_HOSTED_KEY_DROPPED` | A hosted key that does not apply was cleared. | +| `W_APPLY_VALUE_NORMALIZED` | Validation rewrote a value; the returned files show it. | +| `W_APPLY_TYPE_CHANGED` | A block's type changed; its id, webhook URL and schedules are replaced. | +| `W_APPLY_TRIGGER_REMOVED` | A deleted or retyped block still serves a live webhook, schedule, chat output or MCP tool until the next deploy. | +| `W_APPLY_CATALOG_MOVED` | Compile failed and the block catalog changed since the read: get the source again. | +| `E_APPLY_LINT`, `W_APPLY_LINT` | A workflow lint finding, mapped to a source line. | +| `E_APPLY_UNRESOLVED_REF` | A `$ref` naming no block or variable, or a path no output has, in code or a block the edit changed (`W_UNRESOLVED_REF`, `W_UNKNOWN_OUTPUT_PATH` elsewhere). | +| `E_APPLY_REF_OUT_OF_SCOPE` | A `W_REF_OUT_OF_SCOPE` iteration reference on a block the edit added, changed or moved. | +| `E_APPLY_CODE_FILE_REF_SYNTAX` | A `W_CODE_FILE_REF_SYNTAX` in a code file the edit changed. | +| `E_APPLY_LOOP_CONDITION_SYNTAX` | A `W_LOOP_CONDITION_SYNTAX` on a loop the edit added or changed. | +| `E_APPLY_BLOCK_DELETE` | The apply deletes blocks the source no longer declares; pass `--allow-delete`. When it also adds blocks of a deleted one's type, it names them as possible renames and says how to keep the ids. | +| `E_APPLY_VARIABLE_DELETE` | The apply removes workflow variables the source no longer declares; pass `--allow-delete`, as for blocks. | +| `W_APPLY_PROBABLE_RENAME` | With `--allow-delete`, a deleted block and an added one share a type and parent: a probable rename that gets a new id. | +| `E_NAME_TAKEN` | The `workflow('…')` name renames the workflow to one another workflow in its folder holds. | +| `E_WORKFLOW_META_INVALID` | The `workflow('…')` name is empty or over 255 characters, or its description is over 50,000 characters: limits the workflow API holds every workflow to. | +| `E_APPLY_INVALID_SCHEDULE` | An added or changed schedule whose cron, timezone or interval deploy would refuse. | +| `W_TABLE_UNKNOWN_COLUMN` | A table row write whose data names a key that is not a column of the table; the run drops it. The hint names the nearest column. | + +#### Type check + +`sim workflows source check` and `sim workspaces source check` type-checking the directory with TypeScript after the compile. The server never reports these. + +| Code | Meaning | +| --- | --- | +| `E_TYPE` | TypeScript (the release the declarations are built for) reported an error; the message starts with its `TS` code. A type error is left out on a line the compile already reports an error on, and in a file still as the last get or apply wrote it when that file had the same error then (against the declarations as that get or apply left them). | +| `W_TYPES_UNCHECKED` | The type check did not run: TypeScript could not be installed (offline, or no `npm`) or did not start. The other findings stand; pass `--no-types` to skip it. | + +### Workspace source + +Workspace source reports every workflow code above for the files of `workflows//`, with that path as the file, and these codes for the rest of the directory. + +#### Declaration files and the directory layout + +| Code | Meaning | +| --- | --- | +| `E_DECL_SYNTAX` | A Babel parse error, re-coded. | +| `E_DECL_HEADER` | The first line is not `// @sim-sdk 1`. | +| `E_DECL_IMPORT` | An import from anything but `@sim/workflow-sdk/workspace`, or a non-named import. | +| `E_DECL_EXPORT` | Not exactly one `export default defineX({ … })` with the kind's `defineX`. | +| `E_DECL_UNSUPPORTED` | A construct outside the declaration grammar: JSON literals, the kind's helper calls. | +| `E_DECL_DUPLICATE_KEY` | An object key declared twice. | +| `E_DECL_SHAPE` | A required field is missing, or a field has the wrong type. | +| `E_DECL_UNKNOWN_FIELD` | A field the kind does not define. | +| `E_DECL_UNKNOWN_FILE` | A path inside a kind's folder that no resource owns. | +| `W_PATH_NOT_SENT` | A file under a kind's folder whose path no workspace holds (a hidden name such as `.env`, or a character such as `:` or `?`): the CLI does not send it, so an apply neither writes nor deletes anything for it. | +| `E_BLOB_MANIFEST` | A blob manifest entry listed twice, or at a path that holds no binary file: the apply writes nothing. | +| `E_BLOB_MISSING` | A binary file a write needs whose bytes are not staged (or were staged at another size): the apply writes nothing. Stage it, then apply again. | +| `E_KEY_INVALID` | A resource key outside `^[a-z][a-z0-9_-]{0,63}$`. | +| `W_DECL_SUSPICIOUS_CHARACTER` | A resource name, a skill name, a workspace file path or a knowledge document name holds a bidi control or zero-width character, so it reads differently from what it stores. The workflow-file counterpart is `W_SUSPICIOUS_CHARACTER`. | + +#### `.sim/base.json` + +| Code | Meaning | +| --- | --- | +| `E_BASE_JSON` | The base is not valid JSON. | +| `E_BASE_VERSION` | `version` is missing or not `1`. | +| `E_BASE_SHAPE` | A required field is missing or of the wrong type or format. | +| `E_BASE_UNKNOWN_FIELD` | A field the base does not define (`x-` keys are allowed). | + +#### Secrets (`secrets.ts`) + +| Code | Meaning | +| --- | --- | +| `E_SECRET_NAME` | A declared name outside the secret name format. | +| `E_SECRET_MISSING` | A workflow uses a declared secret the workspace holds no value for: it is held back. | +| `W_SECRET_MISSING` | A declared secret the workspace holds no value for. | + +#### Credentials (`credentials.ts`) + +| Code | Meaning | +| --- | --- | +| `E_CREDENTIAL_MISSING` | A workflow uses a declared key no credential of its provider binds to: it is held back. | +| `E_CREDENTIAL_AMBIGUOUS` | A workflow uses a declared key several credentials could bind to: it is held back. | +| `W_CREDENTIAL_MISSING` | A declared key no credential of its provider binds to. | +| `W_CREDENTIAL_AMBIGUOUS` | A declared key several credentials could bind to. | + +#### Tables + +| Code | Meaning | +| --- | --- | +| `E_TABLE_COLUMN_NAME` | A column key or name outside the table name pattern. | +| `E_TABLE_DUPLICATE_COLUMN` | Two columns resolve to one name. | +| `E_TABLE_TOO_MANY_COLUMNS` | More columns than a table may hold: a size limit, classed like `E_LIMIT_EXCEEDED`. | +| `E_TABLE_OPTIONS` | A select column without options, an option declared twice, or options on another type. | +| `E_TABLE_TYPE_CONVERSION` | A type change the stored cells cannot convert to. | +| `E_TABLE_FOLDER` | A table folder that does not exist in the workspace. | +| `E_TABLE_ROWS` | The declaration's `rows` or its `tables/.rows.jsonl`: a bad mode or key column, a line that is not a row of declared columns, a managed row without its key or repeating one. | +| `I_TABLE_SEED_SKIPPED` | Seed rows declared for a table that already holds rows: only a new or empty table is seeded. | +| `I_TABLE_ROWS_UNKEYED` | Managed rows whose key cell is empty (a row the table's "add row" made and nobody keyed): no file line can name them, so a get leaves them out and an apply keeps them as they are. | +| `W_LIKELY_RENAME` | A column dropped and one of the same type added: probably a rename, which loses the cells. | + +#### Custom tools + +| Code | Meaning | +| --- | --- | +| `E_TOOL_SCHEMA` | The schema is not a function declaration a custom tool may store. | +| `E_TOOL_CODE` | `code` is not `codeFile('./.js')`, a string or `stored()`, or its code file is missing or does not parse. | +| `E_TOOL_STORED_MISSING` | `code: stored()` for a tool the server holds no code of (none stored under the key or title). | +| `W_TOOL_LITERAL_SECRET` | The code holds what looks like a literal credential (`holdsSecret`, as for function code): a get prints it as `stored()`, and code a directory writes with one applies with this warning. | + +#### Skills + +| Code | Meaning | +| --- | --- | +| `E_SKILL_FRONTMATTER` | `skills/.md` does not open with a frontmatter block of `name` and `description`. | + +#### MCP servers + +| Code | Meaning | +| --- | --- | +| `E_MCP_LITERAL_SECRET` | A credential header (`Authorization`, `X-Api-Key`, …) holds literal text, not an env reference. | +| `E_MCP_STORED_MISSING` | `stored()` names a header the stored server holds no value for. | +| `E_MCP_TOOL_UNKNOWN` | A workflow names a tool the MCP server does not list. | +| `W_MCP_REPLACE` | A changed URL replaces the server: a new server id, the old one deleted. | +| `W_MCP_TOOLS_UNCHECKED` | The server's tools could not be listed, so the tool names workflows use are not checked. | + +#### Workspace files + +| Code | Meaning | +| --- | --- | +| `E_FILE_PATH` | A path no workspace file may have: a dot or empty segment, a reserved name or character. | +| `E_FILE_PATH_COLLISION` | Two paths that differ only in letter case, or a path that is both a file and a folder. | +| `E_FILE_NAME` | A name the server would store differently (trimmed, whitespace collapsed, NFC). | +| `E_FILE_TOO_LARGE` | A file over the per-blob cap: a get skips it and an apply never writes it. | +| `E_FILE_CONTENT` | A workspace file sent as text, or listed without a valid SHA-256 and size. | + +#### Knowledge bases + +| Code | Meaning | +| --- | --- | +| `E_KB_EMBEDDING_IMMUTABLE` | A declared embedding model that differs from the stored one: it is fixed at creation. | +| `E_KB_EMBEDDING_MODEL` | A new knowledge base declares a model this server does not create knowledge bases with. | +| `E_KB_DOC_AMBIGUOUS` | The server holds several documents under one declared file name. | +| `E_KB_DOC_NAME` | A document file name or type the knowledge base cannot hold. | +| `E_KB_DOC_EMPTY` | An empty document, which a knowledge base cannot index. | +| `E_KB_CHUNKING` | Chunking settings outside what a knowledge base accepts. | +| `E_KB_FOLDER` | A knowledge base folder that does not exist in the workspace. | +| `W_KB_DOC_UNCHECKED` | A stored document whose bytes this request had no budget left to download and compare. | +| `W_KB_DOC_FAILED` | Documents whose indexing failed: search does not find them until they are indexed again. | +| `I_KB_REEMBED` | How many documents the apply indexes (embeds) after it writes them. | +| `I_KB_CHUNKING` | Changed chunking applies to documents indexed from now on; stored ones keep their chunks. | +| `I_KB_PROCESSING` | Documents still waiting to be indexed or being indexed: search finds them once that ends. | +| `I_KB_DOCS_UNHASHED` | Documents a get lists without a hash: it had no budget left to download them. | +| `I_KB_UNMANAGED_DOCS` | Documents source leaves alone: connector-synced, too large, or not a plain file name. | +| `I_KB_REPLACE_UNFINISHED` | A replace that stopped partway left a replacement document (under its upload name): the next apply that changes the knowledge base finishes the replace, or removes the replacement. | + +#### Deployments + +| Code | Meaning | +| --- | --- | +| `E_DEPLOY_WORKFLOW` | `deployments/.ts` names no workflow this workspace holds or this directory declares. | +| `E_DEPLOY_SECRET` | A chat password written as a value instead of `env.NAME`, an unset variable, or `stored()` where no password is stored. | +| `E_DEPLOY_CHAT_OUTPUT` | A chat output names a block the workflow does not have. | +| `E_DEPLOY_CHAT_IDENTIFIER` | A chat identifier another live chat already holds. | +| `E_DEPLOY_PINNED_CHAT` | A chat change on a pinned deployment whose draft differs: deploying a chat publishes it. | +| `W_DEPLOYED_DRAFT_CHANGED` | An apply edits a deployed workflow that no `live: 'draft'` deployment republishes. | +| `W_DEPLOY_DRAFT_NOT_SOURCE` | A `live: 'draft'` deployment whose draft holds edits the directory does not declare (made in the editor, say): the apply does not publish it. | +| `E_DEPLOY_DRAFT_NOT_SOURCE_CHAT` | A chat change while the draft holds edits the directory does not: deploying a chat publishes it. | +| `I_DEPLOY_DRAFT_NOT_LIVE` | A pinned deployment's draft differs from its live version, which keeps running. | + +#### Plan and apply + +| Code | Meaning | +| --- | --- | +| `E_APPLY_NO_BASE` | The server holds the resource but the directory has no base for it: get it first. | +| `E_APPLY_FORBIDDEN` | The caller may not make this change. | +| `E_APPLY_DELETE_NOT_ALLOWED` | The change deletes a resource or data and `--allow-delete` was not given. | +| `E_APPLY_LOCKED` | The resource is locked against this change (HTTP 423). | +| `E_APPLY_REFUSED` | A change a child operation refused, with its message. | +| `E_APPLY_FAILED` | A write failed for a reason that is not the source's (logged on the server). | +| `E_PLAN_TOO_LARGE` | The apply would make more changes or touch more workflows than one request may. | +| `E_PLAN_REF_DELETED` | A declared resource references one this apply deletes. | +| `E_PLAN_REF_HELD` | A declared resource references one this apply holds back, so it is held back too. | +| `W_RESOURCE_IN_USE` | A resource this apply deletes is still used by stored workflows. | +| `W_TABLE_COLUMN_RENAMED_IN_USE` | A table column this apply renames is still written, filtered or sorted by its old name in a stored workflow's Table block, which the run then drops. | +| `E_WORKFLOW_FILES_MISSING` | A workflow folder sent without its files whose base names no workflow of this workspace. | +| `E_WORKFLOW_FOLDER_COPIED` | A workflow folder holding the base of another declared folder's workflow: a copy. | +| `W_UNDECLARED` | A resource the server holds that the directory does not declare (kept without `--allow-delete`). | +| `W_BASE_OTHER_WORKSPACE` | The directory's base was read from another workspace: every resource is created anew. | +| `W_PROMOTE_TARGET_DELETED` | A promotion (`apply --to`) keeps deleted a resource the directory declares that the target deleted since the last promotion: the target no longer holds it. | +| `W_PROMOTE_DELETES_TARGET_ONLY` | A promotion with `--allow-delete` deletes a resource only the target holds (the directory does not declare it). | +| `W_SERVER_CHANGED` | The server changed a resource the directory leaves alone; the apply keeps it. | +| `W_SERVER_DELETED` | The server deleted a resource the directory leaves as it was; it is not created again. | +| `W_SERVER_MOVED` | The server moved a resource the directory leaves as it was; it is not created again. | +| `I_KEY_REBOUND` | A key bound to a deleted resource was bound to the one this apply wrote. | +| `E_KEY_RENAMED` | A declaration under a new key for a resource the base read under another: keys never move. | + +#### Shared with workflow source + +A workspace finding with the same meaning as a workflow finding uses its code. + +| Code | Meaning | +| --- | --- | +| `E_APPLY_STALE` | The workflow changed since the source was read (HTTP 409). | +| `E_LIMIT_EXCEEDED` | Over the block, edge, total-byte, depth or `codeFile()` reference cap (`SOURCE_LIMITS`). Apply answers 413. | +| `E_NAME_TAKEN` | The `workflow('…')` name renames the workflow to one another workflow in its folder holds. | +| `I_FINDINGS_TRUNCATED` | 100 warnings, or 20 of one code, were listed and the rest omitted, so a flood of one finding never hides another. A finding repeated at the same place is listed once. Infos are capped apart (100, the rest dropped), so they never displace a warning, and errors are never displaced by either. An answer that merges findings from several stages is capped the same way as a whole; when that cuts it, it ends in one `I_FINDINGS_TRUNCATED` counting what it left out, in place of the stages' own. | + +{/* workflow-code-docs:diagnostics:end */} + +## Related docs + +- [File syntax](/workflows/code/syntax) +- [Exit codes](/workflows/code/exit-codes) +- [Limits](/workflows/code/limits) diff --git a/apps/docs/content/docs/workflows/code/directory.mdx b/apps/docs/content/docs/workflows/code/directory.mdx new file mode 100644 index 00000000000..ae2aec5f011 --- /dev/null +++ b/apps/docs/content/docs/workflows/code/directory.mdx @@ -0,0 +1,88 @@ +--- +title: Directory layout +description: Every file a workflow directory and a workspace directory holds, who writes it, and what to commit. +--- + +`get` writes a directory, and every later command reads and rewrites it. Keep the `.sim/` folder: it is how Sim recognizes each block and resource again, and how an apply knows what version you read. + +## Workflow directory + +`sim workflows source get --dir ` writes: + +| Path | What it is | In git | +| --- | --- | --- | +| `workflow.ts` | The workflow, in [file syntax](/workflows/code/syntax) | Commit | +| `functions/` | One file per Function block's code | Commit | +| `.sim/lock.json` | Ties each block in the file to the stored block, so renaming a block keeps its webhook URL, schedules and run history | Commit | +| `.sim/base.json` | The workflow ID and the version you read | Commit | +| `.sim/written.json` | A digest of each file as the CLI last wrote it, so `status` and `get` tell your edits from the CLI's | Commit | +| `.sim/stored-edges.json` | The connections the stored workflow held when it was printed, so an offline `check` tells them from connections you added. The CLI's own record, never sent | Commit | +| `.sim/starter.json` | The workspace a starter was written for, before `create` | Not kept: removed once the workflow exists | +| `.sim/AGENTS.md` | The guide for coding agents: the primer, then a reference | Optional, written again by `get` | +| `.sim/examples/` | Example workflows to copy from | Optional, written again by `get` | +| `.sim/sdk/` | Type declarations for the blocks the workflow uses, and your workspace's tables, credentials, knowledge bases and environment variable names. `.sim/sdk/INDEX.md` lists the builders | Optional, written again by `get` and `check` | +| `tsconfig.json` | Resolves the declarations and type-checks the blocks the workflow uses. Left as it is if you already have one | Commit | +| `tsconfig.full.json` | Type-checks every block through the CLI's cache | Ignore: it names the cache on your machine, and `check` writes it again | +| `.gitattributes` | Keeps the source files on LF line endings | Commit | + +The declarations of every block are generated once per block catalog into the CLI's cache, `~/.sim/cache/source-catalog/`, and shared by every directory. A workflow directory gets no `.gitignore`, so add the lines for what you ignore. + +While a command runs it holds `.sim/command.lock/`, so two commands on one directory never interleave. A second one exits `10`. + +## Workspace directory + +`sim workspaces source get --dir ` writes one folder per kind of resource. A kind is managed only when its folder or file exists. + +``` +secrets.ts the env variable names workflows read (never a value) +credentials.ts the saved credentials workflows use, by provider +tables/orders.ts a table: name, description, columns +tables/plans.rows.jsonl a table's rows, one JSON object per line (only when the table opts in) +knowledge/policies/knowledge.ts a knowledge base: name, chunking +knowledge/policies/docs/*.md one file per document +files/templates/reply.md a workspace file, at its folder path +tools/lookup-order.ts a custom tool: title and schema +tools/lookup-order.js the tool's code +skills/tone.md a skill: name and description, then its content +mcp/docs.ts an MCP server: url, headers +workflows/support/workflow.ts a workflow directory +deployments/support.ts how workflows/support is deployed +``` + +A resource's key is its file or folder name, and a workflow names it by that key. Every `.ts` file starts with the line `// @sim-sdk 1`, a deployment included; the one-line forms below show only the call. What each kind's file holds: + +{/* workflow-code-docs:directory-kinds:begin — generated by `bun run generate:workflow-code-docs`; do not edit between markers */} + +- `secrets.ts`: `export default defineSecrets({ NAME: { description? } })`, the workspace secrets workflows read, by name and description only (never a value: set one with `sim secrets set NAME --scope workspace`). A workflow: `env.NAME`; one using a declared secret the workspace has no value for is held back, and the rest apply. +- `credentials.ts`: `export default defineCredentials({ : { provider, name? } })`, binding each key to this workspace's credential for that provider (never a token): the one bound already, else the only one, else the one whose display name is `name`. A workflow: `credential('')`; one using a key no credential binds to is held back, and the rest apply. +- `tools/.ts` (`defineTool({ title, schema, code: codeFile('./.js') })`) and its code in `tools/.js`, where each schema parameter is a variable. Code holding a literal credential prints as `code: stored()`, which keeps the stored code. A workflow: `customTool('')`. +- `skills/.md`: a frontmatter block of `name` and `description`, then the content. A workflow: `skills: [skill('')]` on an agent. +- `mcp/.ts`: `export default defineMcpServer({ name?, url, headers?, auth?, timeout?, retries?, enabled? })`. A credential header holds `env.NAME` or `'Bearer {{NAME}}'`, never a literal secret; `stored()` keeps the value the server holds. A changed `url` replaces the server. A workflow: `mcp('').tool('')`. +- `tables/.ts`: `export default defineTable({ name, description?, folder?, columns: { … } })` with `column.string()`, `column.number()`, `column.select({ options: [...] })`, … from `@sim/workflow-sdk/workspace`. Rows stay out of source unless `rows` opts in: `{ mode: 'managed', key: '' }` keeps the rows equal to `tables/.rows.jsonl` (one JSON object per line, keyed by column key), `{ mode: 'seed' }` writes them once into a new table. A workflow: `table('')`. +- `knowledge//knowledge.ts` (`defineKnowledgeBase({ name, description?, folder?, chunking?, embeddingModel? })`) and `knowledge//docs/`, one file per document, flat. A workflow: `knowledgeBase('')`. Connector-synced documents are never part of source. +- `files/`: every file is one workspace file at that folder path; no declaration. +- `workflows//`: one workflow each, exactly a `sim workflows source get --dir` directory (`workflow.ts`, `functions/*`, `.sim/lock.json`, `.sim/base.json`). +- `deployments/.ts`: `defineDeployment({ live: 'draft' | 'pinned', api?: { public? }, chat? })` deploys `workflows//`, so its schedule, webhook, API and chat triggers run. `live: 'draft'` publishes the draft whenever it differs from the live version; `'pinned'` never redeploys and says when the draft differs. A chat password is `env.NAME` (or `stored()` to keep the stored one); chat outputs name a block by its name. Removing the file undeploys the workflow (needs `--allow-delete`). Deploying needs workspace admin, never a workspace API key. MCP publishing is not part of source. + +{/* workflow-code-docs:directory-kinds:end */} + +Beside the resources: + +| Path | What it is | In git | +| --- | --- | --- | +| `.sim/base.json` | The workspace the directory was read from and the version of every resource | Commit | +| `workflows//.sim/` | Each workflow's `lock.json`, `base.json` and `written.json`, as above | Commit | +| `.sim/targets/.json` | What each [promotion](/workflows/code/promote) left in that workspace | Commit | +| `.sim/skipped.json` | Documents and files a get left out, with the reason | Optional | +| `.sim/AGENTS.md`, `.sim/GUIDE-advanced.md`, `.sim/examples/`, `.sim/sdk/` | The agent guide with deletes, Git and CI, and promotion in depth; examples of every kind; type declarations including `.sim/sdk/workspace.d.ts` | Optional, written again by `get` | +| `.sim/cache/` | This machine's file stats. It ignores itself | Not committed | +| `tsconfig.json`, `tsconfig.full.json`, `.gitattributes`, `.gitignore` | As for a workflow directory. `.gitattributes` also keeps workspace files and knowledge base documents byte for byte | Commit all but `tsconfig.full.json` | + +The generated `.gitignore` leaves out only what a command keeps while it runs (`.sim/downloads/`, `.sim/command.lock/`, `.sim-staging-*`) and `tsconfig.full.json`. Commit the rest, including `.sim/`: a fresh clone can then run `check`, `apply --dry-run` and `apply`. + +## Related docs + +- [Edit a workflow](/workflows/code/edit) +- [Manage a workspace as code](/workflows/code/workspace) +- [Run in CI](/workflows/code/ci) +- [Limits](/workflows/code/limits) diff --git a/apps/docs/content/docs/workflows/code/edit.mdx b/apps/docs/content/docs/workflows/code/edit.mdx new file mode 100644 index 00000000000..5a637b6a2c2 --- /dev/null +++ b/apps/docs/content/docs/workflows/code/edit.mdx @@ -0,0 +1,104 @@ +--- +title: Edit a workflow +description: Read a workflow into a directory, edit it, check it, and save it, including renames, deletes and deploys. +--- + +Result: a workflow saved from a file you edited, with the problems found before the save. + +## Prerequisites + +The Sim CLI, signed in, with [workflows as code enabled](/workflows/code). Run every command on the same `--dir`; commands that read a directory (`check`, `status`, `diff`, `params`, `apply`) default it to the current directory, while `get` and `create`, which write one, always need `--dir`. + +## 1. Read the workflow + +```bash +sim workflows source get --dir ./support-triage +``` + +This writes `workflow.ts`, any function code under `functions/`, type declarations for the blocks the workflow uses and for your workspace's resources, and the `.sim/` folder. See [Directory layout](/workflows/code/directory) for each file. For coding agents it writes `.sim/AGENTS.md` and example workflows under `.sim/examples/`. + +`get` into a directory that already holds source refuses to overwrite edits you have not applied, and refuses a directory that holds a different workflow. Pass `--force` to replace them. A workspace directory is always refused, `--force` included. + +To write a block the workflow does not use yet, `sim workflows source params ` (for example `table.upsertRow` or `trigger.schedule`) prints an example call, its required params with their types, its optional params by name and its outputs, from the cached block catalog without a request (`--full` adds every param's options, default and doc). A namespace such as `gmail` lists its builders. + +## 2. Edit and check + +Edit `workflow.ts`, then compile it on your machine with Sim's compiler: + +```bash +sim workflows source check --dir ./support-triage +``` + +`check` makes no request. It needs the block catalog the last `get` cached in `~/.sim/cache/source-catalog/`; with none cached it exits `1` and tells you to run `get` once. It exits `1` on an error, and on the warnings `sim workflows source check --help` lists (a missing required field, an unknown option, an unwired condition or router branch, a literal secret and more) in a block you added since the get. `--strict` fails on these in every block, except an unwired branch on a block the get printed; `--no-strict` never fails on a warning. + +Then it adds the blocks the workflow now uses to `tsconfig.json` and type-checks the directory with it, using the TypeScript release the generated declarations are built for, as your editor does. Each type error is an `E_TYPE` error at its line, with TypeScript's own code (`TS2339: …`) at the start of the message. A type error is left out on a line the compile already reports an error on, and in a file still as the last get or apply wrote it when that file had the same error then (against the declarations as that get or apply left them), where the dry run decides; one that another file's edit causes there is reported. The first check installs that release with `npm` into `~/.sim/cache/typescript/`, once; offline before then, `check` warns `W_TYPES_UNCHECKED` and passes or fails on the compile alone. `--no-types` skips the type check. `tsconfig.full.json` includes every block, for an editor. + +## 3. See what changed + +```bash +sim workflows source status --dir ./support-triage +sim workflows source diff --dir ./support-triage +``` + +`status` lists the files you created, edited, or deleted, asks the server (with a plan read that saves nothing) whether the workflow changed since the `get`, and ends with the one command to run next. It exits `0` when nothing changed, `11` when only your edits are unsaved, and `12` when the workflow changed in the workflow builder since the `get` (a conflict, if you edited it too). Without a connection it shows your edits only and says so; `--offline` skips the server. `diff` prints each edit as a unified diff, and `diff --server` compares the directory with the workflow as it is saved now. Both take `--json` (or `--output json`). + +## 4. Dry run + +```bash +sim workflows source apply --dir ./support-triage --dry-run +``` + +`apply` reads the workflow ID from `.sim/base.json`. Pass it as `apply --dir …` to have the CLI confirm the directory holds that workflow. + +Sim compiles the file and runs every check a save would run: unknown settings, missing required fields, broken references, permissions, and locked blocks. Each problem prints with its line, the code around it, and a hint: + +``` +workflow.ts:56:7 error E_UNKNOWN_PARAM: Slack has no param chanel. + 54 | const notify = slack.sendMessage('Notify', { + 55 | credential: credential('support-slack'), +> 56 | chanel: 'C0SUPPORT', + | ^^^^^^^^^^^^^^^^^^^ + 57 | text: t`New ${classify.category} ticket: ${ticketIn.subject}`, + hint: Did you mean channel? +``` + +Every code is in [Diagnostic codes](/workflows/code/diagnostics). + +## 5. Save the draft + +```bash +sim workflows source apply --dir ./support-triage --yes +``` + +The workflow builder updates for anyone who has the workflow open. `--yes` refuses everything a dry run would, so step 4 is optional: without `--yes`, and with no terminal to ask, `apply` prints the plan, writes nothing and exits `14`. The save rewrites `workflow.ts` in canonical form, so read it again before the next edit. + +Editing the name or description in `workflow('…')` renames or redescribes the workflow; a name another workflow in its folder already has is refused with `E_NAME_TAKEN`. Lines starting with `note:` report something the save did beyond what the file says; read them. + +### Deploy + +Saving writes the draft. Add `--deploy` to deploy right after the save, which also prints the URL of each webhook the workflow now serves. Without it, a deployed workflow whose draft now differs prints the `sim workflows deploy` command to run. + +### Deletes + +A save that removes a block (its declaration is gone from `workflow.ts`) is refused with `E_APPLY_BLOCK_DELETE`, naming the blocks, and one that removes a workflow variable with `E_APPLY_VARIABLE_DELETE`. Pass `--allow-delete` when the deletion is intended. Removing a block that serves a live webhook, schedule, chat, or MCP tool warns you: the deployed version keeps serving it until the next deploy. + +### Renames + +Keep the `.sim/` folder the commands write. `.sim/lock.json` ties each block in the file to the stored block, so renaming a block keeps the same block, with its webhook URL, schedules and run history. Changing its name string keeps it through the lock; renaming the variable too keeps it when the block's type, parent and connections are unchanged, and the dry run reports that as `W_MAT_INFERRED_RENAME`. Renaming two blocks of the same type in the same place in one save is ambiguous, so do those one save at a time. `.sim/base.json` records the version you read. + +## Working with other people + +- If someone changes the workflow after you read it, the save (or `--dry-run`) is refused with exit code `5` and nothing is overwritten. Run `get` into a new directory, reapply your edit, and save. There is no automatic merge. +- Locked blocks cannot be changed from the file. Unlock them in the workflow builder first. + +## Limits + +The file holds block declarations and connections only: helpers, loops that create blocks, and imports are refused. Function code is one file per block, with no imports between files. Workflows run in Sim, not locally, and `--dry-run` checks everything a save checks without running the workflow. Size caps are in [Limits](/workflows/code/limits). + +## Related docs + +- [File syntax](/workflows/code/syntax) +- [Create a workflow](/workflows/code/create) +- [Run in CI](/workflows/code/ci) +- [Exit codes](/workflows/code/exit-codes) +- [CLI workflow commands](/cli/workflows#workflows-as-code) diff --git a/apps/docs/content/docs/workflows/code/exit-codes.mdx b/apps/docs/content/docs/workflows/code/exit-codes.mdx new file mode 100644 index 00000000000..5b16b21f531 --- /dev/null +++ b/apps/docs/content/docs/workflows/code/exit-codes.mdx @@ -0,0 +1,82 @@ +--- +title: Exit codes +description: What the sim workflows source and sim workspaces source commands exit with, and what to run next. +--- + +import { Tab, Tabs } from '@/components/ui/tabs' + +The `sim workflows source` and `sim workspaces source` commands exit with a code a script or CI job can branch on. Findings print on stderr, and the result of a command goes to stdout. A code of its own is set aside for each outcome a script handles differently, so test for the code you act on, not for any non-zero status. + +`status` is the command to branch on: it exits `0` when nothing differs, `11` when only your edits are unsaved, and `12` when the server changed since the directory was read. + +```bash +sim workspaces source status --dir workspace --output json > status.json +case $? in + 0) echo "in sync" ;; + 11) echo "local edits to apply" ;; + 12) echo "the workspace changed in Sim since the get" ;; + *) echo "status failed"; exit 1 ;; +esac +``` + +## Codes + +The table for the kind of directory you work in. Both are built from the table `--help`, the generated [CLI reference](/cli/workflows#workflows-as-code) and `.sim/AGENTS.md` print, so they cannot disagree with the CLI. + +{/* workflow-code-docs:exit-codes:begin — generated by `bun run generate:workflow-code-docs`; do not edit between markers */} + + + + + | Code | Meaning | What to do | + | --- | --- | --- | + | `0` | Applied or created, a dry run or check with no errors, or a clean status | Go on | + | `1` | The source has errors (each printed as `file:line:column` with a hint), a locked block (`E_APPLY_LOCKED_BLOCK`), a name another workflow holds (`SOURCE_NAME_TAKEN`), a cancelled prompt, or the command failed | Fix what it printed and run it again | + | `5` | Stale (`SOURCE_STALE`, or `E_APPLY_STALE` on a dry run): the server changed what this directory was read from, and nothing was written | `sim workflows source get --dir `, reapply your edit there, dry-run, apply | + | `6` | A workflow or its folder is locked (`E_APPLY_LOCKED`); a locked block exits 1 instead | Ask someone to unlock it in the workflow builder | + | `7` | The source is over the size limits (on a get, status or diff too) | Split function code, or remove blocks or resources | + | `8` | `sim workspaces source apply` stopped part-way: what was written is saved into the directory | Apply again until it exits 0 | + | `9` | Still rate limited (HTTP 429) after the CLI's retries (up to 6, at most a minute apart); nothing more was written | Wait a minute and run the same command again | + | `10` | Busy: another apply is writing the workspace (`SOURCE_BUSY`), or another sim command is using this directory (`SOURCE_DIR_BUSY`); nothing was written | Run it again once the other finished | + | `11` | `status`: only your edits, which applying writes | Dry-run, then apply | + | `12` | `status`: the server changed since the get (drift, or a conflict with your edits) | Follow the `Next:` line it prints | + | `13` | Not logged in, the login expired, or the server refused the credential (`AUTH_REQUIRED`); nothing was sent | `sim login`, or fix or unset `SIM_API_KEY` when the key comes from it; then the same command again | + | `14` | `apply` or `create` without `--yes` and no terminal to ask: it printed the plan, found no errors, and wrote nothing | Run the same command with `--yes` | + | `15` | `sim workspaces source apply` (or `--to`) wrote part of its plan and held the rest back: a change that uses a declared secret the workspace has no value for, or a credential key nothing binds to. Its dry run exits 15 too, so a script can tell beforehand that the apply would write only part | Set the secret (`sim secrets set`) or connect the credential, then apply again | + | `130` | Interrupted (Ctrl-C). An apply or create already sent is finished and saved into the directory first, waiting up to 60s for its answer; a second Ctrl-C, or no answer by then, stops at once and prints that it may have been written | `sim workflows source status --dir .` | + + + + + | Code | Meaning | What to do | + | --- | --- | --- | + | `0` | Applied or created, a dry run or check with no errors, or a clean status | Go on | + | `1` | The source has errors (each printed as `file:line:column` with a hint), a locked block (`E_APPLY_LOCKED_BLOCK`), a name another resource holds (`E_NAME_TAKEN`), a cancelled prompt, or the command failed | Fix what it printed and run it again | + | `5` | Stale (`SOURCE_STALE`, or `E_APPLY_STALE` on a dry run): the server changed what this directory was read from, and nothing was written | `sim workspaces source get --dir `, reapply your edit there, dry-run, apply | + | `6` | A resource is locked (`E_APPLY_LOCKED`): a workflow or its folder, or a table; a locked block exits 1 instead | Ask someone to unlock it: a workflow in the workflow builder, a table in its settings (the finding's hint names which) | + | `7` | The source is over the size limits (on a get, status or diff too) | Split function code, or remove blocks or resources | + | `8` | `sim workspaces source apply` stopped part-way: what was written is saved into the directory | Apply again until it exits 0 | + | `9` | Still rate limited (HTTP 429) after the CLI's retries (up to 6, at most a minute apart); nothing more was written | Wait a minute and run the same command again | + | `10` | Busy: another apply is writing the workspace (`SOURCE_BUSY`), or another sim command is using this directory (`SOURCE_DIR_BUSY`); nothing was written | Run it again once the other finished | + | `11` | `status`: only your edits, which applying writes | Dry-run, then apply | + | `12` | `status`: the server changed since the get (drift, or a conflict with your edits) | Follow the `Next:` line it prints | + | `13` | Not logged in, the login expired, or the server refused the credential (`AUTH_REQUIRED`); nothing was sent | `sim login`, or fix or unset `SIM_API_KEY` when the key comes from it; then the same command again | + | `14` | `apply` or `create` without `--yes` and no terminal to ask: it printed the plan, found no errors, and wrote nothing | Run the same command with `--yes` | + | `15` | `sim workspaces source apply` (or `--to`) wrote part of its plan and held the rest back: a change that uses a declared secret the workspace has no value for, or a credential key nothing binds to. Its dry run exits 15 too, so a script can tell beforehand that the apply would write only part | Set the secret (`sim secrets set`) or connect the credential, then apply again | + | `130` | Interrupted (Ctrl-C). An apply or create already sent is finished and saved into the directory first, waiting up to 60s for its answer; a second Ctrl-C, or no answer by then, stops at once and prints that it may have been written | `sim workspaces source status --dir .` | + + + + +{/* workflow-code-docs:exit-codes:end */} + +Exit `9` follows the CLI's retries: it resends a request the API answered `429` only when sending it twice is safe, which includes every `GET`, a source `apply` and a `create`. See [Scripting](/cli/scripting#exit-codes) for the retry schedule and the codes every command shares (`13` and `9`). + +## Related docs + +- [Troubleshooting](/workflows/code/troubleshooting): the causes behind each code +- [Run in CI](/workflows/code/ci) +- [Diagnostic codes](/workflows/code/diagnostics) +- [Limits](/workflows/code/limits) +- [Scripting: exit codes](/cli/scripting#exit-codes) +- [CLI workflow commands](/cli/workflows#workflows-as-code) and [workspace commands](/cli/workspaces#workspace-as-code) diff --git a/apps/docs/content/docs/workflows/code/get-started.mdx b/apps/docs/content/docs/workflows/code/get-started.mdx new file mode 100644 index 00000000000..6bbdeedd29d --- /dev/null +++ b/apps/docs/content/docs/workflows/code/get-started.mdx @@ -0,0 +1,74 @@ +--- +title: Get started +description: Change one setting of a workflow from your terminal, save it, and see it in the workflow builder. +--- + +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](/workflows/code) 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](/cli#your-first-command). +- Optional: Bun, for the type-check in step 4. + +## 1. Find the workflow ID + +```bash +sim workflows list --search "support" +``` + +## 2. Read it as a file + +```bash +sim workflows source get --dir ./support-triage +``` + +This writes `workflow.ts`, the type declarations, and `.sim/`, which records which block is which. See [Directory layout](/workflows/code/directory). + +## 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](/workflows/code/syntax). + +## 4. Check it + +```bash +sim workflows source check --dir ./support-triage +``` + +`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 + +```bash +sim workflows source status --dir ./support-triage +sim workflows source diff --dir ./support-triage +``` + +`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 + +```bash +sim workflows source apply --dir ./support-triage --dry-run +sim workflows source apply --dir ./support-triage --yes +``` + +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 + +```bash +sim workflows source create --dir ./new-workflow --workspace +``` + +See [Create a workflow](/workflows/code/create). + +## Related docs + +- [Edit a workflow](/workflows/code/edit) +- [Use with coding agents](/workflows/code/coding-agents) +- [Exit codes](/workflows/code/exit-codes) diff --git a/apps/docs/content/docs/workflows/code/how-it-works.mdx b/apps/docs/content/docs/workflows/code/how-it-works.mdx new file mode 100644 index 00000000000..da27f0d19f0 --- /dev/null +++ b/apps/docs/content/docs/workflows/code/how-it-works.mdx @@ -0,0 +1,102 @@ +--- +title: How it works +description: How Sim turns a file into a saved workflow, keeps each block's identity, and refuses an apply that would overwrite someone else's change. +--- + +A source file is a declaration, not a program. Sim reads it, compares it with the stored workflow, and saves the difference. This page explains the rules behind `get`, `check` and `apply`, so their results and refusals are predictable. + +## Nothing in the file runs + +`workflow.ts` is TypeScript so that your editor can complete and type-check it, but no command executes it. Sim parses the file and reads each `const x = builder('Name', {…})` as one block, each `.to()` as one connection, and each param as one setting. That is why the file holds declarations only: a helper function, a loop that creates blocks, or an import from anything but `@sim/workflow-sdk` has no value Sim could read without running it, so it is refused with `E_UNSUPPORTED_SYNTAX` and a hint. + +`check` runs this compiler on your machine, the same one the server runs, against the block catalog the last `get` cached, then type-checks the directory with the TypeScript release the generated declarations are built for. Function code under `functions/` is not run either: it is stored as the Function block's code and runs in Sim, like code typed into the workflow builder. + +## From a file to a saved draft + +An apply goes through three steps, and a dry run stops after the second: + +1. **Compile.** The file becomes the workflow's canonical form: its blocks keyed by name, their settings, connections, branches, loops and variables, with no IDs and no layout. +2. **Evaluate.** Sim reads the stored draft into the same form, matches each compiled block to a stored one, and checks what a save would change: unknown settings, missing required fields, references, permissions, locked blocks, deletes and the workflow's lint. Every finding maps back to a line in your files. +3. **Commit.** Sim writes the new draft in one transaction, after checking again that nobody saved the workflow meanwhile. + +Deploying is never part of an apply unless you pass `--deploy` (or, for a workspace directory, add a file under `deployments/`). + +## The canonical form + +The stored workflow and the file are two views of one canonical form, so a round trip changes nothing: + +- `get` prints the canonical form. An `apply` of an unchanged directory is a no-op, and the stored workflow stays byte for byte the same. +- A setting equal to the value a block gets when you add it in the workflow builder is left out of the file. Writing it out has the same effect as leaving it out. +- After a save, Sim prints the files again from what it stored. A value the server normalized, a resource key it allocated, or a reference it rewrote for a rename shows up in your files, so read them again before the next edit and commit what changed. + +Some state has no syntax in the file. Sim keeps it from the stored workflow on every apply: + +- **Layout.** Block positions stay in Sim. A new block is placed automatically. Moving blocks never makes a directory stale. +- **Settings that do not run.** A value in a field that the block's current choices hide stays stored, so switching back in the workflow builder brings it back. +- **Comments.** Comments in `workflow.ts` are stored with the workflow, by block, so a builder edit or a rename keeps them. + +## Block identity + +Each stored block has an ID that its webhook URL, schedules and run history hang on. The file names blocks by `const` name and display name instead, so Sim needs a way to tell an edited block from a new one. + +`.sim/lock.json` records, for each block in the file, the ID of the stored block it is. An apply matches each block in the file, in this order: + +1. by its block key in the lock, the display name lowercased with whitespace and dots removed; +2. by its `const` name in the lock, so changing only the display name keeps the block; +3. by its block key in the stored workflow, when the lock does not have it; +4. by inference: when a block left and one of the same type appeared in the same place with the same connections or settings, it is a rename (`W_MAT_INFERRED_RENAME`). + +A block that matches nothing is new, and a stored block nothing matched is a delete, which an apply refuses without `--allow-delete` (`E_APPLY_BLOCK_DELETE`). Renaming two blocks of the same type in the same place in one save leaves the inference nothing to tell apart, so rename them one save at a time. + +Sim also stores each block's `const` name, its order in the file and its comments, by block ID. A `get` into a new directory, or after a builder edit, prints the same names in the same order, so a one-setting change stays a one-line diff. + +## Stale: what you read is not what Sim holds + +`.sim/base.json` records a fingerprint of the draft you read: a hash of its canonical form, its variables and its block IDs, without layout. An apply sends it, and Sim computes the fingerprint of the draft it holds now: + +- the same: the apply goes ahead; +- different: someone saved the workflow since you read it. The apply is refused as stale with exit `5`, on a dry run too, and nothing is written; [Troubleshooting](/workflows/code/troubleshooting#exit-5) has the steps. + +The check is made again inside the write's transaction, so two applies that race cannot both win. `status` asks the same question with a plan read that saves nothing and reports it as drift (exit `12`) before you apply. + +The base also records the block catalog you read against. When a compile fails and the catalog changed since, for example after a block gained a setting, the apply adds `W_APPLY_CATALOG_MOVED`: run `get` again to pick up the new types. + +## Workspaces: one rule per resource + +A workspace directory adds tables, knowledge bases, files, custom tools, skills, MCP servers, secret names, credential keys and deployments. Each resource has a key, its file or folder name, which Sim stores and never changes: a rename in Sim keeps the key, and a workflow names the resource by it, as in `table('orders')`. + +`.sim/base.json` at the root records each resource's ID and fingerprint as the last `get` or apply saw it. An apply decides each declared resource by comparing three fingerprints: your file (local), the base, and what Sim holds now (server): + +| Your file vs the base | Sim vs the base | Outcome | +| --- | --- | --- | +| Same | Any | Nothing to do. When Sim changed it, the apply keeps Sim's version (`W_SERVER_CHANGED`) | +| Changed | Same | Written | +| Changed | Changed | Nothing to do when both made the same change; otherwise stale, exit `5` | + +A resource with no base entry is created, or **adopted** when Sim already holds one under the same name. An adopt only adds to what is there, such as a column or a document; one that would change or remove anything is refused with `E_APPLY_NO_BASE`. A resource the directory stops declaring is deleted only when the base recorded it and you pass `--allow-delete`; anything else Sim holds is kept and named in a `W_UNDECLARED` warning. + +Workflows are the exception to this table. Each workflow folder is applied exactly as a single workflow, with its own `.sim/lock.json` and `.sim/base.json`: a folder you did not edit is skipped without asking whether Sim changed it, so it gets no `W_SERVER_CHANGED`, and an edited folder is refused as stale whenever Sim changed the workflow since its base, even when both made the same change. + +An apply writes resources in dependency order, so a table exists before the workflow that writes to it, and deletes run in reverse. + +### Applying a workspace + +- **Whole or nothing at planning.** Every check runs before the first write. One error refuses the whole apply. +- **One apply at a time.** An apply holds the workspace from planning to its last write. A second apply meanwhile exits `10` with nothing written. A dry run does not take part, so it never waits. +- **Writes commit one by one.** If a write fails part-way, the apply stops, saves what it wrote into the directory and exits `8`. Applying the same directory again finishes the rest. +- **Held back.** A change that uses a secret with no value in the workspace, or a credential key nothing binds to, is held back while the rest is written, and the apply exits `15`. +- **Files travel separately.** Workspace files and knowledge base documents are uploaded before the apply, and only the ones Sim does not have yet, so a retry uploads nothing again. + +## Promotion + +`apply --to ` sends a directory read from one workspace to another. Sim sees an ordinary apply against the target's own IDs: each resource binds by key, so a workflow keeps its ID and webhook URLs in the target, and secrets and credentials bind by name to the target's own. + +The directory stays bound to the workspace it was read from. The only file a promotion writes is `.sim/targets/.json`, a record of what it left in the target. The next promotion uses that record as the base for the three-way rule above, so a hotfix made in the target is kept when the directory left that resource alone, and refused as stale when the directory changed it too. See [Promote to another workspace](/workflows/code/promote). + +## Related docs + +- [Edit a workflow](/workflows/code/edit) +- [Manage a workspace as code](/workflows/code/workspace) +- [Directory layout](/workflows/code/directory) +- [Troubleshooting](/workflows/code/troubleshooting) +- [Diagnostic codes](/workflows/code/diagnostics) diff --git a/apps/docs/content/docs/workflows/code/index.mdx b/apps/docs/content/docs/workflows/code/index.mdx new file mode 100644 index 00000000000..b7891446174 --- /dev/null +++ b/apps/docs/content/docs/workflows/code/index.mdx @@ -0,0 +1,60 @@ +--- +title: Workflows as code +description: Read and edit workflows and whole workspaces as TypeScript files, check them before saving, and review changes as diffs. +--- + +import { Callout } from '@/components/ui/callout' + +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. + + +Workflows as code is in preview. When it is enabled, the workflow builder shows a read-only **Code** tab and the [CLI](/cli) gains the `sim workflows source` and `sim workspaces source` commands. On a self-hosted deployment, set [`WORKFLOW_CODE`](/platform/self-hosting/environment-variables#preview-features). On Sim Cloud it is enabled per organization, workspace or user. Where it is off, the **Code** tab is not shown and a source command answers `403` with "Workflows as code is in preview and not enabled for this workspace". + + +## Workflow or workspace + +- **A workflow** is one `workflow.ts` plus its function code files. Use `sim 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: + +```bash +sim workflows source get --dir ./support-triage +# edit ./support-triage/workflow.ts +sim workflows source check --dir ./support-triage +sim workflows source status --dir ./support-triage +sim workflows source apply --dir ./support-triage --dry-run +sim workflows source apply --dir ./support-triage --yes +``` + +`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 get` writes; a **workspace directory** is the one `sim workspaces source get` writes. +- **Get** reads from Sim and **apply** writes to Sim. Neither is a sync: [fork, push and pull](/cli/workflow-sync) 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 (`status` exits `12`). 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 [#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](/workflows/code/coding-agents). + +## Related docs + +- [Get started](/workflows/code/get-started): change one setting and see it in the builder +- [Edit a workflow](/workflows/code/edit) +- [Manage a workspace as code](/workflows/code/workspace) +- [Run in CI](/workflows/code/ci) +- [Bring existing workflows into code](/workflows/code/adopt) +- [Troubleshooting](/workflows/code/troubleshooting) +- [How it works](/workflows/code/how-it-works) +- [File syntax](/workflows/code/syntax) +- [Exit codes](/workflows/code/exit-codes), [diagnostic codes](/workflows/code/diagnostics) and [limits](/workflows/code/limits) +- [CLI workflow commands](/cli/workflows#workflows-as-code) and [workspace commands](/cli/workspaces#workspace-as-code) diff --git a/apps/docs/content/docs/workflows/code/limits.mdx b/apps/docs/content/docs/workflows/code/limits.mdx new file mode 100644 index 00000000000..6f08e50e88b --- /dev/null +++ b/apps/docs/content/docs/workflows/code/limits.mdx @@ -0,0 +1,61 @@ +--- +title: Limits +description: The size limits of workflow source and workspace source, and what happens when a directory goes over one. +--- + +A get leaves out what an apply would refuse, so anything a get writes can be applied back unchanged. The numbers below are hard limits, read from the same constants the CLI and the server enforce. + +## What happens over a limit + +- **A workflow** over a limit is refused when you read or save it (`E_LIMIT_EXCEEDED`), and the CLI exits `7`. +- **An apply of a workspace directory** that would make more changes than the limit, send more edited workflows, or hold more resources of a kind is refused before anything is written, and the CLI exits `7`. +- **A get of a workspace** that holds more resources of a kind than one directory takes exits `7`. +- **A workspace file or knowledge base document** over its limit, or whose name a directory cannot hold, is left out of the get and listed in `.sim/skipped.json`. An apply never writes or deletes it. + +{/* workflow-code-docs:limits:begin — generated by `bun run generate:workflow-code-docs`; do not edit between markers */} + +### One workflow + +| Limit | Value | +| --- | --- | +| Blocks in one workflow | 2,000 | +| Connections (edges) in one workflow | 10,000 | +| Variables in one workflow | 2,000 | +| Files in one source: `workflow.ts` plus one function file per block | 2,001 | +| Bytes of all files together, `workflow.ts` and function files | 4,000,000 bytes | +| Nesting depth of `workflow.ts`, and of each JavaScript function file | 200 | + +### A workspace directory + +| Limit | Value | +| --- | --- | +| Resources of one kind in one directory | 500 | +| Bytes of every declaration file together, workflow files excluded | 2,000,000 bytes | +| Edited workflows one apply sends | 100 | +| Bytes of every workflow file one apply sends | 8,000,000 bytes | +| Bytes of every workflow file one get writes; a workflow past it is left out | 32,000,000 bytes | +| Changes one apply makes, no-ops excluded | 1,000 | +| Rows in one `tables/.rows.jsonl` | 10,000 | +| Bytes of every rows file together | 16,000,000 bytes | +| Columns in one table | 1,000 | +| Bytes of one workspace file or knowledge base document | 10,000,000 bytes | +| Workspace files and knowledge base documents together in one directory | 20,000 | +| Nesting depth of a declaration file | 200 | + +### Uploading and downloading files + +| Limit | Value | +| --- | --- | +| Bytes of files one upload request carries; a larger file goes in a request of its own | 8,000,000 bytes | +| Files in one upload request | 1,000 | +| Bytes of stored files one get or apply downloads to compare | 24,000,000 bytes | +| Files one caller may hold staged in one workspace at once | 20,000 | +| Bytes one caller may hold staged in one workspace at once | 4,000,000,000 bytes | + +{/* workflow-code-docs:limits:end */} + +## Related docs + +- [Exit codes](/workflows/code/exit-codes) +- [Diagnostic codes](/workflows/code/diagnostics) +- [Manage a workspace as code](/workflows/code/workspace) diff --git a/apps/docs/content/docs/workflows/code/meta.json b/apps/docs/content/docs/workflows/code/meta.json new file mode 100644 index 00000000000..42ecb64f9ae --- /dev/null +++ b/apps/docs/content/docs/workflows/code/meta.json @@ -0,0 +1,24 @@ +{ + "title": "Workflows as code", + "pages": [ + "index", + "get-started", + "---How-to guides---", + "edit", + "create", + "workspace", + "promote", + "ci", + "coding-agents", + "adopt", + "troubleshooting", + "---Reference---", + "syntax", + "directory", + "exit-codes", + "diagnostics", + "limits", + "---Explanation---", + "how-it-works" + ] +} diff --git a/apps/docs/content/docs/workflows/code/promote.mdx b/apps/docs/content/docs/workflows/code/promote.mdx new file mode 100644 index 00000000000..4dd1ba68ded --- /dev/null +++ b/apps/docs/content/docs/workflows/code/promote.mdx @@ -0,0 +1,51 @@ +--- +title: Promote to another workspace +description: Apply a workspace directory read from one workspace to another with --to, such as dev to prod, and how the target record works. +--- + +Result: the resources of a directory created or updated in a second workspace, with changes made there since the last promotion kept or refused. + +## Promote or fork? + +- Use **promote** (`--to`) when the directory, usually in git, is the source of truth and the target workspace need not be linked to the source. +- Use **fork, push and pull** when two workspaces should stay linked as parent and child and exchange reviewed changes. They need an Admin on both workspaces, and Enterprise on billing-enabled deployments. See [Workflow imports and workspace sync](/cli/workflow-sync). + +## Before the first promotion + +Set the target's secrets (`sim secrets set NAME --scope workspace -w `) and connect its credentials, or the workflows that use them are held back and the apply exits `15`. + +## Promote + +Apply a directory read from one workspace (dev) to another (prod) with `--to`: + +```bash +sim workspaces source apply --dir ./my-workspace --to "$PROD_WORKSPACE_ID" --dry-run +sim workspaces source apply --dir ./my-workspace --to "$PROD_WORKSPACE_ID" --yes +``` + +Each resource binds by key to the target's own. One the target holds under the same key is updated in place, so a workflow keeps its id and its webhook URLs. A key the target lacks is created. Secrets and credentials bind by name to the target's own, and no value is copied. The directory stays bound to the workspace it was read from. Without `--to`, `check`, `status`, `diff` and `apply` act on the workspace the directory was read from, whatever your default workspace; a `--workspace` naming another one is refused. + +## Deletes + +A resource you deleted from the directory since the last promotion is deleted in the target too, and like any delete it needs `--allow-delete`. Resources only the target holds, such as a table created in prod and the rows its runs wrote, are kept, with or without `--allow-delete`: the plan names each with a `W_UNDECLARED` warning. To delete them as well, pass `--delete-target-only` beside `--allow-delete`; the plan then names each with a `W_PROMOTE_DELETES_TARGET_ONLY` warning, so run it with `--dry-run` first. + +## The target record + +Each promotion records what it left in the target in `.sim/targets/.json`, and the next promotion compares with that record: + +- A resource changed in the target since the last promotion, such as a hotfix made in Sim, is kept when the directory left it alone. +- When the directory changed it too, the promotion is refused as stale and exits `5`. Carry the target's change into the source workspace, or undo it in the target, then promote again. +- A resource deleted in the target since the last promotion stays deleted, with a `W_PROMOTE_TARGET_DELETED` warning. Remove its entry from the record to create it again. +- The first promotion, and any resource the record does not hold (one created in the target since), updates the target to match the directory. Review the dry run first. + +Commit the record with the rest of the directory, so a promotion from CI or another clone compares with it. Don't delete it to get past a stale refusal: without it, the next promotion overwrites every change made in the target since, including rows its workflows wrote. + +## In CI + +To promote after each merge, add the step after the apply to the source workspace and before the step that commits the files back; see [Run in CI](/workflows/code/ci#promote-in-ci). + +## Related docs + +- [Manage a workspace as code](/workflows/code/workspace) +- [Run in CI](/workflows/code/ci) +- [Exit codes](/workflows/code/exit-codes) diff --git a/apps/docs/content/docs/workflows/code/syntax.mdx b/apps/docs/content/docs/workflows/code/syntax.mdx new file mode 100644 index 00000000000..cc3849dc81c --- /dev/null +++ b/apps/docs/content/docs/workflows/code/syntax.mdx @@ -0,0 +1,268 @@ +--- +title: File syntax +description: The TypeScript subset a workflow file accepts, from builders, values, references, wiring, branches, loops and function code. +--- + +A workflow file is a declaration of blocks and connections, not a program. Sim reads it statically and never runs it, so the file holds a fixed set of forms. This page lists them. A form outside it is refused with `E_UNSUPPORTED_SYNTAX` and a hint that names the supported form. The types for every builder are in `.sim/sdk/` after a `get`, and `sim workflows source params ` prints one builder's params. + +## An example + +A webhook receives a ticket, an agent classifies it, billing tickets are logged to a table, and the team hears about every ticket in Slack. This is the file `sim workflows source get` prints for it: + +```ts title="workflow.ts" +// @sim-sdk 1 +import { + agent, + condition, + credential, + env, + js, + slack, + t, + table, + trigger, + workflow, +} from '@sim/workflow-sdk' + +export default workflow( + 'Support triage', + { variables: { escalations: { type: 'number', value: 0 } } }, + () => { + const ticketIn = trigger.webhook('Ticket in', { + requireAuth: true, + token: env.TICKETS_WEBHOOK_TOKEN, + inputFormat: { subject: 'string', body: 'string', contacts: 'array' }, + responseMode: 'custom', + responseStatusCode: 202, + responseBody: { ok: true }, + }) + const classify = agent('Classify', { + messages: [ + { role: 'system', content: 'Classify support tickets.' }, + { + role: 'user', + content: t`${ticketIn.subject} + +${ticketIn.body}`, + }, + ], + model: 'claude-sonnet-5-5', + responseFormat: { + name: 'ticket', + strict: true, + schema: { + type: 'object', + additionalProperties: false, + required: ['category', 'urgent'], + properties: { + category: { type: 'string', enum: ['billing', 'bug', 'other'] }, + urgent: { type: 'boolean' }, + }, + }, + }, + }) + const byCategory = condition('By category', { + billing: js`${classify.category} === 'billing'`, + else: true, + }) + const logTicket = table.insertRow('Log ticket', { + tableId: table('tickets'), + data: { subject: ticketIn.subject, category: classify.category }, + }) + const notify = slack.sendMessage('Notify', { + credential: credential('support-slack'), + channel: 'C0SUPPORT', + text: t`New ${classify.category} ticket (urgent: ${classify.urgent}): ${ticketIn.subject}`, + }) + + ticketIn.to(classify) + classify.to(byCategory) + byCategory.billing.to(logTicket) + byCategory.else.to(notify) + logTicket.to(notify) + logTicket.onError(notify) + } +) +``` + +How to read it: + +- Each `const` is a block. `agent`, `condition`, `table.insertRow`, and `slack.sendMessage` are the blocks you know from the workflow builder, with the same settings. +- `classify.category` is a typed reference to another block's output, the same as `` in the builder. `t` writes text with references in it; `js` writes code. +- `table('tickets')` and `credential('support-slack')` name workspace resources by a stable key. Renaming the table in Sim keeps the key. +- `env.TICKETS_WEBHOOK_TOKEN` reads an environment variable. Secret values are never printed: a key pasted into a password field prints as `stored()`, which keeps the saved value. +- `.to()` connects blocks, `byCategory.billing` is one branch of the condition, and `.onError()` follows the error path. `notify` has three incoming edges and runs once, after the branch that was taken. +- A webhook answers its caller as soon as the request is accepted and runs the workflow in the background, so the caller never sees a `response` block's output. `responseMode: 'custom'` sets that fixed answer (here `202` with `{ "ok": true }`; without it, `200` with `{ "message": "Webhook processed" }`). To answer with values the run computes, start the workflow with `trigger.start` and call it through the API; a `response` block then sets what the caller receives. + +## The file + +```ts +// @sim-sdk 1 +import { agent, t, trigger, workflow } from '@sim/workflow-sdk' + +export default workflow('Name', { description: '…', variables: { /* … */ } }, ({ vars }) => { + const start = trigger.start('Start', { inputFormat: { question: 'string' } }) + const answer = agent('Answer', { model: 'claude-sonnet-5-5', messages: [ /* … */ ] }) + start.to(answer) +}) +``` + +- Line 1 is `// @sim-sdk N`. Without it the file is refused with `E_SDK_HEADER`; a number other than the one the server reads is `E_SDK_MAJOR`. +- Imports are named imports from `'@sim/workflow-sdk'` only. Aliases are allowed. +- The file has exactly one `export default workflow(name, options?, body)` (`E_WORKFLOW_EXPORT`). `options` is `{ description?, variables? }`. `body` is `() => { … }` or `({ vars }) => { … }`. +- Variables are `variables: { : { name?, type, value } }`. `type` is `string`, `number`, `boolean`, `object`, `array` or `plain`, and both `type` and `value` are required; `value` is plain JSON. The key is the variable's key: lowercased, with spaces and dots removed. `name` is written only when it differs, and must normalize to the key (`E_VARIABLE_NAME_MISMATCH`). Read one as `vars.`. +- The body holds block declarations and wiring statements. Helpers, loops, conditionals and imports of your own have no stored form and are refused. Use `loop`, `parallel`, `condition` and `runWorkflow` blocks instead. + +## Blocks + +- `const x = builder('Name', params?, meta?)` declares a block; a bare `builder(…)` statement does too. The builder is the block's dotted path in the catalog: `agent`, `slack.sendMessage`, `table.insertRow`, `trigger.gmail.poller`. An unknown path is `E_UNKNOWN_BUILDER`, with a did-you-mean. Builders under `legacy.` are old block versions a workflow may already hold; do not write new ones. +- `block(type, 'Name', params?, meta?)` writes any block type, including a custom or legacy one that no builder fits. Params are checked against the catalog when it knows the type, and kept as written when it does not. +- A name is a non-empty string literal (`E_NAME_NOT_LITERAL`, `E_EMPTY_NAME`), unique once normalized (`E_DUPLICATE_NAME`), and not `loop`, `parallel` or `variable` (`E_RESERVED_NAME`). A name with a look-alike character, such as a Cyrillic letter inside a Latin word, is `E_LOOKALIKE_NAME`, and one with a bidirectional control or zero-width character is `W_SUSPICIOUS_CHARACTER`. +- `response(name, { body, status?, headers? })` is the Response block. Any other key is `E_UNKNOWN_PARAM`. + +### Params + +- A param is a setting of the block, named as `sim workflows source params ` lists it. For a setting the builder shows as a basic or advanced pair, you write the shared name, not either member. Writing a member by its own name is `E_UNKNOWN_PARAM`, and the hint names the right one. +- An omitted param is the default the workflow builder fills in, so a block with no params is stored like one made in the builder. `null` for a whole param stores it as absent. +- A param the builder already fixes, such as `operation`, is `E_FIXED_PARAM`. +- A param that is not visible under the block's other settings is `W_FIELD_NOT_APPLICABLE`. It never runs, so the apply keeps the stored value and the next `get` leaves the line out. +- A required field left empty, or written as `todo()`, is `W_REQUIRED_MISSING`. A value of the wrong JSON type is `W_VALUE_KIND`; it is never converted. + +### Selecting a resource or typing an ID + +For a field that offers a selector in the builder, a resource helper (`credential('key')`, `table('key')` and the others in the next section) or a non-empty array of them selects the resource. Anything else, such as `channel: 'C0123'`, is the value typed into the field. The kind of value alone decides which one you mean. + +### `meta` + +The optional third argument holds what belongs to the block, not to its settings. + +| Key | Meaning | +| --- | --- | +| `disabled: true` | The block is disabled. | +| `locked: true` | An apply refuses any change to this block. | +| `errorPort: boolean` | Exposes the error port. A block with an `onError` edge has one without this. | +| `retry: { enabled, maxTries, waitBetweenTriesMs }` | The block's retry policy, written whole. `maxTries` is a whole number from 2 to 5 and `waitBetweenTriesMs` from 0 to 5000; anything else is `E_UNSUPPORTED_SYNTAX`. | +| `advancedMode: boolean` | The block's advanced toggle, which changes what it sends. | +| `triggerMode: boolean` | Runs the block as a trigger. Trigger builders set it. | +| `branches: { : { title? } }` | The display title of a condition or router row. | +| `key: ''` | A legacy block key the name cannot produce. A `get` writes it for a stored block that needs it; any other value is `E_KEY_OVERRIDE`. | + +## Values + +- Literals, objects, arrays and negative numbers are written as in TypeScript. A number too large to store is `E_NUMBER_NOT_FINITE`, and one whose digits a number cannot hold is `W_NUMBER_PRECISION`: write it as a string. +- A string is `'…'`, an untagged template without `${}`, or a tagged template: + + | Tag | For | + | --- | --- | + | `` t`…` `` | Text with references or `env.X` in it | + | `` js`…` `` | JavaScript: a condition expression, or function code inline | + | `` py`…` ``, `` sh`…` `` | Python and shell code | + | `` json`…` `` | JSON text kept as written | + | `` md`…` `` | Markdown, such as a note's content | + +### Resource helpers + +A key is the resource's stable key in the workspace; `.sim/sdk/workspace.d.ts` lists them. A key with no live resource is `E_MAT_UNKNOWN_RESOURCE` on apply. + +| Form | Stands for | +| --- | --- | +| `credential('key')` | A saved credential | +| `table('key')` | A workspace table | +| `knowledgeBase('key')` | A knowledge base | +| `file('path')` | A workspace file | +| `folder('key')` | A workspace folder | +| `childWorkflow('key')` | A workflow, for `runWorkflow`; `.asTool()` in a `tools` list | +| `customTool('key')` | A custom tool, in a `tools` list | +| `mcp('key')` | An MCP server; `.tool(name)` in a `tools` list | +| `skill('key')` | A workspace skill | +| `codeFile('./functions/x.js')` | Function code kept in its own file | +| `stored()` | The value already stored for this param, which is not printed | +| `todo()` | No value yet | +| `env.X` | The environment variable `X`, which a block reads as `{{X}}`. The name must match `[A-Za-z_][A-Za-z0-9_]*` (`E_INVALID_ENV_NAME`) | + +In a workspace directory, `sim workspaces source check` reports a key the directory does not declare; see [Manage a workspace as code](/workflows/code/workspace). + +### Secrets and `stored()` + +A secret is never printed. A literal value in a password field prints as `stored()`, which compiles to the value the stored workflow already holds for the same block and param. A new block, another block type or an empty field has nothing stored: `stored()` there is `E_STORED_VALUE_MISSING`. To set a secret, write `env.NAME` and keep the value in the workspace's environment variables. A literal key in the file is `W_LITERAL_SECRET`. + +### References + +- `block.output`, `block['x-y']` and `block.items[0]` read another block's output; they are stored as ``, `` and ``. The path is typed from the block's outputs. A path no output has is `W_UNKNOWN_OUTPUT_PATH`, which the apply refuses as an error on a block the edit changed. +- An agent's declared `responseFormat` fields and a Start, API or Input trigger's declared `inputFormat` fields count as outputs. An input the trigger does not declare, and `x.error` on a block with no error edge, are `W_OUTPUT_PATH_UNDECLARED`: a warning the apply never refuses, because a caller may still pass the input. +- A reference to a block declared later is `W_FORWARD_REF` and still resolves. A reference into a sibling loop or parallel's child is `E_OUT_OF_SCOPE`. An identifier that names nothing is `E_UNKNOWN_IDENTIFIER`, with a did-you-mean. +- `vars.x` reads a workflow variable; an undeclared one is `E_UNKNOWN_VARIABLE`. +- `ref('Raw.path')` writes the reference text `` as you gave it. Hand-written `` text whose head is not a block key is `W_REF_NOT_NORMALIZED`. + +### JSON fields + +A field that holds JSON text, such as `responseFormat`, a table row's `data` or a response body, takes an object or array literal and stores it as formatted JSON. Each bare reference inside is quoted when the output is a string and left bare otherwise, because the run splices a string raw and any other value as JSON. A Function's `result`, or a field of it, has the type its JavaScript certainly returns there (a string literal, `String(…)`, `.toISOString().slice(…)` and the like are text; arithmetic, comparisons and literals are not); a Function `result` or an API `data` whose code or response may be text is untyped unless the code says. A reference no output type is known for is stored bare with `W_JSON_REF_UNTYPED`. A template is a JSON string, which is how a value becomes text on purpose. A resource helper inside the literal is `E_UNSUPPORTED_SYNTAX`. + +### Input formats and tools + +- `inputFormat` is a record: `name: 'string'` declares a string input, and `name: { type, … }` declares one with options. An entry with no type, such as `count: 5`, is refused. +- An agent's `tools` is an array of: + - `slack.tool.sendMessage(params)`: an integration operation, written as the block's namespace, `tool`, and the operation; + - `customTool('key')`: a workspace custom tool; + - `mcp('key').tool('name', { args? })`: one tool of an MCP server, with the arguments the workflow fixes; + - `childWorkflow('key').asTool()`: a child workflow; + - `raw(tool)`: any other stored tool, which a `get` writes when a tool does not fit the forms above. +- A tool's secret prints as `params: { key: stored() }`, resolved like a block's `stored()`. A tool that no rule matches to a stored one is `E_STORED_VALUE_MISSING`, so a deleted or reordered tool never takes another tool's secret. + +## Function code + +Code that does not fit a block goes in a Function block, kept in its own file: + +```ts +const score = fn('Score lead', { code: codeFile('./functions/score-lead.js') }) +``` + +The path is `./functions/.`, relative to `workflow.ts`, and the extension matches the block's `language`: `js` for JavaScript (the default), `py` for Python, `sh` for shell. Any other path is `E_CODE_FILE_PATH`, and a file that was not sent is `E_CODE_FILE_MISSING`. When code cannot be kept in a file, a `get` writes it inline as `` js`…` `` and reports `W_CODE_FILE_INLINED`. + +In a JavaScript file, `$ref.block.path` reads another block's output and `$env.NAME` reads an environment variable. `block` is the block's key: its name lowercased with all whitespace and every `.` removed (`$ref.triageagent.content` for "Triage Agent", `$ref.v2result.text` for "V2. Result"). Inside a loop body, `$ref.loop.currentItem` and `$ref.loop.index` read the iteration's item and position; inside a parallel body, `$ref.parallel.currentItem` and `$ref.parallel.index`. A `$ref` that names no block is refused in a file you edited, because it would not resolve when the workflow runs. Python and shell files are saved as written, so `$ref` and `$env` mean nothing there: read an output as `` (``) and an environment variable as `{{NAME}}`; a `$ref` in one is `W_CODE_FILE_REF_SYNTAX`. + +## Branches + +- A condition's params object lists its rows in order, each a string or template. Write `else: true` last for the empty else. Two or more rows must end with `else` (`E_BRANCH_ELSE_LAST`). +- A router's rows are `routes: { key: text }`. +- A branch key is unique (`E_DUPLICATE_BRANCH_KEY`) and may not be an output name, `to` or `onError` (`E_BRANCH_KEY_COLLIDES`). +- A branch that no edge leaves ends the run on that path; `check` reports it as `W_BRANCH_UNWIRED`. + +## Loops and parallel blocks + +| Form | Runs | +| --- | --- | +| `loop.for('Name', { count }, body)` | `count` times; a loop with no `count` runs 5 | +| `loop.forEach('Name', { collection }, body)` | once per item | +| `loop.while('Name', { condition }, body)` | while the condition holds | +| `loop.doWhile('Name', { condition, count }, body)` | until the condition stops it; with no condition, `count` times | +| `parallel.count('Name', { count, batchSize }, body)` | `count` branches | +| `parallel.collection('Name', { collection, batchSize }, body)` | one branch per item | + +- `body` is `(p) => { … }`, where `p.to(x)` connects the container's start to a block inside it, or `(p) => block(…)`, which does the same for one block. +- `p.index`, `p.currentItem` and `p.items` read the iteration; any other property is `E_UNKNOWN_SUBFLOW_PROPERTY`. They are stored as `` or ``. +- A `count` that is not a whole number of at least 1, or a `batchSize` outside 1 to 20, is `W_SUBFLOW_COUNT`: the run replaces or clamps it. + +## Wiring + +| Form | Connects | +| --- | --- | +| `a.to(b, c)` | `a` to `b` and `a` to `c` | +| `a.to(b).to(c)` | a chain | +| `a.to(b, c).to(d)` | `b` to `d` and `c` to `d` | +| `a.onError(b)` | the error path of `a` | +| `cond.key.to(x)` | one branch of a condition or router | +| `container.to(x)` | what runs after the loop or parallel finishes | + +Refused: `.to()` on a condition or router itself (`E_NO_DEFAULT_OUTPUT`; wire a branch), a branch that does not exist (`E_UNKNOWN_BRANCH`), an edge into a trigger (`E_TARGET_TRIGGER`), `onError` on a block with no error port (`E_ERROR_PORT_UNSUPPORTED`), an edge to or from a note (`E_EDGE_NOTE`), an edge across loop or parallel scopes (`E_EDGE_SCOPE`), a repeated edge (`E_DUPLICATE_EDGE`) and a cycle (`E_EDGE_CYCLE`). Repeat work with a `loop` instead. + +## Comments + +Comments you write are kept and written back where they were. One inside an expression moves to the statement it belongs to (`W_COMMENT_MOVED`). One whose block no longer exists is dropped (`W_COMMENT_DROPPED`). + +## Related docs + +- [Diagnostic codes](/workflows/code/diagnostics) +- [Edit a workflow](/workflows/code/edit) +- [Directory layout](/workflows/code/directory) +- [Limits](/workflows/code/limits) diff --git a/apps/docs/content/docs/workflows/code/troubleshooting.mdx b/apps/docs/content/docs/workflows/code/troubleshooting.mdx new file mode 100644 index 00000000000..5fd2eacde6c --- /dev/null +++ b/apps/docs/content/docs/workflows/code/troubleshooting.mdx @@ -0,0 +1,164 @@ +--- +title: Troubleshooting +description: Fix a failed sim workflows source or sim workspaces source command, by exit code and by diagnostic code. +--- + +Every `sim workflows source` and `sim workspaces source` command reports a failure in two ways: an exit code for the kind of failure, and findings that each name a code, a file, a line and a hint. Find the exit code below first, then the code of the first error it printed. + +Each finding prints as `file:line:column`, with the code around it and a hint. `--output json` puts the same findings in a `diagnostics` array, and a refused write prints an `{error:…}` document on stderr whose `details.code` names the refusal, such as `SOURCE_STALE`. Fix the first error first: later ones often follow from it. + +## By exit code + +[Exit codes](/workflows/code/exit-codes) has the full table. These are the causes behind each code and how to get past them. + +### Exit `1`: errors, or the command failed [#exit-1] + +- **The source has errors.** Fix each one at the line it names. The [diagnostic codes](#by-diagnostic-code) below cover the common ones, and [Diagnostic codes](/workflows/code/diagnostics) lists every code. +- **`check` failed on a warning.** An apply saves some warnings as written, such as a required field left empty, so `check` fails on them in a block you added since the `get`. `sim workflows source check --help` lists them. +- **"No block catalog is cached".** `sim workflows source check` and `params` work from the catalog the last `get` or `create` cached on this machine. Run `get` once, for example on a fresh CI runner. `sim workspaces source check` downloads the catalog itself. +- **A name is taken.** `SOURCE_NAME_TAKEN` on `create`: pass `--name`. `E_NAME_TAKEN` on an apply: another resource of the same kind already has that name, such as another workflow in the folder for the name `workflow('…')` gives, or another skill or custom tool in a workspace directory. +- **`get` refused the directory.** `SOURCE_LOCAL_EDITS` means the directory holds edits no apply has saved: apply them, get into another directory, or pass `--force` to discard them. `SOURCE_WORKFLOW_MISMATCH` means it holds another workflow, and `SOURCE_DIR_KIND_MISMATCH` that it is the other kind of directory, which `--force` never overrides. +- **The directory belongs to another workspace.** `SOURCE_OTHER_WORKSPACE`: a directory acts on the workspace it was read from. Drop `--workspace`, or promote it with `--to`. +- **Binary files were never downloaded.** `SOURCE_BLOBS_NOT_FETCHED`: run `get` again before applying. + +### Exit `5`: stale [#exit-5] + +Someone saved what this directory was read from after you read it, in the workflow builder, through the API, or with another apply. A workflow apply, and a workspace apply refused while planning, writes nothing; a dry run exits `5` the same way. A workspace apply that found a resource changed part-way through its writes has saved the changes before it into the directory, so carry over only the rest. + +1. See what changed in Sim: `sim workflows source diff --dir --server`. +2. Get the current version into a fresh directory: `sim workflows source get --dir `. +3. Carry your edit over, then dry-run and apply from the fresh directory. + +In CI, this happens when an apply rewrote files that were not committed back, or when two branches each applied: commit the files an apply rewrites, as [Run in CI](/workflows/code/ci) does. In a promotion, it means the target changed a resource the directory changed too; carry the target's change into the source workspace, or undo it in the target. + +### Exit `6`: locked [#exit-6] + +The workflow, its folder or a table is locked against changes (`E_APPLY_LOCKED`). Ask someone who can to unlock it in Sim. A locked block inside an unlocked workflow exits `1` instead, with `E_APPLY_LOCKED_BLOCK`. + +### Exit `7`: over a limit [#exit-7] + +The workflow or directory is larger than one get or apply may handle, and the finding names each measured size. Split a large workflow into a parent and a child workflow, or apply a workspace in parts with `--only`. The numbers are in [Limits](/workflows/code/limits). + +### Exit `8`: a workspace apply stopped part-way [#exit-8] + +A write failed on the server after earlier writes were saved. The CLI saved what was written into the directory and printed the plan with each change marked written or not written. Run the same apply again until it exits `0`; it continues where it stopped. + +### Exit `9`: rate limited [#exit-9] + +The API still answered `429` after the CLI's retries, and nothing more was written. Wait a minute and run the same command again. In CI, avoid several jobs applying at once with a `concurrency` key. + +### Exit `10`: busy [#exit-10] + +- `SOURCE_BUSY`: another apply is writing the same workspace. Run yours again once it finished. +- `SOURCE_DIR_BUSY`: another `sim` command is using this directory, or the workspace directory it is a folder of. The CLI holds `.sim/command.lock/` while a command runs, and takes it over once the process holding it has gone, so run the command again. + +Nothing was read or written either way. + +### Exit `11`: your edits are not applied [#exit-11] + +Only `status` exits `11`, and it is not a failure: the directory holds edits that applying would write. Dry-run, then apply. In a scheduled CI check, `11` usually means a merge whose apply failed. + +### Exit `12`: Sim changed since the get [#exit-12] + +Only `status` exits `12`. Follow its `Next:` line: + +- **Drift**, Sim changed and the directory did not: `get` into the same directory brings it up to date. Commit the result. +- **A conflict**, both changed the same workflow or resource: an apply would be refused as stale. Get into a fresh directory and carry your edit over, as for [exit `5`](#exit-5). + +### Exit `13`: not signed in [#exit-13] + +No login, an expired login, or a credential the server refused (`AUTH_REQUIRED`). Run `sim login`, or fix or unset `SIM_API_KEY` when the key comes from it, then run the same command again. See [Authentication](/cli/authentication). + +### Exit `14`: apply without `--yes` [#exit-14] + +`apply` or `create` found no errors, printed the plan, and wrote nothing, because there was no terminal to confirm in. Run the same command with `--yes`. + +### Exit `15`: changes held back [#exit-15] + +A workspace apply wrote what it could and held back each change that uses a secret the workspace has no value for (`E_SECRET_MISSING`) or a credential key no credential binds to (`E_CREDENTIAL_MISSING`, `E_CREDENTIAL_AMBIGUOUS`). Set the secret with `sim secrets set NAME --scope workspace`, or connect the credential, then apply again. A dry run exits `15` too, so a script can find out first. + +### Exit `130`: interrupted [#exit-130] + +Ctrl-C. If the CLI says a write may have happened, `status` shows whether it did. + +## A command answers `403` [#forbidden] + +- **"Workflows as code is in preview and not enabled for this workspace".** The feature is off for this workspace; see [Workflows as code](/workflows/code) for how it is enabled. +- **A workspace API key.** Saving a workflow acts as a person, so it needs a personal API key or an OAuth login. In a workspace directory, a workspace key can apply only some kinds and the rest are refused with `E_APPLY_FORBIDDEN`; see [Workspace API keys](/workflows/code/workspace#workspace-api-keys). + +## By diagnostic code + +### `E_UNSUPPORTED_SYNTAX` [#e-unsupported-syntax] + +The file holds a form Sim cannot read without running it, such as a helper function, an `if`, a loop that creates blocks, or an import from anything but `@sim/workflow-sdk`. Write each block as its own `const`, use `loop()`, `parallel()`, `condition` or `router` blocks for control flow, and put logic inside function code. The hint names the supported form; [File syntax](/workflows/code/syntax) lists them all. + +### `E_UNKNOWN_BUILDER` and `E_UNKNOWN_PARAM` [#e-unknown-param] + +A builder or param name the block catalog does not have. The hint suggests the closest name. `sim workflows source params ` prints a builder's params and outputs, and a namespace such as `gmail` lists its builders. + +### `E_TYPE` and `W_TYPES_UNCHECKED` [#e-type] + +`E_TYPE` is a type error `check` found after the compile; its message starts with TypeScript's own code, such as `TS2339: Property 'emial' does not exist`. Fix it at the line it names: it usually reads an output or input the block does not declare, or passes a value of the wrong type. `W_TYPES_UNCHECKED` means the type check did not run, most often because the first `check` on this machine could not install TypeScript offline. The compile's findings still stand; run `check` once with network access, or pass `--no-types`. + +### `W_REQUIRED_MISSING` [#w-required-missing] + +A required field is empty, or holds `todo()`. Fill it in, or use `env.NAME` for a value you keep in an environment variable. + +### `E_APPLY_UNRESOLVED_REF` [#e-apply-unresolved-ref] + +A reference names a block that does not exist, or an output path the block does not have. In `workflow.ts`, read an output through the block's `const`, as in `triage.content`. In function code, `$ref.` uses the block key: the display name lowercased with whitespace and dots removed. The hint lists the outputs the block has. + +### `E_MAT_UNKNOWN_RESOURCE` [#e-mat-unknown-resource] + +A resource helper, such as `table('orders')` or `credential('support-slack')`, names a key no live resource has. Keys are exact. `sim workflows source resources` lists the keys of your workspace; in a workspace directory, a key is the resource's file or folder name, and `check` lists the declared ones. + +### `E_APPLY_BLOCK_DELETE` and `W_MAT_INFERRED_RENAME` [#e-apply-block-delete] + +The save would delete blocks: a stored block no longer matches any block in the file. If you meant to delete them, apply again with `--allow-delete`; a deleted block's webhook URL, schedules and run history go with it. + +If you meant a rename, keep the `.sim/` folder, change the display name and keep the `const` name, or the other way round, and apply that before the next rename. When the file adds a block of the deleted one's type, the finding names it as a possible rename and says how to keep the ID. A rename Sim inferred from type, position and connections is reported as `W_MAT_INFERRED_RENAME`: check the plan names the block you meant. `E_APPLY_VARIABLE_DELETE` is the same for workflow variables. + +### `E_APPLY_LOCKED_BLOCK` [#e-apply-locked-block] + +The change touches a locked block, or a block inside a locked loop or parallel. Nobody can change it from the file. Unlock it in the workflow builder, or leave it as it is. + +### `E_APPLY_NO_BASE` [#e-apply-no-base] + +A declaration in a workspace directory matches a resource Sim holds that the directory never read, such as a table someone made in Sim under the same name. The apply may only add to such a resource. Run `get` into a new directory to read it, then make your edit there, or give the declaration another name. + +### `E_KEY_RENAMED` [#e-key-renamed] + +A resource file or folder in a workspace directory was renamed. Keys never change: move it back to its key, and change the resource's `name` inside the file instead. + +### `E_APPLY_FORBIDDEN` [#e-apply-forbidden] + +Your role in the workspace, or a workspace API key, does not allow the change. The finding names each resource. Use a personal API key or an OAuth login with the role the change needs, or narrow the apply with `--only`. + +### `E_EDGE_CYCLE` [#e-edge-cycle] + +The wiring closes a cycle, so no block on it would ever run. Remove the edge the finding points at, and repeat work with `loop()` instead. + +### `E_STORED_VALUE_MISSING` [#e-stored-value-missing] + +`stored()` stands for a saved value, such as a secret, that `get` does not print. A workflow created from a copy has no saved value to keep. Replace `stored()` with `env.NAME` or the value. + +### `W_APPLY_CATALOG_MOVED` [#w-apply-catalog-moved] + +The compile failed, and the block catalog changed since you read the workflow, for example because a block gained a setting. Run `get` again to update the types, then reapply your edit. + +### `W_APPLY_TRIGGER_REMOVED` [#w-apply-trigger-removed] + +You deleted or retyped a block that serves a live webhook, schedule, chat or MCP tool. The deployed version keeps serving it until the next deploy. Deploy when the change should take effect, and update whatever called the old webhook URL. + +## Other problems + +- **The builder does not show a change.** An apply saves the draft. The builder shows it at once, but runs of the deployed version do not change until you deploy. +- **The Code tab is missing.** Workflows as code is not enabled for the workspace; see [Workflows as code](/workflows/code). + +## Related docs + +- [Exit codes](/workflows/code/exit-codes) +- [Diagnostic codes](/workflows/code/diagnostics) +- [Limits](/workflows/code/limits) +- [How it works](/workflows/code/how-it-works) +- [CLI troubleshooting](/cli/troubleshooting) diff --git a/apps/docs/content/docs/workflows/code/workspace.mdx b/apps/docs/content/docs/workflows/code/workspace.mdx new file mode 100644 index 00000000000..3a525475ee7 --- /dev/null +++ b/apps/docs/content/docs/workflows/code/workspace.mdx @@ -0,0 +1,88 @@ +--- +title: Manage a workspace as code +description: Keep a workspace's tables, knowledge bases, files, custom tools, skills and workflows in one directory, and apply it in one step. +--- + +import { Callout } from '@/components/ui/callout' + +A whole workspace can be read and written as a directory: one folder per kind of resource, with each workflow written exactly as [workflows as code](/workflows/code) writes it. One apply creates the resources before the workflows that use them, so a coding agent can build a working setup from scratch. + + +Workspace as code is in preview, behind the [same setting](/workflows/code) as workflows as code. It adds the `sim workspaces source` commands to the [CLI](/cli/workspaces#workspace-as-code). + + +## The directory + +The layout of every kind and each file's role is in [Directory layout](/workflows/code/directory). A resource's key is its file or folder name, and a workflow names it by that key: + +```ts title="workflows/support/workflow.ts" +const policy = knowledge.search('Policy Search', { + knowledgeBaseId: knowledgeBase('policies'), + query: start.question, +}) +const answer = agent('Answer', { + model: 'claude-sonnet-4-6', + messages: [{ role: 'user', content: t`${policy.results}\n\n${start.question}` }], + tools: [customTool('lookup-order')], + skills: [skill('tone')], +}) +const log = table.insertRow('Log Question', { + tableId: table('orders'), + data: { orderId: start.orderId, status: 'answered' }, +}) +``` + +`get` writes a short primer for coding agents atop `.sim/AGENTS.md`, the guide, with deletes in depth, Git and CI, and promoting to another workspace in `.sim/GUIDE-advanced.md`. It also writes `.sim/examples/workspace/`, a complete example of every kind and the workflow that uses them. + +## Edit a workspace + +```bash +sim workspaces source get --dir ./my-workspace +sim workspaces source check --dir ./my-workspace +sim workspaces source status --dir ./my-workspace +sim workspaces source apply --dir ./my-workspace --dry-run +sim workspaces source apply --dir ./my-workspace --yes +``` + +`check` compiles every workflow on your machine against what the directory declares: an unknown table, credential, knowledge base, skill, custom tool, MCP server or workflow key, a table row write naming a column the table does not declare, and a child workflow call whose `inputMapping` names an input the child's Start trigger does not declare, are reported, and an env name `secrets.ts` lacks is a warning. It checks each `tables/.rows.jsonl` line against its table the way an apply writes it (a required cell, a unique value, a column's type and select options), so the dry run's `E_TABLE_ROWS` shows up offline at its line. It exits 1 on errors and, as `sim workflows source check` does, on a broken block you added. + +Unlike a workflow directory's `check`, it needs the block catalog but fetches it for you: on a fresh clone with none cached it downloads the catalog once with the profile's credentials, and without credentials it exits `1` and tells you to run `get`. It also regenerates `.sim/sdk/workspace.d.ts` from the declarations and then type-checks every file, so a table, workflow or other key the directory declares since the get is typed in the same check. Run in a `workflows/` folder, `sim workflows source check --dir .` checks that one workflow the same way. + +The dry run prints the plan (`+` create, `~` update, `=` adopt an existing resource with the same name, `-` delete) and every error with its file and line. `--only tables,workflows` limits a get or an apply to some kinds. + +An apply adopts a resource it never read (one made in Sim under the name a new declaration gives) only when the declaration matches it, or only adds to it: a column, rows into an empty table, a document. An adopt that would change or remove anything the resource holds is refused with `E_APPLY_NO_BASE`, even with `--allow-delete`. Run `get` into a new directory to read the resource, then make your edit there, or give the declaration another name. + +`status` shows what would happen if you applied, without writing anything: the files you created, edited, or deleted, grouped by resource; what changed in Sim since the `get` (a resource edited, added, or deleted there, a workflow edited in the workflow builder included); the conflicts, where a resource changed on both sides; and the one command to run next. It exits `0` when nothing changed, `11` when only your edits are unapplied, and `12` when something changed in Sim since the `get`, so a script or an agent can branch on it. Its JSON `plan` counts errors and warnings as the dry run of the apply it names next would, a conflict as an error. Without a connection it shows your edits only and says so; `--offline` skips the server. `diff [paths or kind:key…]` prints the edits as unified diffs (a binary file by its sizes), and `diff --server` compares the directory with what Sim holds now. Both take `--json` (or `--output json`). + +## Workspace API keys [#workspace-api-keys] + +A personal API key or an OAuth login can apply every kind its workspace role allows. A workspace API key cannot create or change workflows, skills, secrets or deployments. An apply with one that would is refused with `E_APPLY_FORBIDDEN`, naming each resource, before anything is written. A `get` with a workspace key leaves out the kinds it cannot read, such as `secrets.ts`, and names them with the same code. + +To apply the rest with a workspace key, such as in CI, narrow the apply to the kinds it can write: `sim workspaces source apply --dir ./my-workspace --only tables,knowledge,files,tools,mcp,credentials.ts --yes`. Deployments need an admin's personal key. + +## Deletes + +- A kind is managed only when its folder exists. A directory without `skills/` never touches a skill. +- Removing the file of a resource the directory manages deletes it only with `--allow-delete`; without the flag the apply is refused. The flag also covers a removed table column, managed table row, knowledge base document, workspace file, workflow block or workflow variable. +- A resource the directory never managed is kept, and the apply names it in a warning. +- Something deleted in Sim is not re-created by an unchanged directory, and an edit to it is refused as stale. +- Table rows are part of the directory only when the table's `rows` opts in (`tables/.rows.jsonl`). Connector-synced documents and run history never are. +- Seed rows (`rows: { mode: 'seed' }`) belong to the directory: `get` keeps the declaration and the rows file beside it, but Sim does not store them, so a get into a new directory has the declaration without the file. +- A delete cannot be undone by applying an older copy of the directory, such as a reverted commit. The resource stays deleted, and its rows, documents, run history, webhook URLs and schedules are gone. The dry run marks each change that deletes data and counts them as `destructive`, a workflow update that removes blocks or variables included. + +## Good to know + +- Secret values never appear. Workflows read environment variables as `env.NAME`, tool code as `$env.NAME`, and credentials by key. +- Renaming a skill does not rewrite the workflows that use it: each agent keeps the name it stored until its skills list is next edited. +- Hidden files (a name starting with a dot, such as `files/.env`) and names with a character no workspace path holds (such as `:` or `?`) are never sent. An apply names each one in a `W_PATH_NOT_SENT` warning. +- A knowledge base's `embeddingModel` is fixed when it is created. An apply that changes it is refused. +- An apply that stops part-way exits `8`, prints the plan again with each change marked written or not written (`notWritten` in JSON), and saves what it wrote into the directory. Run the same apply again until it exits `0`. The dry run checks an MCP server's URL as the write does, so an unresolvable host is refused before anything is written. +- An apply exits `5` when a resource changed in Sim after you read it. Run `get` into a new directory and reapply your edit. +- Size caps, and what is left out of a get, are in [Limits](/workflows/code/limits). + +## Related docs + +- [Promote to another workspace](/workflows/code/promote) +- [Run in CI](/workflows/code/ci) +- [Directory layout](/workflows/code/directory) +- [CLI workspace commands](/cli/workspaces#workspace-as-code) diff --git a/apps/docs/content/docs/workflows/meta.json b/apps/docs/content/docs/workflows/meta.json index 8762490d5cb..bfbd3c07fdc 100644 --- a/apps/docs/content/docs/workflows/meta.json +++ b/apps/docs/content/docs/workflows/meta.json @@ -6,8 +6,6 @@ "connections", "variables", "large-data", - "code", - "workspace-code", "deployment", "triggers", "blocks" diff --git a/apps/docs/content/docs/workflows/workspace-code.mdx b/apps/docs/content/docs/workflows/workspace-code.mdx deleted file mode 100644 index e75a9f22189..00000000000 --- a/apps/docs/content/docs/workflows/workspace-code.mdx +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: Workspace as code -description: Keep a workspace's tables, knowledge bases, files, custom tools, skills and workflows in one directory, and apply it in one step. ---- - -import { Callout } from '@/components/ui/callout' - -A whole workspace can be read and written as a directory: one folder per kind of resource, with each workflow written exactly as [workflows as code](/workflows/code) writes it. One apply creates the resources before the workflows that use them, so a coding agent can build a working setup from scratch. - - -Workspace as code is in preview, behind the [same setting](/platform/self-hosting/environment-variables#preview-features) as workflows as code. It adds the `sim workspaces source` commands to the [CLI](/cli/workspaces). - - -## The directory - -``` -secrets.ts the env variable names workflows read (never a value) -credentials.ts the saved credentials workflows use, by provider -tables/orders.ts a table: name, description, columns -tables/plans.rows.jsonl a table's rows, one JSON object per line (only when the table opts in) -knowledge/policies/knowledge.ts a knowledge base: name, chunking -knowledge/policies/docs/*.md one file per document -files/templates/reply.md a workspace file, at its folder path -tools/lookup-order.ts a custom tool: title and schema -tools/lookup-order.js the tool's code -skills/tone.md a skill: name and description, then its content -mcp/docs.ts an MCP server: url, headers -workflows/support/workflow.ts a workflow source directory -deployments/support.ts how workflows/support is deployed -``` - -A resource's key is its file or folder name, and a workflow names it by that key: - -```ts title="workflows/support/workflow.ts" -const policy = knowledge.search('Policy Search', { - knowledgeBaseId: knowledgeBase('policies'), - query: start.question, -}) -const answer = agent('Answer', { - model: 'claude-sonnet-4-6', - messages: [{ role: 'user', content: t`${policy.results}\n\n${start.question}` }], - tools: [customTool('lookup-order')], - skills: [skill('tone')], -}) -const log = table.insertRow('Log Question', { - tableId: table('orders'), - data: { orderId: start.orderId, status: 'answered' }, -}) -``` - -`get` prints a short primer for coding agents (in JSON output, its `primer` field) and writes it atop `.sim/AGENTS.md`, the guide, with deletes in depth, Git and CI, and promoting to another workspace in `.sim/GUIDE-advanced.md`. It also writes `.sim/examples/workspace/`, a complete example of every kind and the workflow that uses them. - -## Edit a workspace from the CLI - -```bash -sim workspaces source get --dir ./my-workspace -sim workspaces source check --dir ./my-workspace -sim workspaces source status --dir ./my-workspace -sim workspaces source apply --dir ./my-workspace --dry-run -sim workspaces source apply --dir ./my-workspace --yes -``` - -`check` compiles every workflow on your machine, without a request, against what the directory declares: an unknown table, credential, knowledge base, skill, custom tool, MCP server or workflow key, a table row write naming a column the table does not declare, and a child workflow call whose `inputMapping` names an input the child's Start trigger does not declare, are reported, and an env name `secrets.ts` lacks is a warning. It checks each `tables/.rows.jsonl` line against its table the way an apply writes it (a required cell, a unique value, a column's type and select options), so the dry run's `E_TABLE_ROWS` shows up offline at its line. It exits 1 on errors and, as `sim workflows source check` does, on a broken block you added. It also regenerates `.sim/sdk/workspace.d.ts` from the declarations, so run `bunx -p typescript@7.0.2 tsc -p ./my-workspace` after it to type-check every file, keys added since the get included. Run in a `workflows/` folder, `sim workflows source check --dir .` checks that one workflow the same way. - -The dry run prints the plan (`+` create, `~` update, `=` adopt an existing resource with the same name, `-` delete) and every error with its file and line. `--only tables,workflows` limits a get or an apply to some kinds. - -An apply adopts a resource it never read (one made in Sim under the name a new declaration gives) only when the declaration matches it, or only adds to it: a column, rows into an empty table, a document. An adopt that would change or remove anything the resource holds is refused with `E_APPLY_NO_BASE`, even with `--allow-delete`. Run `get` into a new directory to read the resource, then make your edit there, or give the declaration another name. - -`status` shows what would happen if you applied, without writing anything: the files you created, edited, or deleted, grouped by resource; what changed in Sim since the `get` (a resource edited, added, or deleted there, a workflow edited in the editor included); the conflicts, where a resource changed on both sides; and the one command to run next. It exits `0` when nothing changed, `11` when only your edits are unapplied, and `12` when something changed in Sim since the `get`, so a script or an agent can branch on it. Its JSON `plan` counts errors and warnings as the dry run of the apply it names next would, a conflict as an error. Without a connection it shows your edits only and says so; `--offline` skips the server. `diff [paths or kind:key…]` prints the edits as unified diffs (a binary file by its sizes), and `diff --server` compares the directory with what Sim holds now. Both take `--json` (or `--output json`). - -## Workspace API keys [#workspace-api-keys] - -A personal API key or an OAuth login can apply every kind its workspace role allows. A workspace API key cannot create or change workflows, skills, secrets or deployments. An apply with one that would is refused with `E_APPLY_FORBIDDEN`, naming each resource, before anything is written. A `get` with a workspace key leaves out the kinds it cannot read, such as `secrets.ts`, and names them with the same code. - -To apply the rest with a workspace key, such as in CI, narrow the apply to the kinds it can write: `sim workspaces source apply --dir ./my-workspace --only tables,knowledge,files,tools,mcp --yes`. - -## Deletes - -- A kind is managed only when its folder exists. A directory without `skills/` never touches a skill. -- Removing the file of a resource the directory manages deletes it only with `--allow-delete`; without the flag the apply is refused. The flag also covers a removed table column, managed table row, knowledge base document, workspace file, workflow block or workflow variable. -- A resource the directory never managed is kept, and the apply names it in a warning. -- Something deleted in Sim is not re-created by an unchanged directory, and an edit to it is refused as stale. -- Table rows are part of the directory only when the table's `rows` opts in (`tables/.rows.jsonl`). Connector-synced documents and run history never are. -- Seed rows (`rows: { mode: 'seed' }`) belong to the directory: `get` keeps the declaration and the rows file beside it, but Sim does not store them, so a get into a new directory has the declaration without the file. -- A delete cannot be undone by applying an older copy of the directory, such as a reverted commit. The resource stays deleted, and its rows, documents, run history, webhook URLs and schedules are gone. The dry run marks each change that deletes data and counts them as `destructive`, a workflow update that removes blocks or variables included. - -## Promote to another workspace - -Apply a directory read from one workspace (dev) to another (prod) with `--to`: - -```bash -sim workspaces source apply --dir ./my-workspace --to "$PROD_WORKSPACE_ID" --dry-run -sim workspaces source apply --dir ./my-workspace --to "$PROD_WORKSPACE_ID" --yes -``` - -Each resource binds by key to the target's own. One the target holds under the same key is updated in place, so a workflow keeps its id and its webhook URLs. A key the target lacks is created. Secrets and credentials bind by name to the target's own, and no value is copied. A resource you deleted from the directory since the last promotion is deleted in the target too, and like any delete it needs `--allow-delete`. Resources only the target holds, such as a table created in prod and the rows its runs wrote, are kept, with or without `--allow-delete`: the plan names each with a `W_UNDECLARED` warning. To delete them as well, pass `--delete-target-only` beside `--allow-delete`; the plan then names each with a `W_PROMOTE_DELETES_TARGET_ONLY` warning, so run it with `--dry-run` first. The directory stays bound to the workspace it was read from. Without `--to`, `check`, `status`, `diff` and `apply` act on the workspace the directory was read from, whatever your default workspace; a `--workspace` naming another one is refused. - -Each promotion records what it left in the target in `.sim/targets/.json`, and the next promotion compares with that record: - -- A resource changed in the target since the last promotion, such as a hotfix made in Sim, is kept when the directory left it alone. -- When the directory changed it too, the promotion is refused as stale and exits `5`. Carry the target's change into the source workspace, or undo it in the target, then promote again. -- A resource deleted in the target since the last promotion stays deleted, with a `W_PROMOTE_TARGET_DELETED` warning. Remove its entry from the record to create it again. -- The first promotion, and any resource the record does not hold (one created in the target since), updates the target to match the directory. Review the dry run first. - -Commit the record with the rest of the directory, so a promotion from CI or another clone compares with it. Don't delete it to get past a stale refusal: without it, the next promotion overwrites every change made in the target since, including rows its workflows wrote. - -## Git and CI - -Commit the whole directory, including `.sim/`: its base files are what an apply compares with, from any clone. The generated `.gitignore` leaves out only temporary files. A fresh clone can run `check`, `apply --dry-run` and `apply` with nothing else. See [Workspace source in CI](/cli/scripting#workspace-source-in-ci) for a GitHub Actions setup. - -In a git repository, `apply` sends the commit checked out (`HEAD`) and the `origin` remote URL, with any credentials, query or fragment removed, as `provenance.gitSha` and `provenance.repo`, each only when `git` can read it (a repository with no `origin` sends only the commit). An apply that writes records what was sent in its `workspace.updated` [audit log](/platform/enterprise/audit-logs) entry. A directory outside a repository sends neither. - -## Good to know - -- Secret values never appear. Workflows read environment variables as `env.NAME`, tool code as `$env.NAME`, and credentials by key. -- Renaming a skill does not rewrite the workflows that use it: each agent keeps the name it stored until its skills list is next edited. -- One apply sends at most 100 edited workflows and makes at most 1,000 changes; a directory holds at most 500 resources of a kind, and a `tables/.rows.jsonl` at most 10,000 rows. An apply over a limit is refused before anything is written. -- A document or file over 10 MB, or whose name a directory cannot hold, is left out of `get` and listed in `.sim/skipped.json`. An apply never writes or deletes it. -- Hidden files (a name starting with a dot, such as `files/.env`) and names with a character no workspace path holds (such as `:` or `?`) are never sent. An apply names each one in a `W_PATH_NOT_SENT` warning. -- A knowledge base's `embeddingModel` is fixed when it is created. An apply that changes it is refused. -- An apply that stops part-way exits `8`, prints the plan again with each change marked written or not written (`notWritten` in JSON), and saves what it wrote into the directory. Run the same apply again until it exits `0`. The dry run checks an MCP server's URL as the write does, so an unresolvable host is refused before anything is written. -- An apply exits `5` when a resource changed in Sim after you read it. Run `get` into a new directory and reapply your edit. - -See [CLI workspace commands](/cli/workspaces) for every flag. diff --git a/apps/docs/lib/redirects.ts b/apps/docs/lib/redirects.ts index be04cce4921..cbc6cc8008f 100644 --- a/apps/docs/lib/redirects.ts +++ b/apps/docs/lib/redirects.ts @@ -110,6 +110,12 @@ const PATH_REDIRECTS: DocsRedirect[] = [ { source: '/building-agents/agents', destination: '/agents', permanent: true }, // form deployment removed { source: '/deployment/form', destination: '/workflows/deployment', permanent: true }, + // workspace as code moved into the workflows-as-code section + { + source: '/workflows/workspace-code', + destination: '/workflows/code/workspace', + permanent: true, + }, // copilot deprecated and removed { source: '/copilot', destination: '/chat', permanent: true }, { source: '/copilot/:path*', destination: '/chat', permanent: true }, diff --git a/apps/docs/openapi-v2-logs.json b/apps/docs/openapi-v2-logs.json index 69ab7abd928..046b37bb072 100644 --- a/apps/docs/openapi-v2-logs.json +++ b/apps/docs/openapi-v2-logs.json @@ -479,6 +479,7 @@ "startedAt": "2026-01-15T10:30:00.000Z", "endedAt": "2026-01-15T10:30:01.250Z", "totalDurationMs": 1250, + "failure": null, "files": [ { "id": "f1c3a7d0-4b52-4a8e-9f61-2d7c8b3e5a04", @@ -1653,6 +1654,55 @@ ], "description": "Total execution duration in milliseconds, or null while unavailable." }, + "failure": { + "anyOf": [ + { + "type": "object", + "properties": { + "blockId": { + "type": "string", + "description": "Identifier of the block the run failed in." + }, + "blockName": { + "type": "string", + "description": "Name of the block the run failed in." + }, + "blockType": { + "type": "string", + "description": "Type of the block the run failed in." + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The error the block recorded, or null when its span carries none (a withheld or compacted trace). A Function block's error leads with the line and code that threw." + }, + "errorMessage": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The failed block's declared `errorMessage` output (Function blocks today): the thrown message alone, which is the text to reply with. Null for any other block." + } + }, + "required": ["blockId", "blockName", "blockType", "error", "errorMessage"], + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "Where the run failed, read from the trace: the innermost block whose error nothing handled. Null when the run did not fail, or the trace does not name one (not recorded, compacted, or withheld by a permission group)." + }, "files": { "anyOf": [ { @@ -1913,6 +1963,7 @@ "startedAt", "endedAt", "totalDurationMs", + "failure", "files", "executedByEmail", "workflow", @@ -1951,6 +2002,7 @@ "startedAt": "2026-01-15T10:30:00.000Z", "endedAt": "2026-01-15T10:30:01.250Z", "totalDurationMs": 1250, + "failure": null, "files": [ { "id": "f1c3a7d0-4b52-4a8e-9f61-2d7c8b3e5a04", diff --git a/apps/docs/openapi-v2-resources.json b/apps/docs/openapi-v2-resources.json index 09319939460..a62bb01b2a7 100644 --- a/apps/docs/openapi-v2-resources.json +++ b/apps/docs/openapi-v2-resources.json @@ -22253,11 +22253,47 @@ "properties": { "type": { "type": "string", - "description": "Value type of the output." + "description": "Value type of the output field." }, "description": { - "description": "What the output holds.", + "description": "What the field holds.", "type": "string" + }, + "properties": { + "description": "Members of an object-typed output, keyed by field name.", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "description": "Nested output field, in this same shape." + } + }, + "items": { + "description": "Element shape of an array-typed output.", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Element value type." + }, + "description": { + "description": "What an element holds.", + "type": "string" + }, + "properties": { + "description": "Members of an object-typed element, keyed by field name.", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "description": "Nested output field, in this same shape." + } + } + }, + "required": ["type"], + "additionalProperties": false } }, "required": ["type"], @@ -22381,11 +22417,47 @@ "properties": { "type": { "type": "string", - "description": "Value type of the output." + "description": "Value type of the output field." }, "description": { - "description": "What the output holds.", + "description": "What the field holds.", "type": "string" + }, + "properties": { + "description": "Members of an object-typed output, keyed by field name.", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "description": "Nested output field, in this same shape." + } + }, + "items": { + "description": "Element shape of an array-typed output.", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Element value type." + }, + "description": { + "description": "What an element holds.", + "type": "string" + }, + "properties": { + "description": "Members of an object-typed element, keyed by field name.", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "description": "Nested output field, in this same shape." + } + } + }, + "required": ["type"], + "additionalProperties": false } }, "required": ["type"], @@ -32795,6 +32867,11 @@ "description": "Hidden from the output picker.", "type": "boolean" }, + "mayBeText": { + "description": "A `json` or `any` output whose value can still be text at run time.", + "type": "boolean", + "const": true + }, "properties": { "description": "Nested outputs by name, each of this same shape.", "type": "object", @@ -32872,6 +32949,13 @@ "required": ["source", "param"], "additionalProperties": false }, + "errorOutputs": { + "description": "Text outputs the block writes only when it fails into an error edge, beside `error`.", + "type": "array", + "items": { + "type": "string" + } + }, "graph": { "type": "object", "properties": { @@ -33831,6 +33915,11 @@ "description": "Hidden from the output picker.", "type": "boolean" }, + "mayBeText": { + "description": "A `json` or `any` output whose value can still be text at run time.", + "type": "boolean", + "const": true + }, "properties": { "description": "Nested outputs by name, each of this same shape.", "type": "object", @@ -34690,6 +34779,11 @@ "description": "Hidden from the output picker.", "type": "boolean" }, + "mayBeText": { + "description": "A `json` or `any` output whose value can still be text at run time.", + "type": "boolean", + "const": true + }, "properties": { "description": "Nested outputs by name, each of this same shape.", "type": "object", diff --git a/apps/docs/openapi-v2-tables.json b/apps/docs/openapi-v2-tables.json index e07534290df..3af6153b675 100644 --- a/apps/docs/openapi-v2-tables.json +++ b/apps/docs/openapi-v2-tables.json @@ -6422,7 +6422,7 @@ }, "required": ["columns"], "additionalProperties": false, - "description": "Initial table column definitions." + "description": "Initial table column definitions: {\"columns\":[{\"name\":\"email\",\"type\":\"string\"}]}. A column's type is one of string, number, currency, boolean, date, json, select; a select column also takes options." }, "folderPath": { "description": "Folder in which to create the table.", @@ -6701,7 +6701,7 @@ }, "required": ["name", "type"], "additionalProperties": false, - "description": "Column definition to add." + "description": "Column definition to add: {\"name\":\"status\",\"type\":\"string\"}. A column's type is one of string, number, currency, boolean, date, json, select; a select column also takes options." } }, "required": ["workspaceId", "column"], diff --git a/apps/docs/openapi-v2-workflows.json b/apps/docs/openapi-v2-workflows.json index 51d4c8b04ff..1ee288774cb 100644 --- a/apps/docs/openapi-v2-workflows.json +++ b/apps/docs/openapi-v2-workflows.json @@ -4394,6 +4394,7 @@ "startedAt": "2026-08-09T18:04:10.000Z", "endedAt": "2026-08-09T18:04:11.000Z", "durationMs": 1000, + "paused": null, "executionTimeoutSeconds": 3000 } } @@ -5131,7 +5132,7 @@ "post": { "operationId": "resumeWorkflowRunV2", "summary": "Resume workflow run", - "description": "Resume one human-in-the-loop pause with workspace write access, naming a `contextId` from the run's `paused.points`. The resumed attempt receives a new run ID and returns a synchronous result or queue receipt. A run that originally streamed resumes asynchronously through v2; this endpoint returns no SSE stream.\n\nOAuth scope: `api:write`.", + "description": "Resume one human-in-the-loop pause with workspace write access, naming a `contextId` from the run's `paused.points`. The resumed attempt receives a new run ID and returns a synchronous result or queue receipt; when it pauses again, `paused.runId` names the run to resume next. A run that originally streamed resumes asynchronously through v2; this endpoint returns no SSE stream.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.runs.resume", "x-oauth-scope": "api:write", "tags": ["Workflow Runs"], @@ -5229,7 +5230,8 @@ "error": null, "startedAt": "2026-08-09T18:04:10.000Z", "endedAt": "2026-08-09T18:04:11.000Z", - "durationMs": 1000 + "durationMs": 1000, + "paused": null } } } @@ -6736,7 +6738,7 @@ { "key": "lookup-order", "id": "ctl_2b8d6f03", - "name": "lookup_order" + "name": "Lookup order" } ], "mcpServers": [ @@ -17275,6 +17277,50 @@ } ], "description": "Execution timeout applied to this run, in seconds: the plan's timeout, lowered by `executionTimeoutSeconds` when one was requested. Null when the run has no execution timeout." + }, + "paused": { + "anyOf": [ + { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "Run to name in Resume workflow run: the run this pause is recorded under, which for a resumed run that paused again is the run it resumed." + }, + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "contextId": { + "type": "string", + "description": "Pause context to name in `contextId` when resuming this point." + }, + "kind": { + "type": "string", + "enum": ["human", "time"], + "description": "`human` waits for a resume request; `time` resumes automatically at `resumeAt`." + }, + "status": { + "type": "string", + "enum": ["paused", "queued", "resuming", "resumed", "failed"], + "description": "Resume state of this point: waiting, queued behind another resume, resuming, resumed, or a failed resume attempt." + } + }, + "required": ["contextId", "kind", "status"], + "additionalProperties": false + }, + "description": "Every point the run is paused at. Resume one with Resume workflow run, naming `runId` and its `contextId`." + } + }, + "required": ["runId", "points"], + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "Where the run waits when `status` is `paused`; null otherwise." } }, "required": [ @@ -17284,7 +17330,8 @@ "output", "blockOutputs", "error", - "executionTimeoutSeconds" + "executionTimeoutSeconds", + "paused" ], "additionalProperties": false, "title": "Workflow run result", @@ -17316,6 +17363,7 @@ "startedAt": "2026-08-09T18:04:10.000Z", "endedAt": "2026-08-09T18:04:11.000Z", "durationMs": 1000, + "paused": null, "executionTimeoutSeconds": 3000 } } @@ -18248,6 +18296,10 @@ "type": "number", "description": "Number of pause points that have resumed." }, + "runId": { + "type": "string", + "description": "Run to name in Resume workflow run: the run this pause is recorded under, which for a resumed run that paused again is the run it resumed." + }, "points": { "type": "array", "items": { @@ -18265,6 +18317,7 @@ "automaticResumeWaitingReason", "pausePointCount", "resumedCount", + "runId", "points" ], "additionalProperties": false @@ -18479,9 +18532,53 @@ "description": "Execution duration in milliseconds.", "type": "number", "minimum": 0 + }, + "paused": { + "anyOf": [ + { + "type": "object", + "properties": { + "runId": { + "type": "string", + "description": "Run to name in Resume workflow run: the run this pause is recorded under, which for a resumed run that paused again is the run it resumed." + }, + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "contextId": { + "type": "string", + "description": "Pause context to name in `contextId` when resuming this point." + }, + "kind": { + "type": "string", + "enum": ["human", "time"], + "description": "`human` waits for a resume request; `time` resumes automatically at `resumeAt`." + }, + "status": { + "type": "string", + "enum": ["paused", "queued", "resuming", "resumed", "failed"], + "description": "Resume state of this point: waiting, queued behind another resume, resuming, resumed, or a failed resume attempt." + } + }, + "required": ["contextId", "kind", "status"], + "additionalProperties": false + }, + "description": "Every point the run is paused at. Resume one with Resume workflow run, naming `runId` and its `contextId`." + } + }, + "required": ["runId", "points"], + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "Where the run waits when `status` is `paused`; null otherwise." } }, - "required": ["runId", "workflowId", "status", "output", "blockOutputs", "error"], + "required": ["runId", "workflowId", "status", "output", "blockOutputs", "error", "paused"], "additionalProperties": false, "title": "Workflow resume result", "description": "Synchronous resumed run output and in-band execution status. Run failures are reported in band, not as HTTP errors, so branch on `status`." @@ -18511,7 +18608,8 @@ "error": null, "startedAt": "2026-08-09T18:04:10.000Z", "endedAt": "2026-08-09T18:04:11.000Z", - "durationMs": 1000 + "durationMs": 1000, + "paused": null } } ] @@ -19090,10 +19188,9 @@ "type": "object", "properties": { "version": { - "default": 1, - "description": "Base format version; a base written before it existed reads as 1.", "type": "number", - "const": 1 + "const": 1, + "description": "Base format version." }, "workflowId": { "type": "string", @@ -19149,7 +19246,6 @@ "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", - "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_LIMIT_EXCEEDED", @@ -19305,7 +19401,9 @@ "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", "E_NAME_TAKEN", - "E_WORKFLOW_META_INVALID" + "E_WORKFLOW_META_INVALID", + "E_TYPE", + "W_TYPES_UNCHECKED" ], "description": "Diagnostic code, e.g. `W_CANON_UNRESOLVED_ID`." }, @@ -19625,7 +19723,6 @@ "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", - "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_LIMIT_EXCEEDED", @@ -19781,7 +19878,9 @@ "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", "E_NAME_TAKEN", - "E_WORKFLOW_META_INVALID" + "E_WORKFLOW_META_INVALID", + "E_TYPE", + "W_TYPES_UNCHECKED" ], "description": "Diagnostic code, e.g. `E_UNKNOWN_PARAM` or `E_APPLY_LOCKED_BLOCK`." }, @@ -20008,10 +20107,9 @@ "type": "object", "properties": { "version": { - "default": 1, - "description": "Base format version; a base written before it existed reads as 1.", "type": "number", - "const": 1 + "const": 1, + "description": "Base format version." }, "workflowId": { "type": "string", @@ -20299,10 +20397,9 @@ "type": "object", "properties": { "version": { - "default": 1, - "description": "Base format version; a base written before it existed reads as 1.", "type": "number", - "const": 1 + "const": 1, + "description": "Base format version." }, "workflowId": { "type": "string", @@ -20324,7 +20421,7 @@ "description": "Hash of the block catalog the source was printed against." } }, - "required": ["workflowId", "workspaceId", "fingerprint", "catalogHash"], + "required": ["version", "workflowId", "workspaceId", "fingerprint", "catalogHash"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, @@ -20593,7 +20690,6 @@ "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", - "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_LIMIT_EXCEEDED", @@ -20749,7 +20845,9 @@ "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", "E_NAME_TAKEN", - "E_WORKFLOW_META_INVALID" + "E_WORKFLOW_META_INVALID", + "E_TYPE", + "W_TYPES_UNCHECKED" ], "description": "Diagnostic code, e.g. `E_UNKNOWN_PARAM` or `E_APPLY_LOCKED_BLOCK`." }, @@ -20976,10 +21074,9 @@ "type": "object", "properties": { "version": { - "default": 1, - "description": "Base format version; a base written before it existed reads as 1.", "type": "number", - "const": 1 + "const": 1, + "description": "Base format version." }, "workflowId": { "type": "string", @@ -21267,10 +21364,9 @@ "type": "object", "properties": { "version": { - "default": 1, - "description": "Base format version; a base written before it existed reads as 1.", "type": "number", - "const": 1 + "const": 1, + "description": "Base format version." }, "workflowId": { "type": "string", @@ -21292,7 +21388,7 @@ "description": "Hash of the block catalog the source was printed against." } }, - "required": ["workflowId", "workspaceId", "fingerprint", "catalogHash"], + "required": ["version", "workflowId", "workspaceId", "fingerprint", "catalogHash"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, @@ -21537,7 +21633,6 @@ "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", - "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_LIMIT_EXCEEDED", @@ -21693,7 +21788,9 @@ "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", "E_NAME_TAKEN", - "E_WORKFLOW_META_INVALID" + "E_WORKFLOW_META_INVALID", + "E_TYPE", + "W_TYPES_UNCHECKED" ], "description": "Diagnostic code, e.g. `E_UNKNOWN_PARAM` or `E_APPLY_LOCKED_BLOCK`." }, @@ -21920,10 +22017,9 @@ "type": "object", "properties": { "version": { - "default": 1, - "description": "Base format version; a base written before it existed reads as 1.", "type": "number", - "const": 1 + "const": 1, + "description": "Base format version." }, "workflowId": { "type": "string", @@ -22469,7 +22565,7 @@ { "key": "lookup-order", "id": "ctl_2b8d6f03", - "name": "lookup_order" + "name": "Lookup order" } ], "mcpServers": [ @@ -26394,16 +26490,7 @@ "description": "Stored id of the binary file." }, "rev": { - "anyOf": [ - { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - { - "type": "string" - } - ], + "type": "string", "description": "Content revision as last read." }, "sha256": { @@ -26598,7 +26685,6 @@ "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", - "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_INVALID_CHARACTER", @@ -26750,7 +26836,9 @@ "E_APPLY_INVALID_SCHEDULE", "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", - "E_WORKFLOW_META_INVALID" + "E_WORKFLOW_META_INVALID", + "E_TYPE", + "W_TYPES_UNCHECKED" ], "description": "Diagnostic code, e.g. `E_APPLY_STALE` or `E_UNKNOWN_PARAM`." }, @@ -27183,7 +27271,6 @@ "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", - "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_INVALID_CHARACTER", @@ -27335,7 +27422,9 @@ "E_APPLY_INVALID_SCHEDULE", "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", - "E_WORKFLOW_META_INVALID" + "E_WORKFLOW_META_INVALID", + "E_TYPE", + "W_TYPES_UNCHECKED" ], "description": "Diagnostic code." }, @@ -27438,16 +27527,7 @@ "description": "Stored id of the binary file." }, "rev": { - "anyOf": [ - { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - { - "type": "string" - } - ], + "type": "string", "description": "Content revision as last read." }, "sha256": { @@ -27607,7 +27687,6 @@ "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", - "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_INVALID_CHARACTER", @@ -27759,7 +27838,9 @@ "E_APPLY_INVALID_SCHEDULE", "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", - "E_WORKFLOW_META_INVALID" + "E_WORKFLOW_META_INVALID", + "E_TYPE", + "W_TYPES_UNCHECKED" ], "description": "Diagnostic code, e.g. `E_APPLY_STALE` or `E_UNKNOWN_PARAM`." }, @@ -28010,16 +28091,7 @@ "description": "Stored id of the binary file." }, "rev": { - "anyOf": [ - { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - { - "type": "string" - } - ], + "type": "string", "description": "Content revision as last read." }, "sha256": { @@ -28481,7 +28553,6 @@ "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", - "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_INVALID_CHARACTER", @@ -28633,7 +28704,9 @@ "E_APPLY_INVALID_SCHEDULE", "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", - "E_WORKFLOW_META_INVALID" + "E_WORKFLOW_META_INVALID", + "E_TYPE", + "W_TYPES_UNCHECKED" ], "description": "Diagnostic code." }, @@ -28736,16 +28809,7 @@ "description": "Stored id of the binary file." }, "rev": { - "anyOf": [ - { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - { - "type": "string" - } - ], + "type": "string", "description": "Content revision as last read." }, "sha256": { @@ -28905,7 +28969,6 @@ "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", - "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_INVALID_CHARACTER", @@ -29057,7 +29120,9 @@ "E_APPLY_INVALID_SCHEDULE", "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", - "E_WORKFLOW_META_INVALID" + "E_WORKFLOW_META_INVALID", + "E_TYPE", + "W_TYPES_UNCHECKED" ], "description": "Diagnostic code, e.g. `E_APPLY_STALE` or `E_UNKNOWN_PARAM`." }, @@ -29308,16 +29373,7 @@ "description": "Stored id of the binary file." }, "rev": { - "anyOf": [ - { - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - { - "type": "string" - } - ], + "type": "string", "description": "Content revision as last read." }, "sha256": { diff --git a/apps/docs/scripts/fixtures/content-baseline.json b/apps/docs/scripts/fixtures/content-baseline.json index 4d1d6e601fe..3dfaad6d2ae 100644 --- a/apps/docs/scripts/fixtures/content-baseline.json +++ b/apps/docs/scripts/fixtures/content-baseline.json @@ -2281,8 +2281,8 @@ { "lang": "text", "meta": null, - "sha256": "0a752f93f36e9515fd11690153150721f3286a0736d3da79f911bdaf2a3effcb", - "bytes": 710, + "sha256": "83c910b94eeb65b4b76fd1d9852fc5709862a2786abbcb6a6569b444bd176c6f", + "bytes": 821, "line": 52 } ], @@ -11059,2548 +11059,2548 @@ "meta": null, "sha256": "e89f5163bfcc02bcec8be44abb82d7807ccaeecc397ea8b3d8575e189f05a46a", "bytes": 19, - "line": 41 + "line": 45 }, { "lang": "bash", "meta": null, "sha256": "3ce59639490b19f90613bf0b002f0d5f747ae6bf89110a31aaad132f4a5d56df", "bytes": 20, - "line": 64 + "line": 68 }, { "lang": "bash", "meta": null, "sha256": "7be8dbf1bad323118735b5a0b4cdf49c653cc20508516225fe058776f0421e2e", "bytes": 20, - "line": 82 + "line": 86 }, { "lang": "bash", "meta": null, "sha256": "5b13d0a219062e58827d50697e4cec707e48ebef466a5058abb6e524376cc18e", "bytes": 23, - "line": 102 + "line": 106 }, { "lang": "bash", "meta": null, "sha256": "fac9741c4ccc5f0596cba54e6e2ecc4997e489032315eb4c80dd872c941dd0ae", "bytes": 20, - "line": 123 + "line": 127 }, { "lang": "bash", "meta": null, "sha256": "cc2a546bb69dcb90170c414517e67c86b5a20c7918c28999cb06d15f19ad4774", "bytes": 28, - "line": 141 + "line": 145 }, { "lang": "bash", "meta": null, "sha256": "f22525d91b0a915d24281bdac40a70c066449d9310582f844446e4fb2d9b347f", "bytes": 181, - "line": 169 + "line": 173 }, { "lang": "bash", "meta": null, "sha256": "21d922f40e072101cbcfdfcd4ee3c6e9ca22fc35bc4828a37f79f57dafec8d02", "bytes": 17, - "line": 187 + "line": 191 }, { "lang": "bash", "meta": null, "sha256": "56b302d091c4b589dde86d24739634d8f7d560873ca281d9962939aa6ff46ac1", "bytes": 33, - "line": 195 + "line": 199 }, { "lang": "bash", "meta": null, "sha256": "ce318a355b5dabeedbde09c7ddeb4f9132a4a57501b15fd3c2d23b3b8c75fd7f", "bytes": 20, - "line": 229 + "line": 233 }, { "lang": "bash", "meta": null, "sha256": "c74ad02c1945ec9c5cb8316f5ffeb64cc0b9dde01530570343e2dd2ee5c2ec23", "bytes": 20, - "line": 239 + "line": 243 }, { "lang": "bash", "meta": null, "sha256": "abe19c862f574d48aa91f6a506496b6f6c414d03fab399a6c86e1c12b2f8302a", "bytes": 21, - "line": 247 + "line": 251 }, { "lang": "bash", "meta": null, "sha256": "5c4299cf8aa6117a3a1a3c728d72c2a86f9627a5766d47be8ae1f03088642346", "bytes": 25, - "line": 259 + "line": 263 }, { "lang": "bash", "meta": null, "sha256": "cf03b326f03d9bcb4260e2be1ca5bcb89551a8f7f2bb1ba85744f50a9a84b434", "bytes": 73, - "line": 277 + "line": 281 }, { "lang": "bash", "meta": null, "sha256": "1350c2e26838e2b4a68726a51de8a06e2a5d32cc9714e0171c0dafd867db1d90", "bytes": 41, - "line": 294 + "line": 298 }, { "lang": "bash", "meta": null, "sha256": "8b747ef16c178bb05ca7171ec48e801f20a250e774a44d2d3b9753bd69aa3ec2", "bytes": 29, - "line": 324 + "line": 328 }, { "lang": "bash", "meta": null, "sha256": "88526e37fa1577427e6126306dc69d3afa94894d3dd313ae31286bff5eadafa4", "bytes": 28, - "line": 359 + "line": 363 }, { "lang": "bash", "meta": null, "sha256": "437c1deab5031ec9ce664b5429f7b62c062fd592469411b7f61cc16a9e21aa15", "bytes": 26, - "line": 379 + "line": 383 }, { "lang": "bash", "meta": null, "sha256": "575f3eca46c258a161e39e0bb8154f4e8ea02ed85bc48ba09e313bad08b2bdd7", "bytes": 24, - "line": 411 + "line": 415 }, { "lang": "text", "meta": null, - "sha256": "0a752f93f36e9515fd11690153150721f3286a0736d3da79f911bdaf2a3effcb", - "bytes": 710, - "line": 425 + "sha256": "83c910b94eeb65b4b76fd1d9852fc5709862a2786abbcb6a6569b444bd176c6f", + "bytes": 821, + "line": 429 }, { "lang": "bash", "meta": null, "sha256": "ecc11df2b60a4b0dc7d6b4e95f6fbee1f43554a8e32ee7232d50543a94e22273", "bytes": 25, - "line": 443 + "line": 448 }, { "lang": "bash", "meta": null, "sha256": "451b8c0648b69af0d37673c7b6c4bd98eb8ce4baca0c902038fc1460938adf88", "bytes": 35, - "line": 475 + "line": 480 }, { "lang": "bash", "meta": null, "sha256": "5037ed0778643f28636735f01bb24cd5f938bdc923f02abfacf6e37840a822f7", "bytes": 34, - "line": 506 + "line": 511 }, { "lang": "bash", "meta": null, "sha256": "ef5100ffa39072ae2ba9bb021d546036b95ded8da431fad855f809550c8913fb", "bytes": 47, - "line": 539 + "line": 544 }, { "lang": "bash", "meta": null, "sha256": "4051f5bb25072a25196ba8e847ab22b9d42aeb0cbb36186b5e7cc051d77c00e0", "bytes": 53, - "line": 569 + "line": 574 }, { "lang": "bash", "meta": null, "sha256": "2b6d0db0f06b8f51733c7da29a0c183aab73a6da83b787db76e7c3064fc9c78c", "bytes": 64, - "line": 603 + "line": 608 }, { "lang": "bash", "meta": null, "sha256": "a74b652635bc27ca58af7b080b78d983469558a2668f0b3f033a1b5b2f4cef10", "bytes": 55, - "line": 634 + "line": 639 }, { "lang": "bash", "meta": null, "sha256": "e407b3388ac13c30e985d64e41a9fb8f68c52e6e7a020bc3db79ce9473944724", "bytes": 40, - "line": 665 + "line": 670 }, { "lang": "bash", "meta": null, "sha256": "cb3d67be4a05a8cc95870cadb5ac682c16e80889db6606e388dd48651bfc4af4", "bytes": 30, - "line": 685 + "line": 690 }, { "lang": "bash", "meta": null, "sha256": "f7e2cb3ed34992b91cdcbd2fa65eadb48134c31e0d295519421644ad0668f20e", "bytes": 47, - "line": 710 + "line": 715 }, { "lang": "bash", "meta": null, "sha256": "3ce249d6b52442bdf5df53436bae6b9718064994b4b26ecf25372ce53606db08", "bytes": 45, - "line": 763 + "line": 768 }, { "lang": "bash", "meta": null, "sha256": "48d4019bc1905094aec776873af1d5a4e94ec2f52d043c51bbbb559b6a876944", "bytes": 276, - "line": 806 + "line": 811 }, { "lang": "bash", "meta": null, "sha256": "866eaf5e25ac2d6471b52118f082a507d5300b7c80cd82ecbe3cfbce598c5f6a", "bytes": 54, - "line": 818 + "line": 823 }, { "lang": "bash", "meta": null, "sha256": "48d4019bc1905094aec776873af1d5a4e94ec2f52d043c51bbbb559b6a876944", "bytes": 276, - "line": 856 + "line": 861 }, { "lang": "bash", "meta": null, "sha256": "e0ac83da55217195ac0ca3bd1a41314be433d0a62428f36eb9666df607e8322c", "bytes": 46, - "line": 868 + "line": 873 }, { "lang": "bash", "meta": null, "sha256": "664dfa9d010be73d8c8d4c1b079e946a646cc4677891d5fd34df9e5817cabfed", "bytes": 40, - "line": 898 + "line": 903 }, { "lang": "bash", "meta": null, "sha256": "55d8bb7d28001fafb0a76ccaf87863cb67f0150ffef73889e5c363ce3775131b", "bytes": 33, - "line": 924 + "line": 929 }, { "lang": "bash", "meta": null, "sha256": "02ff8ad73ece2f21edb90fc1a69904f322032da6d90a23d28d2d490beb55ab53", "bytes": 48, - "line": 948 + "line": 953 }, { "lang": "bash", "meta": null, "sha256": "06a7f6e71ab68db991126dcf2d660866aec7b89d27f751d082d2f90030a19b00", "bytes": 35, - "line": 978 + "line": 983 }, { "lang": "bash", "meta": null, "sha256": "3c9e74b86271246976e186b32c311a50f367fcd701f0506a56c8c8150c01b400", "bytes": 31, - "line": 998 + "line": 1003 }, { "lang": "bash", "meta": null, "sha256": "c0bbfff139a69379e188cfe4bbd3393285fce565dd83f7098eb2d387356da9c4", "bytes": 48, - "line": 1021 + "line": 1026 }, { "lang": "bash", "meta": null, "sha256": "c569c5e38502a1c1e8f6078954bc90b559dd80adb577bb4cf7b63ec7bbdb3aa7", "bytes": 46, - "line": 1061 + "line": 1066 }, { "lang": "bash", "meta": null, "sha256": "939a624f32ea05ac4cddd6037a27cdc7829018f0ac8096e4afd85aa9fab93ea2", "bytes": 24, - "line": 1092 + "line": 1097 }, { "lang": "bash", "meta": null, "sha256": "428eca668e88f6323ab89a2e488c5fd403b8b04064b26b55a3b8ca7ddb966be5", "bytes": 26, - "line": 1111 + "line": 1116 }, { "lang": "bash", "meta": null, "sha256": "66b86826e7fbeb5cc1b35c54dcbf9727264c2b6d50528e8c21accaff3a708806", "bytes": 31, - "line": 1135 + "line": 1140 }, { "lang": "bash", "meta": null, "sha256": "a461b9c9fef3090d3367148a2a183410e81624e42e340c21a4138c30c6b4409c", "bytes": 41, - "line": 1157 + "line": 1162 }, { "lang": "bash", "meta": null, "sha256": "8c86de167a3b73c5430d2b15f558b7c0b2a82cd347b4e85907862196cf8e16bc", "bytes": 32, - "line": 1188 + "line": 1193 }, { "lang": "bash", "meta": null, "sha256": "8a9eb6688329292f21fecba059890d65dab0a136e86f26d38987c27d68013ad8", "bytes": 43, - "line": 1216 + "line": 1221 }, { "lang": "bash", "meta": null, "sha256": "be3c635d1b158a14e8e00c6e88d84e4126e29d89f0464ebf0b296f19b2bdf59b", "bytes": 32, - "line": 1239 + "line": 1244 }, { "lang": "bash", "meta": null, "sha256": "993262e619d4470867077b7a4e0c528f715be468511bf9e072e8a9429ef250a1", "bytes": 35, - "line": 1261 + "line": 1266 }, { "lang": "bash", "meta": null, "sha256": "adc4973b83b313bcaf5f9058297e030a9c272cb1b5612fe8465b02edf2ad1b73", "bytes": 54, - "line": 1293 + "line": 1298 }, { "lang": "bash", "meta": null, "sha256": "48fbd97b704f5e02a593cbf0020bc3c6600ff1b4d349ae80b3cba39225a4b9fc", "bytes": 46, - "line": 1324 + "line": 1329 }, { "lang": "bash", "meta": null, "sha256": "49e712965d1a8af321563bc382bb448e0b68067c3c68861f84896b5f97e70314", "bytes": 42, - "line": 1345 + "line": 1350 }, { "lang": "bash", "meta": null, "sha256": "e463cbe0c80554eaa7fe151c51523307240c2226a54924a3d984cdc0a84f529b", "bytes": 52, - "line": 1378 + "line": 1383 }, { "lang": "bash", "meta": null, "sha256": "23bede1f0d68221f4da857a62e0594d031e40e5a794bd96c79eba2de2924072a", "bytes": 54, - "line": 1411 + "line": 1416 }, { "lang": "bash", "meta": null, "sha256": "ad1df0d9a424569351d851507b674bb104654e1251d7bee11ebc6955e0f2be6c", "bytes": 56, - "line": 1443 + "line": 1448 }, { "lang": "bash", "meta": null, "sha256": "37cdd4ceab29424161734300286176b9971cd7d6c134022308d5b21e4fa9e714", "bytes": 33, - "line": 1475 + "line": 1480 }, { "lang": "bash", "meta": null, "sha256": "0bc8335422d07dfbc74c55102518d6d2965a5aa27be6994b8b4317478e13ef3d", "bytes": 37, - "line": 1506 + "line": 1511 }, { "lang": "bash", "meta": null, "sha256": "863b992687ec7121ef44d5680b290502052bfe51e7e43aa24376ddba51fc3841", "bytes": 28, - "line": 1536 + "line": 1541 }, { "lang": "bash", "meta": null, "sha256": "9d7e15ac24392a0771cf7857c3f110be1ede32e18427995923edc5978fdcaa31", "bytes": 38, - "line": 1556 + "line": 1561 }, { "lang": "bash", "meta": null, "sha256": "15849bbb5c9f4f1c0754c0c99d3048b910f6fdcbb02ab84a4e34d7ed1930cd15", "bytes": 24, - "line": 1589 + "line": 1594 }, { "lang": "bash", "meta": null, "sha256": "31cbe1979c2c645d78646d966ac83fd45e6b556d56ab0d8fc47a7abd281e524d", "bytes": 24, - "line": 1616 + "line": 1621 }, { "lang": "bash", "meta": null, "sha256": "1a728e81af7425e00df25a70a5819d272cbddcab487426cebc94de7834509999", "bytes": 33, - "line": 1639 + "line": 1644 }, { "lang": "bash", "meta": null, "sha256": "f7a8e9f75a2ea3d88d6d12b097f20a94e2b915741cc10f805b070c6ad4261a7e", "bytes": 35, - "line": 1671 + "line": 1676 }, { "lang": "bash", "meta": null, "sha256": "94537050876dfc16340c4db7965fcc2a098f09fcb9911d5e154c11721d212e6a", "bytes": 26, - "line": 1701 + "line": 1706 }, { "lang": "bash", "meta": null, "sha256": "cdee40f5dc3195f9db4462ddd0e5b7bc03b44f600a82f357d6b651ecee770840", "bytes": 26, - "line": 1721 + "line": 1726 }, { "lang": "bash", "meta": null, "sha256": "bda181f24ee73df10ced9c179ddb81b115d62b4da46eb64b63dd23e7f4c51a96", "bytes": 34, - "line": 1748 + "line": 1753 }, { "lang": "bash", "meta": null, "sha256": "14e217553dedf133ef014fd989058ee281844a55293e05a9dddf044947c058fe", "bytes": 40, - "line": 1778 + "line": 1783 }, { "lang": "bash", "meta": null, "sha256": "30f91370cbb0ddf76900ab363e83bb26c0a95cb81518de875885f66d4c9df4a3", "bytes": 33, - "line": 1810 + "line": 1815 }, { "lang": "bash", "meta": null, "sha256": "1c143b6c0cd2e76ce8c74504ecb5ee2560b147eb299d8f0d3d956854b706958c", "bytes": 32, - "line": 1841 + "line": 1846 }, { "lang": "bash", "meta": null, "sha256": "b36a5102aee98e664a1ca4cc19d91310af00b2a4afbb04c78589bb4c3a2936a9", "bytes": 29, - "line": 1872 + "line": 1877 }, { "lang": "bash", "meta": null, "sha256": "62a17f5231fba3f732cba025c16c8b6706411b9267e6abd58e4e51aff8777043", "bytes": 22, - "line": 1903 + "line": 1908 }, { "lang": "bash", "meta": null, "sha256": "760a88e6d91ed147f40d39808ae39d178b6c38b61a5c69dd37755079cff376c2", "bytes": 69, - "line": 1929 + "line": 1934 }, { "lang": "bash", "meta": null, "sha256": "e0173107cc10779c1b96d55c66a3bd628e9bc21b39234101e2f9d7519087780e", "bytes": 51, - "line": 1959 + "line": 1964 }, { "lang": "bash", "meta": null, "sha256": "71bb24f623f1958775fe0f9df499ad3f8241c3132ea8f8a40d5f26bd2041b65e", "bytes": 53, - "line": 1989 + "line": 1994 }, { "lang": "bash", "meta": null, "sha256": "51d1aa93ed9262fa8f275fbd24e805ad9a3a075ed2f5c3888d57ecf909426c3e", "bytes": 61, - "line": 2023 + "line": 2028 }, { "lang": "bash", "meta": null, "sha256": "4782c15ea248b0cb3a7cffa4242b54f9bea866ecf26f63ada4ed921455699cb3", "bytes": 54, - "line": 2056 + "line": 2061 }, { "lang": "bash", "meta": null, "sha256": "c8f14f40bbc787d13778c342211d73c9f0b118a8d37d3c82a87c72b42b9d5d93", "bytes": 56, - "line": 2088 + "line": 2093 }, { "lang": "bash", "meta": null, "sha256": "913db46a26314244a1e4c903adb6772a8e405da8cba64f7218ff3683d7daa72a", "bytes": 41, - "line": 2118 + "line": 2123 }, { "lang": "bash", "meta": null, "sha256": "7cda9f00d098a51943b10891142d7e6a8d4cb46d752e1cdae5825ab6c56b8aa9", "bytes": 42, - "line": 2138 + "line": 2143 }, { "lang": "bash", "meta": null, "sha256": "e09f666b66b4d7acdcd6aa26831c7f258ff49baa0fd762ea920b90fd39846582", "bytes": 61, - "line": 2158 + "line": 2163 }, { "lang": "bash", "meta": null, "sha256": "8b204243cf243c64557adb522d2bfd72be53400afab3c03f4c314117ed37655d", "bytes": 74, - "line": 2192 + "line": 2197 }, { "lang": "bash", "meta": null, "sha256": "cf87bc61bba385818ebc622f9b9f481213e1d86f65df7ab1a193749ab929a651", "bytes": 68, - "line": 2225 + "line": 2230 }, { "lang": "bash", "meta": null, "sha256": "2d57fee1358f9ce5a3f166aed1400940cbe737b04d8f487a16eb35bc3bb5a6d4", "bytes": 78, - "line": 2260 + "line": 2265 }, { "lang": "bash", "meta": null, "sha256": "7f02636a02ece5cd252aad171e251b18e1c29207d62dfcc962485052b799fdc4", "bytes": 65, - "line": 2292 + "line": 2297 }, { "lang": "bash", "meta": null, "sha256": "e6a2660057e8859cebd226a4420672f12beed4e274bdc57a4b70c96a0142b1b6", "bytes": 66, - "line": 2314 + "line": 2319 }, { "lang": "bash", "meta": null, "sha256": "54b00a2d3830092a8fe552bba29419710da6647ac3cc96d6a0a9ffbef596c440", "bytes": 78, - "line": 2350 + "line": 2355 }, { "lang": "bash", "meta": null, "sha256": "a0a28be794c70e6366719b49f3ad627faa087181960d287d6a17bc44d7a8bd9d", "bytes": 64, - "line": 2384 + "line": 2389 }, { "lang": "bash", "meta": null, "sha256": "2a48509e548ba0f0d2bb97bfc37ac1807f3b34cc5c44cbd1c5ca57735614fc24", "bytes": 71, - "line": 2419 + "line": 2424 }, { "lang": "bash", "meta": null, "sha256": "ea154f4a00845d5c60d54aff14d7173c8de383ec43e13454a8c326459ed7695f", "bytes": 58, - "line": 2450 + "line": 2455 }, { "lang": "bash", "meta": null, "sha256": "f14623530e7aeb20de131c59208269f9703e85ab6a89cd4368fb3c2ff7c36863", "bytes": 56, - "line": 2471 + "line": 2476 }, { "lang": "bash", "meta": null, "sha256": "cdf3ade3d9fa9f1f3a191265a2b0de8092eaaa49bd961d94eccb09355dfddb26", "bytes": 71, - "line": 2507 + "line": 2512 }, { "lang": "bash", "meta": null, "sha256": "2f509b586cc62ff6bb0b5c1ee7e5062689b1cfd987acc2c18dee6b10bc3a194f", "bytes": 65, - "line": 2561 + "line": 2566 }, { "lang": "bash", "meta": null, "sha256": "6546c4a95a217203c622f0e62f945cbe2863d42d02a5229621f43f12b68bc063", "bytes": 39, - "line": 2595 + "line": 2600 }, { "lang": "bash", "meta": null, "sha256": "e9f1685d2a50e4bd554c7daf19621a7704aa5b1aea3540af28884066ae413c69", "bytes": 36, - "line": 2615 + "line": 2620 }, { "lang": "bash", "meta": null, "sha256": "ad0c1107caee2427422e0a52a6da2df0a037010f93467fd957fb0136f938d675", "bytes": 30, - "line": 2635 + "line": 2640 }, { "lang": "bash", "meta": null, "sha256": "fae160a2cd7e296a9f9b00fa789ba95a2f1e507713a469902de21ed945d9eb25", "bytes": 59, - "line": 2658 + "line": 2663 }, { "lang": "bash", "meta": null, "sha256": "abdae7f49c77877550cfc2d7195132c12fb0117a0471faf1c525d44ad2de1321", "bytes": 73, - "line": 2694 + "line": 2699 }, { "lang": "bash", "meta": null, "sha256": "d11c4c59feac4345ba7dfb02edc2780adae89cf702e570f32e1ccc8555bdb169", "bytes": 60, - "line": 2727 + "line": 2732 }, { "lang": "bash", "meta": null, "sha256": "af533689c0b530ff902ae36c2cac7198f43ff6968d168a94da153d81fe8020fd", "bytes": 81, - "line": 2748 + "line": 2753 }, { "lang": "bash", "meta": null, "sha256": "f907eb4bee803d3f45d4abc9baae106aaec0249143dfd9cf56aa17285776a430", "bytes": 83, - "line": 2782 + "line": 2787 }, { "lang": "bash", "meta": null, "sha256": "28c4e709c778f27d924fbe49edb4bf198b7c73e9b65619e6fad43d1fb9e2cfb7", "bytes": 57, - "line": 2814 + "line": 2819 }, { "lang": "bash", "meta": null, "sha256": "0a7262cac83ce7c16b17a1364a123764e5fa8b645dd60fd5b394b3f74dd0e1fa", "bytes": 71, - "line": 2846 + "line": 2851 }, { "lang": "bash", "meta": null, "sha256": "a25c869b7add79bfe6f194ec72190bb6b4957bb303fe6b4c31c9455f4a2e11a9", "bytes": 73, - "line": 2878 + "line": 2883 }, { "lang": "bash", "meta": null, "sha256": "b3f9e190362420216749c9924e83a35c5a5c2414ab03ff89601a6b9501494bf9", "bytes": 35, - "line": 2911 + "line": 2916 }, { "lang": "bash", "meta": null, "sha256": "ae5dcbc80aeb125607ebd763669a1f335d6ddf087a6baf1853453867675ce865", "bytes": 45, - "line": 2933 + "line": 2938 }, { "lang": "bash", "meta": null, "sha256": "c91b2cb83c28571b965071d6643d955366931a6ca3dd340e54d8536ea90cefde", "bytes": 36, - "line": 2964 + "line": 2969 }, { "lang": "bash", "meta": null, "sha256": "de622393fa33cc9b0002c7d670d9f45c2bcd9fbfe3f0c99be71ae96969a005dd", "bytes": 47, - "line": 2989 + "line": 2994 }, { "lang": "bash", "meta": null, "sha256": "356cb12341ce90e24b765d02a997421c0469a3b26509c90e42a17af4dd3f9e95", "bytes": 48, - "line": 3014 + "line": 3019 }, { "lang": "bash", "meta": null, "sha256": "a611d4f425ac65781756225557a7e8f8559faccaa4c6466ef23fa78cd2a2226c", "bytes": 35, - "line": 3044 + "line": 3049 }, { "lang": "bash", "meta": null, "sha256": "8c7bab52ede04cca1dd71b466bd76c7f5b67c6b7f0fed08e14ee7656d6b2b160", "bytes": 28, - "line": 3064 + "line": 3069 }, { "lang": "bash", "meta": null, "sha256": "063e71c7485fe7d3657e692841a2f0629e6a31b48e8501282b0456202eefaa5d", "bytes": 39, - "line": 3089 + "line": 3094 }, { "lang": "bash", "meta": null, "sha256": "4f9e7b46b98628ddded377f3a73cb2e9b4751023b7b1fc90c1cefc90555c80c4", "bytes": 30, - "line": 3109 + "line": 3114 }, { "lang": "bash", "meta": null, "sha256": "efaaf65fd8057cd592d386d0e0c800eef4e71d649a1f011fd2f20495d8d942ab", "bytes": 48, - "line": 3137 + "line": 3142 }, { "lang": "bash", "meta": null, "sha256": "5303a1a6194097b3acc7546ccafb0faced44b084951b7e14ff1029cf0fdff957", "bytes": 43, - "line": 3170 + "line": 3175 }, { "lang": "bash", "meta": null, "sha256": "a9ba0ea93105e0f224ed0c3e661adf5fe706a875fb9741348134814d65c6d882", "bytes": 48, - "line": 3191 + "line": 3196 }, { "lang": "bash", "meta": null, "sha256": "a721f46390cb321c013b700b13f46f2e9833616be44a3ee8e0971c3e5c0f945b", "bytes": 37, - "line": 3223 + "line": 3228 }, { "lang": "bash", "meta": null, "sha256": "9f9b6ea8992e8fcd2bdb540857d42288ba0ecedb959ff5c1c56de708e65db79e", "bytes": 33, - "line": 3254 + "line": 3259 }, { "lang": "bash", "meta": null, "sha256": "1478c9884eb8c9bc2dd64170d3fb101030957399aab5da911d5f77d46b662c73", "bytes": 26, - "line": 3285 + "line": 3290 }, { "lang": "bash", "meta": null, "sha256": "51b81826c6f4b7933c1c802c82baca186c67efe8e59e69a6a7754360fe8675da", "bytes": 30, - "line": 3311 + "line": 3316 }, { "lang": "bash", "meta": null, "sha256": "8aeb5fc735c8037c480f3c8220149fb6f811de62c946584523d50d1cd1811a53", "bytes": 24, - "line": 3343 + "line": 3348 }, { "lang": "bash", "meta": null, "sha256": "a1bf4221604cc962c677313543850fe6cd140476ef52de3a9e29b305865ae8f0", "bytes": 23, - "line": 3372 + "line": 3377 }, { "lang": "bash", "meta": null, "sha256": "5215bc6f0c098350b8067dd283226f3444cf73599ab1989c5dfae5c563069a04", "bytes": 25, - "line": 3416 + "line": 3421 }, { "lang": "bash", "meta": null, "sha256": "98f84efeb01c77bc8c1aadb62fbd989c5ae41de97d07fd9b59e8b2b53cafe06f", "bytes": 145, - "line": 3440 + "line": 3445 }, { "lang": "bash", "meta": null, "sha256": "baad97733d922f4ef4c068577ef9f0f855c44f3b54e9b80a61733a4fecfd350d", "bytes": 32, - "line": 3460 + "line": 3465 }, { "lang": "bash", "meta": null, "sha256": "fdb563355cb89d0b6f534e825e70973c85326879a7d4f0adaee447ed78db5260", "bytes": 46, - "line": 3493 + "line": 3498 }, { "lang": "bash", "meta": null, "sha256": "8409df5d28808a04cbea45c4f0162a7a283a0d4eee0fc3391d82a8663121a495", "bytes": 33, - "line": 3523 + "line": 3528 }, { "lang": "bash", "meta": null, "sha256": "c3189f21b856e8c158f2a39d3260d7c0ac93ba2c0c73494c7e1374d45a51346f", "bytes": 30, - "line": 3543 + "line": 3548 }, { "lang": "bash", "meta": null, "sha256": "066839a4599d90ccd88f845122e61c608a8ea120e9f1476857f0a2eb8c723de7", "bytes": 50, - "line": 3566 + "line": 3571 }, { "lang": "bash", "meta": null, "sha256": "209da9ab7f502fbcaec3297113212d496eca57b124e273dc8080efa6c4e0de71", "bytes": 46, - "line": 3597 + "line": 3602 }, { "lang": "bash", "meta": null, "sha256": "c01ee6bd733ccd61abdb244baa88a17758166a1eacaa4456d3a8bbe56e6ff00f", "bytes": 15, - "line": 3642 + "line": 3647 }, { "lang": "bash", "meta": null, "sha256": "e2c2a5ffcc518a49f6cc038c691b068769101b4bf94905eb0a472299ab563620", "bytes": 39, - "line": 3656 + "line": 3661 }, { "lang": "bash", "meta": null, "sha256": "ccaaa978abfa31e70784eda567c50bec64a5cf485a205fa545e71f46c1821f3a", "bytes": 40, - "line": 3677 + "line": 3682 }, { "lang": "bash", "meta": null, "sha256": "7e6eac72f3011e3714d4eeb9914601dbe344ff899504c1324ff55c2b6eed60d5", "bytes": 53, - "line": 3702 + "line": 3707 }, { "lang": "bash", "meta": null, "sha256": "d557d9bb45aa7b4ee10d2d502d92710aafe9fcbc7b12d0a219c3eff49863e1f7", "bytes": 53, - "line": 3733 + "line": 3738 }, { "lang": "bash", "meta": null, "sha256": "6f4dc8213285da7c740b7f183f519a14d88e853125347cf4b3585c153f3d6c95", "bytes": 62, - "line": 3763 + "line": 3768 }, { "lang": "bash", "meta": null, "sha256": "c7934b9e19cf7a0ff636ecdb465b1a6727ad23d36b695eb0b08783efa08698d3", "bytes": 50, - "line": 3793 + "line": 3798 }, { "lang": "bash", "meta": null, "sha256": "c6c30823efb18475aef576f5eac37ab1a319e1de7b2462fccb62b249396e3d9f", "bytes": 52, - "line": 3815 + "line": 3820 }, { "lang": "bash", "meta": null, "sha256": "8567533e04160a832142ff673958ff2456ea163f86df91685ba5da691604a882", "bytes": 56, - "line": 3842 + "line": 3847 }, { "lang": "bash", "meta": null, "sha256": "f8809dfed9678563c959c376cf67dcc022eeee8e5e4384e8aa46ff6470838960", "bytes": 59, - "line": 3862 + "line": 3867 }, { "lang": "bash", "meta": null, "sha256": "c4202b9b75440588bb6562fce248037a4425448373f72f9ee3ad9ade135fab34", "bytes": 48, - "line": 3883 + "line": 3888 }, { "lang": "bash", "meta": null, "sha256": "711c4598e2329b7c5079f9cc2569196c4af7ebfa267e38ab904ff60e579e5169", "bytes": 48, - "line": 3908 + "line": 3913 }, { "lang": "bash", "meta": null, "sha256": "ef9a879b046809272052e1804f9ebe98b60cd0cdf476251b599ca44bb3ae1b11", "bytes": 63, - "line": 3934 + "line": 3939 }, { "lang": "bash", "meta": null, "sha256": "b07d1aa721f8a38cfc8e79bc68497e76240430fcc1fec0818294974f67755a1d", "bytes": 63, - "line": 3964 + "line": 3969 }, { "lang": "bash", "meta": null, "sha256": "48441bc81c5893bfd1567acf2a401eb191e4b7bef2862b8c29aa158a517adb82", "bytes": 93, - "line": 4000 + "line": 4005 }, { "lang": "bash", "meta": null, "sha256": "74d9b766eac6b565c6287e10884f95c2f74ecd8dd4947b488cda0ff1c1f16597", "bytes": 80, - "line": 4032 + "line": 4037 }, { "lang": "bash", "meta": null, "sha256": "4b74edf3d708c0fafd7bb8ba6a827644f65d6cd755a4cf1822b5308a45eb76c3", "bytes": 106, - "line": 4066 + "line": 4071 }, { "lang": "bash", "meta": null, "sha256": "229448ff3c47ffdfdd720fb88b38edcf58f51d063f7b7836d4f4fdc478f99b5c", "bytes": 69, - "line": 4100 + "line": 4105 }, { "lang": "bash", "meta": null, "sha256": "7863a0cbd4e2cb3715358cca55047765a210f9a42a3dd171e42f574185fe0ab9", "bytes": 73, - "line": 4132 + "line": 4137 }, { "lang": "bash", "meta": null, "sha256": "412f8bcf9151f7075294ba9e7cfcbb86581e91dbd1b217775e9fb6958df71a2e", "bytes": 72, - "line": 4165 + "line": 4170 }, { "lang": "bash", "meta": null, "sha256": "483447579062e117424ae72463645f166fea91b8a87fe6efcf48a24a3a8145f8", "bytes": 49, - "line": 4200 + "line": 4205 }, { "lang": "bash", "meta": null, "sha256": "e57bccfdde20412a95b0aeb601448b791eb566d28af3b17bbc16d1e62bbcfb4c", "bytes": 60, - "line": 4228 + "line": 4233 }, { "lang": "bash", "meta": null, "sha256": "34378bac1290005ec4e6a46fc968c097307dc2dd27dffd2ed275b885dcc8502b", "bytes": 57, - "line": 4259 + "line": 4264 }, { "lang": "bash", "meta": null, "sha256": "91c6910aa33b8d3c65dccd59a480a9d986eadf89d8d4974ade0c8cb47c7ac821", "bytes": 47, - "line": 4289 + "line": 4294 }, { "lang": "bash", "meta": null, "sha256": "303d009467865566416478bccdf9e95291862e222144f55ca61bae5d446fa9d5", "bytes": 50, - "line": 4313 + "line": 4318 }, { "lang": "bash", "meta": null, "sha256": "7deac995bc8ac114dae3500bb4792b73fdb39f5b666f4a2886428320e1ffbd00", "bytes": 60, - "line": 4337 + "line": 4342 }, { "lang": "bash", "meta": null, "sha256": "6231d67b8fca5d05ef85468209b86d04c0c016014f46f2f444da5321bd655941", "bytes": 46, - "line": 4372 + "line": 4377 }, { "lang": "bash", "meta": null, "sha256": "30a1944929f1b7cdc8d8866735022851ef133f4160fc018f736201f1531e7907", "bytes": 58, - "line": 4394 + "line": 4399 }, { "lang": "bash", "meta": null, "sha256": "6ce2fc39c89d2789f343b2590c28ff069d4bcf685241cdfd645d579b886625a5", "bytes": 44, - "line": 4424 + "line": 4429 }, { "lang": "bash", "meta": null, "sha256": "edbc6c008ae5039761ca84f5af6c63c15aab125fe0bc7b890362159598318cf6", "bytes": 65, - "line": 4450 + "line": 4455 }, { "lang": "bash", "meta": null, "sha256": "cdeb9be48212517be6994c625844b9761842bd3822c74e7d86970a022811a07d", "bytes": 61, - "line": 4485 + "line": 4490 }, { "lang": "bash", "meta": null, "sha256": "7f3233f2465f84ad271fbe67411e1651f83d9dd39e15128c477276a103443baa", "bytes": 61, - "line": 4517 + "line": 4522 }, { "lang": "bash", "meta": null, "sha256": "af80c56179adf35f94c4c1c3eb3676cf2ca68b61af3c1b43a9ac020c4205f4a2", "bytes": 61, - "line": 4550 + "line": 4555 }, { "lang": "bash", "meta": null, "sha256": "48fced6ea852f10aa3620044ca010c0bf50acfb3b743012f836a98be0d7cdf08", "bytes": 58, - "line": 4581 + "line": 4586 }, { "lang": "bash", "meta": null, "sha256": "6d9a078ab511579f7f7234fa28d72ae92f7df84c9f9957aff14951a2fe1b08f3", "bytes": 46, - "line": 4611 + "line": 4616 }, { "lang": "bash", "meta": null, "sha256": "88b2622d7dc41ea41543f26e4dd1b513c271cb0e0452b937033088f7ae80484f", "bytes": 46, - "line": 4636 + "line": 4641 }, { "lang": "bash", "meta": null, "sha256": "757036af4cd38ae573a0589ddcd08b179542a30bfa802f88ff3debb198baae47", "bytes": 62, - "line": 4684 + "line": 4689 }, { "lang": "bash", "meta": null, "sha256": "7311b5a978eda8140f8e314d709e565a535c76064199595eb139c015f16312d5", "bytes": 42, - "line": 4714 + "line": 4719 }, { "lang": "bash", "meta": null, "sha256": "c3410310e5eccb2e0a7440b8d3cbfc2508270890a08ec5a85c5b8cc5c5a3b8b8", "bytes": 45, - "line": 4734 + "line": 4739 }, { "lang": "bash", "meta": null, "sha256": "08f1a585205b784ac0527c4ffb9aae95a4d8bd1702abddb87d1aa25415de45d2", "bytes": 38, - "line": 4755 + "line": 4760 }, { "lang": "bash", "meta": null, "sha256": "e4502c5ec3c9643358cf434f3271f7f39ee39f899661c58e7af68b98f42cbcb1", "bytes": 60, - "line": 4775 + "line": 4780 }, { "lang": "bash", "meta": null, "sha256": "59e8699f41a3f06be75f1eb4addb041b762d100d6e15f61788e729a8a277f55f", "bytes": 63, - "line": 4805 + "line": 4810 }, { "lang": "bash", "meta": null, "sha256": "9a525f2d35624ea70a558a4081c20c98418fb371cce3ac2d70cb01462271f1c6", "bytes": 40, - "line": 4836 + "line": 4841 }, { "lang": "bash", "meta": null, "sha256": "5db8d4c149bb0b8378ac584947f1a8d037aa2375312e098338ee1566030988e4", "bytes": 51, - "line": 4862 + "line": 4867 }, { "lang": "bash", "meta": null, "sha256": "cba02b44f48f44f069fb55f48ec4e680a49b71ab99d8e7013ff4113236cd6e19", "bytes": 51, - "line": 4893 + "line": 4898 }, { "lang": "bash", "meta": null, "sha256": "1825feb4954c2f39280e98a8ab8f8784e097c9823d04cbccf616c28f24eeee4b", "bytes": 43, - "line": 4924 + "line": 4929 }, { "lang": "bash", "meta": null, "sha256": "0bd4be17187ea4870dfddcf74c03492e4ff3e4eb734d8e38fc710a0afd70e771", "bytes": 41, - "line": 4950 + "line": 4955 }, { "lang": "bash", "meta": null, "sha256": "e26b81a721ffd90b20b61be8168187fc20333274f6c3e537eb6cc44f87397f8b", "bytes": 40, - "line": 4974 + "line": 4979 }, { "lang": "bash", "meta": null, "sha256": "a85bb64841a5626286099eb6175af5f8d0b0c8f19d71275c41ba144d5ce6d75b", "bytes": 32, - "line": 5003 + "line": 5008 }, { "lang": "bash", "meta": null, "sha256": "c8500badf466ac4cddb64017931e69aedba037eb5c44d0be411f3e2368254f87", "bytes": 38, - "line": 5026 + "line": 5031 }, { "lang": "bash", "meta": null, "sha256": "c5da7d1cca60bf076fb11e3a830b1c639ae02b8b2413e4956b12b54d4af7869d", "bytes": 43, - "line": 5058 + "line": 5063 }, { "lang": "bash", "meta": null, "sha256": "ee42a8df21f3cb29767908892e907b58edc31fccac8414e646690b238373feac", "bytes": 49, - "line": 5080 + "line": 5085 }, { "lang": "bash", "meta": null, "sha256": "3aa75d103d8d87811ca0f13f238ef5bfc84debf02826b8883eb0a09b372b7230", "bytes": 44, - "line": 5103 + "line": 5108 }, { "lang": "bash", "meta": null, "sha256": "c97bf15cbec26edcc86e8e3a908361b4c12a7d4b5578d5ea685d4fc68993c3f9", "bytes": 55, - "line": 5129 + "line": 5134 }, { "lang": "bash", "meta": null, "sha256": "971979fe121168021fc32881c5e8807f271cbaee608d70cf22b709662e0aae21", "bytes": 38, - "line": 5161 + "line": 5166 }, { "lang": "bash", "meta": null, "sha256": "76f320882518b53d2a6055f48c06b0deba00efa8baa1c1932ec6f1c598868a82", "bytes": 48, - "line": 5189 + "line": 5194 }, { "lang": "bash", "meta": null, "sha256": "1c902a61277e58e20d330fd4f7510a922639122f3e26126aeff5a404579d210d", "bytes": 45, - "line": 5220 + "line": 5225 }, { "lang": "bash", "meta": null, "sha256": "3e09d80993bd2231d73817167d0a3e7d022d9bb5fadbf1563a854531a3c22ced", "bytes": 36, - "line": 5250 + "line": 5255 }, { "lang": "bash", "meta": null, "sha256": "39050b42d7a1e9da84fac3fa817aa0635c47c28f32bceabcaf8811283ad7d7ce", "bytes": 48, - "line": 5274 + "line": 5279 }, { "lang": "bash", "meta": null, "sha256": "a4d3e32ee5d44b474b2fe040b4be5d32c0ad725d1b3c3e4342dc2ca08fa0a157", "bytes": 30, - "line": 5316 + "line": 5321 }, { "lang": "bash", "meta": null, "sha256": "37f58f218a36b8141bd5c32fb2774d731631774d332ce2fe9f7a3af158f122c1", "bytes": 42, - "line": 5342 + "line": 5347 }, { "lang": "bash", "meta": null, "sha256": "992f83d520658780ee956610f7965ecaad8d3c782b452d78d619edccd3afa26f", "bytes": 29, - "line": 5372 + "line": 5377 }, { "lang": "bash", "meta": null, "sha256": "594f0358c607649151209b234a12f44d7a125fa9150668fbf46ad475c36e52c9", "bytes": 28, - "line": 5392 + "line": 5397 }, { "lang": "bash", "meta": null, "sha256": "1f2babf217eecbcd3edee20e939434b8b177c454ae3edad1ed0a79b24bf0929f", "bytes": 42, - "line": 5415 + "line": 5420 }, { "lang": "bash", "meta": null, "sha256": "d0f3737b421a98903f809a0b9e6dea5cd3bd96377b7dcc30fc5239e3aecf311d", "bytes": 28, - "line": 5457 + "line": 5462 }, { "lang": "bash", "meta": null, "sha256": "aa98bb7f2995f97bb02887ae3591ff0609686e634f9ad60068fbe12f38a4a026", "bytes": 35, - "line": 5490 + "line": 5495 }, { "lang": "bash", "meta": null, "sha256": "e421d326ab72354b8ec1d5711570d31868223c50da978b51961f9896acae5f35", "bytes": 26, - "line": 5521 + "line": 5526 }, { "lang": "bash", "meta": null, "sha256": "65c4b3a60ee39d43b253afd6818ed08dd93a5297f82b4648e4a3d5b0002731e4", "bytes": 32, - "line": 5545 + "line": 5550 }, { "lang": "bash", "meta": null, "sha256": "e2f60ffbb1bae7635a1e9ba79c228b19464a582144e1be50bfaba8d2c2db30c8", "bytes": 27, - "line": 5587 + "line": 5592 }, { "lang": "bash", "meta": null, "sha256": "afa0b971e60daad0dddc74b93f44fac1f51be91d47626ed4942b465fc6eba770", "bytes": 28, - "line": 5609 + "line": 5614 }, { "lang": "bash", "meta": null, "sha256": "4a0236d60519b55978f69d4eaa3ac6b8de2b354a7e63a14255abb64862d0456e", "bytes": 27, - "line": 5639 + "line": 5644 }, { "lang": "bash", "meta": null, "sha256": "ebd45772f099ce26c6315895068a1703d8e757f43daf35f6d3618c408319b37b", "bytes": 37, - "line": 5663 + "line": 5668 }, { "lang": "bash", "meta": null, "sha256": "e6e8ba88a5ede0c440346b124c101ccd53241c492f6dc28c3453fd23b8917cb3", "bytes": 24, - "line": 5693 + "line": 5698 }, { "lang": "bash", "meta": null, "sha256": "c19501e59583b680d6ce36b1133f3850ef1c96d05e7e5985b6cb8b1c5e19ff46", "bytes": 45, - "line": 5713 + "line": 5718 }, { "lang": "bash", "meta": null, "sha256": "4b84b742cd46fa81f9dc42d64c66c4b801b9fc6c381c1fda6690647d082639e3", "bytes": 43, - "line": 5743 + "line": 5748 }, { "lang": "bash", "meta": null, "sha256": "b9eefbf636684f9388fb43e708ad6dd2326b629f85a95e039f69e13651993c41", "bytes": 45, - "line": 5777 + "line": 5782 }, { "lang": "bash", "meta": null, "sha256": "bf2cc4f904e1d46c6ad5fb9c85a1a77b75062b61997add02c5c8d5b4cdcda262", "bytes": 25, - "line": 5808 + "line": 5813 }, { "lang": "bash", "meta": null, "sha256": "eef07048b814eb3b00f997c8b0907d1e21817abad072f7e8502087fdbe9a0188", "bytes": 37, - "line": 5831 + "line": 5836 }, { "lang": "bash", "meta": null, "sha256": "f35ce94c4d5abe5378ba2b6095a786d9989540caefe3b2248b43ec375b69d212", "bytes": 45, - "line": 5869 + "line": 5874 }, { "lang": "bash", "meta": null, "sha256": "f8a9f16a31241f7bed8f14a44cbc6ba4c13707b0bbc71f95abaded420f98cae8", "bytes": 45, - "line": 5901 + "line": 5906 }, { "lang": "bash", "meta": null, "sha256": "6eee9d069d9053a29e2bd61c5a85821fead20cc3af306f55e3597f9931588d32", "bytes": 45, - "line": 5932 + "line": 5937 }, { "lang": "bash", "meta": null, "sha256": "b0485a54f218265aaf8ef27b26af37e80603744b4cd13af804b9460ded6c769c", "bytes": 44, - "line": 5963 + "line": 5968 }, { "lang": "bash", "meta": null, "sha256": "eff43eafc0b5c9829de1e71e899e82b6db9bf5a3ba4da138fe2608ecf2ad96ea", "bytes": 44, - "line": 5998 + "line": 6003 }, { "lang": "bash", "meta": null, "sha256": "598ec0411dcfb12246c2ad819aeb9083cfd0dcf6a894aec2a0e908d82226e85f", "bytes": 32, - "line": 6029 + "line": 6034 }, { "lang": "bash", "meta": null, "sha256": "2869d4bb0b7552d346eca2e8bfe110dccdb3a13073c0e5a531ed34e8d111459f", "bytes": 44, - "line": 6049 + "line": 6054 }, { "lang": "bash", "meta": null, "sha256": "faa95847578604b50b3c020d50d94589351f7b1ec36e28cac7fe2140de6c4549", "bytes": 33, - "line": 6092 + "line": 6097 }, { "lang": "bash", "meta": null, "sha256": "25e24485a99181672176131b6ac2152347841a1a567430fbb98a553a929770f3", "bytes": 47, - "line": 6114 + "line": 6119 }, { "lang": "bash", "meta": null, "sha256": "9720d5ef881383f1c6da7a8a3a008f3afd615af99678d1bb81118511ff84dfcc", "bytes": 42, - "line": 6144 + "line": 6149 }, { "lang": "bash", "meta": null, "sha256": "3b9ac116c754c7e2bcf7f077f6061399dbfff4238408c4ef0d048fb442c3baf8", "bytes": 50, - "line": 6177 + "line": 6182 }, { "lang": "bash", "meta": null, "sha256": "3487041dfbdb03a03ebed0e308da4117442785d83c8158248fbad5df46f35fb2", "bytes": 48, - "line": 6210 + "line": 6215 }, { "lang": "bash", "meta": null, "sha256": "25f7e3715a24bd9657f90a5d9bc466cfe7b121a2660596c62c08a6ae0c4834f2", "bytes": 47, - "line": 6243 + "line": 6248 }, { "lang": "bash", "meta": null, "sha256": "8a310ebdd720a3d0e2fffb7db415873a53befe47ea4d638fca4ecd59ac27595e", "bytes": 40, - "line": 6275 + "line": 6280 }, { "lang": "bash", "meta": null, "sha256": "d3dba384fd5ce87e831b8454186e60d5e1cd6ae404b6324009adf4a961d85cfe", "bytes": 41, - "line": 6308 + "line": 6313 }, { "lang": "bash", "meta": null, "sha256": "4bec76dae83cf450410fd42df2a56ef2b20e69143f9631539a58f363631cb986", "bytes": 41, - "line": 6343 + "line": 6348 }, { "lang": "bash", "meta": null, "sha256": "ad373ebb46a54ef7fead24880468d70c4a415003db879817f5d78e717994573c", "bytes": 50, - "line": 6373 + "line": 6378 }, { "lang": "bash", "meta": null, "sha256": "9f85f14e7c0f00e23c82b9a097ab414df558c764e4171f8bdd6771386b02677c", "bytes": 42, - "line": 6395 + "line": 6400 }, { "lang": "bash", "meta": null, "sha256": "856a70bda3a296ed9e7d3de557191906106fd51da9fab3d2372bd4a3d0115ae1", "bytes": 48, - "line": 6429 + "line": 6434 }, { "lang": "bash", "meta": null, "sha256": "12b44782510d874df9900581914d66e8e8a0708ea6e1f8cab799c1187d4778f2", "bytes": 50, - "line": 6462 + "line": 6467 }, { "lang": "bash", "meta": null, "sha256": "908dcdcee6aa38f9ed48e63e5a70bba22dc7aaa603dfb8c62f0999259a1b9eb1", "bytes": 61, - "line": 6495 + "line": 6500 }, { "lang": "bash", "meta": null, "sha256": "55ea841db41ce49eb504636a54c29187e16b403b686059375abfa8aa51d01f7d", "bytes": 48, - "line": 6526 + "line": 6531 }, { "lang": "bash", "meta": null, "sha256": "c414854798bccb75c4b223fbed069ed445872158dbfb2b23093e140827d1e838", "bytes": 48, - "line": 6561 + "line": 6566 }, { "lang": "bash", "meta": null, "sha256": "9f45f6e6567f09f49ec40484721420a71a15d42f7ab92d3a3cfa1124ab8419fd", "bytes": 36, - "line": 6582 + "line": 6587 }, { "lang": "bash", "meta": null, "sha256": "862b4e873ebd70c303716275ebf30b3822c9c9e7f261a78e27b18f9585d798b0", "bytes": 46, - "line": 6602 + "line": 6607 }, { "lang": "bash", "meta": null, "sha256": "bb65d63f55930b4ea7b86e0475159b98a53e0525015508285c90425f28d53a55", "bytes": 45, - "line": 6623 + "line": 6628 }, { "lang": "bash", "meta": null, "sha256": "18d5a60f518896e595f00666ed45fdd624c789287809e18798e0d9f5610d48c8", "bytes": 43, - "line": 6653 + "line": 6658 }, { "lang": "bash", "meta": null, "sha256": "e44d003a6ba11690de0cc469320be892fae3b09033939a46724fccfb0aac4ab0", "bytes": 48, - "line": 6674 + "line": 6679 }, { "lang": "bash", "meta": null, "sha256": "bee16895751b8f386d2188e18ae402e521187d2bb7da9af709c2432ba9634209", "bytes": 46, - "line": 6697 + "line": 6702 }, { "lang": "bash", "meta": null, "sha256": "d3dede19db079b39e165a036fac3dd3376044ada7849f3ec70220ae188ac28e5", "bytes": 33, - "line": 6727 + "line": 6732 }, { "lang": "bash", "meta": null, "sha256": "0ac8381a83158432224d7b6bead7492d25f36e68eadc15c18e9bf84eddef77d0", "bytes": 42, - "line": 6749 + "line": 6754 }, { "lang": "bash", "meta": null, "sha256": "57308ec7b05d6b120ff6841edb51d8159d84444d6eaf36b3bccb9d1b2bb385e6", "bytes": 27, - "line": 6783 + "line": 6788 }, { "lang": "bash", "meta": null, "sha256": "90b5b274482044f6d036867177353233bf58d00f5dd345f76c0866a23be10343", "bytes": 32, - "line": 6806 + "line": 6811 }, { "lang": "bash", "meta": null, "sha256": "0636f27b84a87525a97146f65475905163efcae563920102110bdaef39d0cbe2", "bytes": 42, - "line": 6828 + "line": 6833 }, { "lang": "bash", "meta": null, "sha256": "36c08c95e7a531c73736416e90aea14eb199ad1746f90a4ecc78db9c037fd03e", "bytes": 33, - "line": 6859 + "line": 6864 }, { "lang": "bash", "meta": null, "sha256": "ab978cbdc23f7d851799251cfe01863187b2cd628b05c3c750ad1db2d26fb5fc", "bytes": 44, - "line": 6884 + "line": 6889 }, { "lang": "bash", "meta": null, "sha256": "2333fb674a47979dc56cf4e10c852516a7d179ddc234cc184130c6e82ae5811b", "bytes": 33, - "line": 6907 + "line": 6912 }, { "lang": "bash", "meta": null, "sha256": "d301cb24422359056dad68402e9f54a8ed15e21c0f183fb4c8eb937738f155dc", "bytes": 43, - "line": 6927 + "line": 6932 }, { "lang": "bash", "meta": null, "sha256": "bd3c423a63ecf70ee28e0c4aa2fe7b9e6078179ec2577ba80004cdfaf527843a", "bytes": 52, - "line": 6960 + "line": 6965 }, { "lang": "bash", "meta": null, "sha256": "a064ea603a971a2a3582988297d7293e6e0c6cabedfad714f2af97c0ff1884e7", "bytes": 39, - "line": 6991 + "line": 6996 }, { "lang": "bash", "meta": null, "sha256": "20d848044f1a1ac09fe6621d3e3f7fe7e2a6271c08e23f5eaea2c4c4b3f21c9d", "bytes": 31, - "line": 7012 + "line": 7017 }, { "lang": "bash", "meta": null, "sha256": "b19fe44255306f492be72ced4183894fe6ab47c5e87ab02cf909c5a6e89ab964", "bytes": 52, - "line": 7032 + "line": 7037 }, { "lang": "bash", "meta": null, "sha256": "0a8251333833585605881b98f9d121fa0e5669e58ba11cb583f69a333cea2ad6", "bytes": 37, - "line": 7069 + "line": 7074 }, { "lang": "bash", "meta": null, "sha256": "3f1de42768c4151cd364eb2534408179e93ca92dda918a493c9d05d4c8f03209", "bytes": 53, - "line": 7099 + "line": 7104 }, { "lang": "bash", "meta": null, "sha256": "60b57e472e506c0d6430f325c0e05c6cdfe9a62b4051a9f371929799ec7cfdef", "bytes": 24, - "line": 7121 + "line": 7126 }, { "lang": "bash", "meta": null, "sha256": "aeea8ffe933fcbb749950596d5c83192d1c42e2dac8f9532625c97afd7fe18a2", "bytes": 25, - "line": 7141 + "line": 7146 }, { "lang": "bash", "meta": null, "sha256": "3010a87af250eea55a7de4dcdda1fdcef515e73b7d2f5977d955f9d66ca4e130", "bytes": 25, - "line": 7166 + "line": 7171 }, { "lang": "bash", "meta": null, "sha256": "4cff190ec4b1d449d089493b45b00f986e3d17e563bca1816769ee3a1cfea2f2", "bytes": 28, - "line": 7188 + "line": 7193 }, { "lang": "bash", "meta": null, "sha256": "b7a3a8b8a114216dbdb506005496e5510feb227b0b6e39ba2b5145743e852577", "bytes": 37, - "line": 7208 + "line": 7213 }, { "lang": "bash", "meta": null, "sha256": "36e0677e842c003940707713b5334c6f2cabdfe6548790bc0c1b8546b0f820b6", "bytes": 32, - "line": 7240 + "line": 7245 }, { "lang": "bash", "meta": null, "sha256": "a9a07815e06f5bab4b2d1fc80a606227a8a617c105c56680c4bef68a520970c1", "bytes": 37, - "line": 7261 + "line": 7266 }, { "lang": "bash", "meta": null, "sha256": "79420742f040a499740d4b465a8e8fdbc628c275fbd2880182637c5917b67b9e", "bytes": 34, - "line": 7298 + "line": 7303 }, { "lang": "bash", "meta": null, "sha256": "a6b4fb5e2728894616f9d11df544879c4786b80458d5905a67ffc2224022ec1e", "bytes": 30, - "line": 7337 + "line": 7342 }, { "lang": "bash", "meta": null, "sha256": "1aa431dc5b8d1fdc3d54a77c56f15a1b9ac5896e343818d3d0ad2edbabc541db", "bytes": 23, - "line": 7368 + "line": 7373 }, { "lang": "bash", "meta": null, "sha256": "262692daffbb55d5cbbf1717fb2c8ff08bc009514bae8ff83ee756d4caba08d1", "bytes": 36, - "line": 7394 + "line": 7399 }, { "lang": "bash", "meta": null, "sha256": "1e9b19a7ea2fdbf0902ed74b48cecc710d7fa2272d4dbed9172af1ae0258310d", "bytes": 22, - "line": 7426 + "line": 7431 }, { "lang": "bash", "meta": null, "sha256": "734b96827127375d652bc125b1c9a243946cf5f8c251b43a7097656fcc2ce544", "bytes": 24, - "line": 7446 + "line": 7451 }, { "lang": "bash", "meta": null, "sha256": "c6544463a5be88fa1bb81e80633a6e4bf70e99d424d408c75930046e74c1dc5f", "bytes": 41, - "line": 7477 + "line": 7482 }, { "lang": "bash", "meta": null, "sha256": "2ba0e68b06d7be939be3058e281cd495a16a41611ae4dadb91c97dea4b95fe29", "bytes": 52, - "line": 7503 + "line": 7508 }, { "lang": "bash", "meta": null, "sha256": "f0f241b97b09236a5fcdc9527cff2f76cf382270caf4315aa8ae11f8ca919932", "bytes": 58, - "line": 7533 + "line": 7538 }, { "lang": "bash", "meta": null, "sha256": "fde5893586a0c2c7cbd2ab3976d7d9ef35e861b56eab07191919891e09528bd4", "bytes": 46, - "line": 7566 + "line": 7571 }, { "lang": "bash", "meta": null, "sha256": "3d28258fd09b2c94b7cb24cb37035ce71d3777b58b2270998781761f8957081e", "bytes": 71, - "line": 7588 + "line": 7593 }, { "lang": "bash", "meta": null, "sha256": "45cdb94cf834d1950ab049a6a65c398b4917312897fdcaa3f25fa0081e707912", "bytes": 39, - "line": 7619 + "line": 7624 }, { "lang": "bash", "meta": null, "sha256": "ac7f120b7e8c39cb3de7b0936dfd2f6d8f38ece480b0523518883cef7b5b643c", "bytes": 39, - "line": 7639 + "line": 7644 }, { "lang": "bash", "meta": null, "sha256": "7994ad60b43332fb5bc583bf1ea5599fa2f659cd8ad811105837cf9e87fa28ed", "bytes": 52, - "line": 7661 + "line": 7666 }, { "lang": "bash", "meta": null, "sha256": "5ed096b4dcf0efad18c54d322d528b7bb0e80336d061ee7eaa5d39d3bd505a4d", "bytes": 62, - "line": 7702 + "line": 7707 }, { "lang": "bash", "meta": null, "sha256": "daf3ccbc5a308bc4c62d1a761e01fac3d40ff67cc256c4c9624d0cd00a0072c4", "bytes": 53, - "line": 7735 + "line": 7740 }, { "lang": "text", "meta": null, - "sha256": "97cc531dfb1566ea12bc24f48050c2c311d6a45510ff45c5708b6f5c216e5e63", - "bytes": 2535, - "line": 7766 + "sha256": "6cf7c87da84d5ace685f6752652f51790aadb86153cc83330070235579ddb15d", + "bytes": 4141, + "line": 7771 }, { "lang": "bash", "meta": null, "sha256": "48ecf1013a285c0de3e23936d53a850d85af0564a7e089de2eba1ac7f8881a44", "bytes": 53, - "line": 7814 + "line": 7833 }, { "lang": "bash", "meta": null, "sha256": "653a412a8eeaffac8afbbbb2533375f02df67fe7ef882ca53fc7ca2755d0bcec", "bytes": 43, - "line": 7847 + "line": 7866 }, { "lang": "bash", "meta": null, "sha256": "bfb90a10455a59ef26068d176221816b9c374c4001d386ffdbb0140c4cfe40ca", "bytes": 40, - "line": 7877 + "line": 7896 }, { "lang": "bash", "meta": null, "sha256": "11658c406271a4f22a346aab51f697bc949342fbaaaabb2a786de824561bc4c3", "bytes": 35, - "line": 7912 + "line": 7931 }, { "lang": "bash", "meta": null, "sha256": "d683e8c6e5a1d063ea9f6c74fd9020d48aede0d5af7031f6f48bd5a173ad2d3d", "bytes": 33, - "line": 7937 + "line": 7956 }, { "lang": "bash", "meta": null, "sha256": "96abc89ee23cb4a7e2fc3caca2afbd2dd57d2734ca9e73816c412a71c5c5eb9d", "bytes": 43, - "line": 7964 + "line": 7983 }, { "lang": "bash", "meta": null, "sha256": "d63bf37625acc32ec1ee6e59a56f57469b9cb4dab03e23067a54d2f7d8abd3a3", "bytes": 41, - "line": 7996 + "line": 8015 }, { "lang": "bash", "meta": null, "sha256": "eb79c561c688b305a39f834bb39d74f65095db957e337d8e6081bbc00545bb08", "bytes": 53, - "line": 8029 + "line": 8048 }, { "lang": "bash", "meta": null, "sha256": "f30977b7b952e6a369b72b828256fac3f9ede78ce6e7c45560a8d09989bd4db5", "bytes": 49, - "line": 8060 + "line": 8079 }, { "lang": "bash", "meta": null, "sha256": "7d00d2a238c8794c5479e28ef14e6e104bcaff1aaaef70a094a2a51c55b6420c", "bytes": 50, - "line": 8081 + "line": 8100 }, { "lang": "bash", "meta": null, "sha256": "f34921d79bc4b608cb3e3c3f882729808afe1d8cf95ca45c63cbdf00ab494a3e", "bytes": 62, - "line": 8112 + "line": 8131 }, { "lang": "bash", "meta": null, "sha256": "ebfb60766394d803a01326b040ac37c5f122134555f1b968aeb6a79b10d74fc7", "bytes": 30, - "line": 8144 + "line": 8163 }, { "lang": "bash", "meta": null, "sha256": "432348582be57741628ca2b6a762c385ed57bbbfd4e4794b914409b7a89db582", "bytes": 35, - "line": 8168 + "line": 8187 }, { "lang": "bash", "meta": null, "sha256": "25d75743717b8e1c96f6b78e334e3e3cbc6dac5e395068308a4e358e06a0bac6", "bytes": 45, - "line": 8190 + "line": 8209 }, { "lang": "bash", "meta": null, "sha256": "2fc4fd97c2a62f635b42d646e481b18b0402ec0d051e7532988c026d838f0534", "bytes": 36, - "line": 8221 + "line": 8240 }, { "lang": "bash", "meta": null, "sha256": "3da31453cf86b97920f8d013f00122dee830af847c064e30ed3e158bd8f642cb", "bytes": 47, - "line": 8246 + "line": 8265 }, { "lang": "bash", "meta": null, "sha256": "d4de05e9142f532574133568e3fe2965c7fd82338e5b54ba0d8ae5713639eaca", "bytes": 43, - "line": 8271 + "line": 8290 }, { "lang": "bash", "meta": null, "sha256": "e63db5a4bab57e3229127bb086d0c5429dfe20de83eaf5097e8943f90520b9b3", "bytes": 51, - "line": 8303 + "line": 8322 }, { "lang": "bash", "meta": null, "sha256": "b130d4ed01c735074275b1505e7959e6dd3ae89c6b7ac159d17ccd495bec8f38", "bytes": 38, - "line": 8333 + "line": 8352 }, { "lang": "bash", "meta": null, "sha256": "32709306f0caabb4378fce9efba6b9c60a3985bb3500402d9a7f9e89fe35e00e", "bytes": 49, - "line": 8357 + "line": 8376 }, { "lang": "bash", "meta": null, "sha256": "a09f283134986b066a49a41c5ef250ff1502ae2adbc3316baacf92712112cc2d", "bytes": 43, - "line": 8399 + "line": 8418 }, { "lang": "bash", "meta": null, "sha256": "d941e4f91a379820ba5d640e7ceffd42c6fdd70b5b19da9c508c259b40ce14f7", "bytes": 53, - "line": 8432 + "line": 8451 }, { "lang": "bash", "meta": null, "sha256": "fb10d8958f9f1b03ab76713459abf552755dae3334103a451c387c9d1c7b3605", "bytes": 40, - "line": 8463 + "line": 8482 }, { "lang": "bash", "meta": null, "sha256": "b5dc1e771889fb1bf5f4d81d340cfd35d3a2263c87a725341d1d5c70405eb78d", "bytes": 43, - "line": 8519 + "line": 8538 }, { "lang": "bash", "meta": null, "sha256": "9065c4d4de3606f4362700b64aa3f856aa75214bebafe9334d48b9ff8466a80c", "bytes": 38, - "line": 8553 + "line": 8572 }, { "lang": "bash", "meta": null, "sha256": "face4eea006073000b49334d0a2bea7f15f9df86cb1f606ac8fe39004c754027", "bytes": 30, - "line": 8573 + "line": 8592 }, { "lang": "bash", "meta": null, "sha256": "29cc30facfddd548aa5873383ac3d90a6b392cf120894fd73a735f266196540d", "bytes": 47, - "line": 8583 + "line": 8602 }, { "lang": "bash", "meta": null, "sha256": "d58dd2280200d928a15de43483c5c709be8aedc38087ba95cbbe2a31a39466fa", "bytes": 49, - "line": 8617 + "line": 8636 }, { "lang": "bash", "meta": null, "sha256": "f43f6a034552660fdb745c0ac0cfe17c1af0c7a2995fd76ab45f79ebfd116bfb", "bytes": 37, - "line": 8654 + "line": 8674 }, { "lang": "bash", "meta": null, "sha256": "529d96c3ff160cf6393f3f7a1f69014d8f2f9f3f3ce5733fc11c58133accb7d7", "bytes": 36, - "line": 8682 + "line": 8703 }, { "lang": "bash", "meta": null, "sha256": "427c626ebed3055c690ff0dbbb3a20550a2daae5ae40f5f9e005f1eb47dd733a", "bytes": 37, - "line": 8709 + "line": 8730 }, { "lang": "bash", "meta": null, "sha256": "e61ba28ca4eef131ee1291f39b5cb583b2a1dd4436bde33a061ce27ac8af05af", "bytes": 46, - "line": 8735 + "line": 8757 }, { "lang": "bash", "meta": null, "sha256": "2b6c40dcef94f6188188d6369383e982f5a6dc88654b8ab76664c189f9af8ab0", "bytes": 47, - "line": 8769 + "line": 8791 }, { "lang": "bash", "meta": null, "sha256": "736889b5b5a59bc4fe7965922999b5cbec295acad8313c1e486d5668c7da961e", "bytes": 30, - "line": 8801 + "line": 8823 }, { "lang": "bash", "meta": null, "sha256": "4d6c0bc0130fd4a83c7b2fcac6f5b4b7bc2f275c05fa6101551ac61ce1405aca", "bytes": 44, - "line": 8821 + "line": 8843 }, { "lang": "bash", "meta": null, "sha256": "62d28b9be74c32c4ba00fefe878c492a6a5c671cc4a500373d7f2bdba9f7ef79", "bytes": 54, - "line": 8841 + "line": 8863 }, { "lang": "bash", "meta": null, "sha256": "185227ff19342ab461c3e652c4158d8ece85c079b2542b9243b7c7cf0b2dac2c", "bytes": 34, - "line": 8871 + "line": 8893 }, { "lang": "bash", "meta": null, "sha256": "7115696baaba8ca1ecd8f7cb22f215b7a53bf13d5757bd6932267644a0377807", "bytes": 36, - "line": 8891 + "line": 8913 }, { "lang": "bash", "meta": null, "sha256": "10330e610f59c2fb169fcff11cb8147563efbcc109f875222ecbfaaa48c05f31", "bytes": 50, - "line": 8913 + "line": 8935 }, { "lang": "bash", "meta": null, "sha256": "e88ab81833a4d529271c80e2cdf0e7ff5037a60066a918a9702a28ceca73a846", "bytes": 30, - "line": 8950 + "line": 8972 }, { "lang": "bash", "meta": null, "sha256": "f094df6732656b52792e5e766a69079c3e8bd929326bda7284e0bcb760bedd79", "bytes": 28, - "line": 8980 + "line": 9002 }, { "lang": "bash", "meta": null, "sha256": "7579bd6ac197afa0afa5f62d9b412a7e265725bd507c1c63b438a60fd72ce1d0", "bytes": 40, - "line": 9007 + "line": 9029 }, { "lang": "bash", "meta": null, "sha256": "63aac11606dc0eeb6cc452c20c405806840960425372cf2cf7c8b4b90a7de878", "bytes": 62, - "line": 9027 + "line": 9049 }, { "lang": "bash", "meta": null, "sha256": "52be4758f4289e9f75875d8401cf57fda54283b2df00e413921d07303e728638", "bytes": 28, - "line": 9058 + "line": 9080 }, { "lang": "bash", "meta": null, "sha256": "4c51312bac2ca9ea2dba0e7cf27f06d5e99502bab35ab569064057a85514cc38", "bytes": 38, - "line": 9079 + "line": 9101 }, { "lang": "bash", "meta": null, "sha256": "2b26aa6f404ab19bda2d846871eb04b732f6397d1899fc28d89a29706fc0a670", "bytes": 34, - "line": 9105 + "line": 9127 }, { "lang": "bash", "meta": null, "sha256": "47af2a240e0fa4bca92d786d1fea2d4b6cd7ee8810c4540b619271457739f829", "bytes": 60, - "line": 9127 + "line": 9149 }, { "lang": "bash", "meta": null, "sha256": "f4a5d9b54707e03cc845a3ffc99493f9990d7c0a0aa96a48a492b303ef1959b4", "bytes": 45, - "line": 9160 + "line": 9182 }, { "lang": "bash", "meta": null, "sha256": "4a4ff033e75c32373422638e4f8079487d9cc37fa2b250cc2907584e690e2699", "bytes": 45, - "line": 9193 + "line": 9215 }, { "lang": "bash", "meta": null, "sha256": "66d1f7b4fc772fcb1ac84bcba2c1aa0e1a26105dda64b564c40dec35fc5fdaf2", "bytes": 43, - "line": 9223 + "line": 9245 }, { "lang": "bash", "meta": null, "sha256": "5fc8d60c19e8e3fc1c640ea87e091d0b95642a210a7e1a7d9d19e527b6f11207", "bytes": 38, - "line": 9255 + "line": 9277 }, { "lang": "bash", "meta": null, "sha256": "a7acb92552eae9b29dd7b973751bb7f3c2f7eb1dc00f36e84c594cb88dd9fc1c", "bytes": 33, - "line": 9276 + "line": 9298 }, { "lang": "bash", "meta": null, "sha256": "bb84857c237d2bfae0c6f63653597fe55263147428a5e8d36ceacfcda6bd6246", "bytes": 26, - "line": 9307 + "line": 9329 }, { "lang": "bash", "meta": null, "sha256": "3e634421662d08fe73882dd6a0d428545c33597790333f83b4c5086c8d494a1e", "bytes": 49, - "line": 9333 + "line": 9355 }, { "lang": "bash", "meta": null, "sha256": "c48dfec9df0cebb16aa976f859770a8b5beb67e2cf01dc5472dd8b3727ea164d", "bytes": 47, - "line": 9353 + "line": 9375 }, { "lang": "bash", "meta": null, "sha256": "8fd3a890425cf05e630bcd969b2aff57b3993d6632d905cab5b23cfce60e425c", "bytes": 49, - "line": 9374 + "line": 9396 }, { "lang": "bash", "meta": null, "sha256": "bd32d826b077176044eabbf175d64a747ba1a826bb36c95efb46925525f75ba9", "bytes": 45, - "line": 9400 + "line": 9422 }, { "lang": "bash", "meta": null, "sha256": "ee94be8e7fcb3c1bdb0abd6991992563371ba113b80b433cce0c71ac499f1d48", "bytes": 43, - "line": 9424 + "line": 9446 }, { "lang": "bash", "meta": null, "sha256": "bbaecaea783d60d4e8cbaad1c6951d2aa5fde5772f050166a24415162d9de3bc", "bytes": 29, - "line": 9446 + "line": 9468 }, { "lang": "bash", "meta": null, "sha256": "627ab83bbee7d7a608e8771c98556a00cb9df200a40fe9b68d79f93c322de59d", "bytes": 18, - "line": 9471 + "line": 9493 }, { "lang": "bash", "meta": null, "sha256": "9396c5d2aba2c0ff0d484a0a778dc38368154eb19edca9372cf576f8abedac90", "bytes": 32, - "line": 9481 + "line": 9503 }, { "lang": "bash", "meta": null, "sha256": "456a3638df3f1208cc5620fe2f7744e60215930e90cdada8c6d3f3041844b81c", "bytes": 22, - "line": 9491 + "line": 9513 }, { "lang": "bash", "meta": null, "sha256": "80c6f38f04b6c653c8de67e79ba7b6ca1a5ec208e8765a036048fd0adc4b4522", "bytes": 37, - "line": 9501 + "line": 9523 }, { "lang": "bash", "meta": null, "sha256": "3be0a5bf2f996779b39f57c35c08a046709ad91ffbb1ecd700c2d0f8a1c9b554", "bytes": 40, - "line": 9526 + "line": 9548 }, { "lang": "bash", "meta": null, "sha256": "94cdaecf523029bf20f25cf278f76142041e4ad9ce6980a0de225f6dd0b93a8f", "bytes": 43, - "line": 9548 + "line": 9570 }, { "lang": "bash", "meta": null, "sha256": "1731734821194e9c9ab5d0e866031dff102eab3c67b81c83780dce706461c802", "bytes": 40, - "line": 9568 + "line": 9590 }, { "lang": "bash", "meta": null, "sha256": "466187fc1a5788ab09d7700cf7cd19c9c541a571d0bc86d70fe52a1eb831b851", "bytes": 54, - "line": 9590 + "line": 9612 }, { "lang": "bash", "meta": null, "sha256": "e10bc7e084ad3b9231262208e0ac216aee47dc0ec7b1507214690ea9c098d5c9", "bytes": 32, - "line": 9622 + "line": 9644 }, { "lang": "bash", "meta": null, "sha256": "6bb0cf09f6bd8ba02e1f24a5eed89b35c0226ec7eefce07502015a455520fd0f", "bytes": 33, - "line": 9632 + "line": 9654 }, { "lang": "bash", "meta": null, "sha256": "23acce8016e243ab651bcc860cd8f1b1d236e6a5b7951abc76282cd674b2a25e", "bytes": 39, - "line": 9655 + "line": 9677 }, { "lang": "bash", "meta": null, "sha256": "210e8ab3d8af173ce648501ca50c828325ac1f4452006ad4485cb7a24d760ae4", "bytes": 37, - "line": 9679 + "line": 9701 }, { "lang": "bash", "meta": null, "sha256": "cdff2d4272d5bc3a18729e63e5ece9053d33ac0f8faf35cfaa3a289baa2dccc1", "bytes": 48, - "line": 9701 + "line": 9723 }, { "lang": "bash", "meta": null, "sha256": "c307203dd609208b90cbc0372e3401a75e943421bdf77e4e10779ed2c89ca4ff", "bytes": 48, - "line": 9731 + "line": 9753 }, { "lang": "bash", "meta": null, "sha256": "f6340c3d5dc4eedb98435df593ff277d0e44fbcb4c61e71a05123267b5352e78", "bytes": 29, - "line": 9761 + "line": 9783 }, { "lang": "bash", "meta": null, "sha256": "ca6e405dc70365db67ec66e6c2499fedf89ae3d7a90f4b5d044a2aab13bb8f37", "bytes": 37, - "line": 9783 + "line": 9805 }, { "lang": "bash", "meta": null, "sha256": "52918df5b4d4003d22322d5785d8a0202a2b66d39a3c71171f92a65545e28788", "bytes": 37, - "line": 9804 + "line": 9826 }, { "lang": "bash", "meta": null, "sha256": "28e77f2a35930390cc7de2fc5abdce7809311c33b10eb749941d5c44b9de0cfa", "bytes": 37, - "line": 9829 + "line": 9851 }, { "lang": "bash", "meta": null, "sha256": "088f9018d5639eac73c710bf1ef4fd134b0cd4c290587a161af1322b415a013f", "bytes": 29, - "line": 9856 + "line": 9878 }, { "lang": "bash", "meta": null, "sha256": "67384a12d7642ea8a82e807a58e42f921ea37cb496e2315ac87368ae0e297e4d", "bytes": 29, - "line": 9888 + "line": 9910 }, { "lang": "bash", "meta": null, "sha256": "4c9e46c0b1c48cb348bfb37e4c705e4dfe1cd5f221d667ebd02dd7325fce7e29", "bytes": 38, - "line": 9920 + "line": 9942 }, { "lang": "bash", "meta": null, "sha256": "20fbb381c0b4ef786f755f485789ecb9e76538ec6394956bb6153ee4a79547ca", "bytes": 31, - "line": 9943 + "line": 9965 }, { "lang": "bash", "meta": null, "sha256": "ec9baafc46bf3e7425a387e9d92083a610028b2f7bf477ccc203fee669796cf1", "bytes": 31, - "line": 9964 + "line": 9986 }, { "lang": "bash", "meta": null, "sha256": "54ffdfd98a1fc3aad38e602c1d02336a81fe97d48e6732402a7980d0f55cb20d", "bytes": 40, - "line": 9985 + "line": 10007 }, { "lang": "bash", "meta": null, "sha256": "1dbcb58a66005a55dccd94c633f3be04c7b462980746ce0bdfc7275bf728f009", "bytes": 35, - "line": 10006 + "line": 10028 }, { "lang": "bash", "meta": null, "sha256": "384da7ccbd87c00eba8c8301b7904ac71161b4faa0f51c208e833ddb1eba9a3c", "bytes": 37, - "line": 10032 + "line": 10054 }, { "lang": "bash", "meta": null, "sha256": "8fae3ef13c962a97565001ae3caa4625cb9df99e17686cf13c6142b0c324a5a6", "bytes": 37, - "line": 10061 + "line": 10084 }, { "lang": "bash", "meta": null, "sha256": "7dc2bd34c299748344eadb6569a96731086b27cc503f1bff70f63a05d41782fb", "bytes": 38, - "line": 10092 + "line": 10115 }, { "lang": "bash", "meta": null, "sha256": "625019ad388b3c98472aa65b7a683a970d0d0060496e89c547c3bbef85afc867", "bytes": 47, - "line": 10121 + "line": 10145 } ], "links": [ @@ -14188,175 +14188,161 @@ "meta": null, "sha256": "b9179e0bca4639a77dbc99a0802c9c18305b65cce5c37ce114b8e215f26070a0", "bytes": 134, - "line": 6 + "line": 10 }, { "lang": "bash", "meta": null, "sha256": "6367a903928d88d568ec633957ade0b5f874989ac59a1cf31c58287830c6c777", "bytes": 170, - "line": 19 + "line": 23 }, { "lang": "bash", "meta": null, "sha256": "61a29fb19683034ec35a9a6cb6caa3a94bbb9b4fd1e8c545fbbd933478ad0844", "bytes": 241, - "line": 33 + "line": 37 }, { "lang": "bash", "meta": null, "sha256": "bc4f2b365fb6d27a0afb6b8ebcdd56e94301c40741300e10ba249e11708274fd", "bytes": 172, - "line": 45 + "line": 49 }, { "lang": "bash", "meta": null, "sha256": "dc652d6ae196b4ad1d37da8dcdee9ae36e1798498e10f94882a117410d43e45f", "bytes": 202, - "line": 56 + "line": 60 }, { "lang": "bash", "meta": null, "sha256": "5e0490835e43a237fec4df37f9bab2c053f332d26b38ae42ea710c1958d66fba", "bytes": 110, - "line": 67 + "line": 71 }, { "lang": "bash", "meta": null, "sha256": "2017d76c972d478c166fc271da149acdf01f3c5906a6b068e07d91b684fc2e24", "bytes": 65, - "line": 75 + "line": 79 }, { "lang": "bash", "meta": null, "sha256": "8237f3c905a4fed316c3cabae5b8cddd72c57d8e3e3abe712ebce4116246f82a", "bytes": 53, - "line": 84 + "line": 88 }, { "lang": "bash", "meta": null, "sha256": "abad6fbd8c82c1eb28d7a7f4b49f8cce9754472b20ffb2613a6a69ae8c2823b4", "bytes": 51, - "line": 92 + "line": 96 }, { "lang": "bash", "meta": null, "sha256": "7f0dad13a24bafce09cf14f505da3d6d956a0431e24845a80cd01b1a775e8374", "bytes": 263, - "line": 98 + "line": 102 }, { "lang": "json", "meta": null, - "sha256": "a19ec054796bc74549f7dbe83949c9eb6c5ae1f54cda5b5c9f8a7e1db5f99d80", - "bytes": 349, - "line": 113 + "sha256": "bf4d32315fcc01d909ecff9703177bc1b53ca17a1c30c875a4824d68e2899fae", + "bytes": 360, + "line": 117 }, { "lang": "bash", "meta": null, "sha256": "068b9eadd1fcffae232855024fdb4ff017b0f010ced2273c53f3b3fd2e898de2", "bytes": 236, - "line": 226 + "line": 176 }, { "lang": "bash", "meta": null, "sha256": "21d6503ee5e2f4362d6d086a74d41704bded199dd6f1a7a2f5760d4c06a78dab", "bytes": 260, - "line": 238 + "line": 188 }, { "lang": "bash", "meta": null, "sha256": "774f1a6b1c5e4ad85fa5551fba8a5faed7d82b3bb25e7d46336fb0b65e1e9522", "bytes": 220, - "line": 257 + "line": 207 }, { "lang": "bash", "meta": null, "sha256": "736d071516b05af975232c48c7e23065fc0334fc07c541ada21a806ea43f84e7", "bytes": 109, - "line": 270 + "line": 220 }, { "lang": "bash", "meta": null, "sha256": "019796d6002868ad852ec9b9bba75bff42f7f8f6eb2073dfb897aa359065721a", "bytes": 159, - "line": 276 + "line": 226 }, { "lang": "bash", "meta": null, "sha256": "3a91f6de422f9407871de6fa5bac996f2337001079def7f966bd0068086d7c63", "bytes": 199, - "line": 285 + "line": 235 }, { "lang": "bash", "meta": null, "sha256": "cdbd2c99596ad694d9ebd9eca43740e8c7371fabba9eca7cc580c16ae96bc800", "bytes": 166, - "line": 302 + "line": 252 }, { "lang": "bash", "meta": null, "sha256": "3edb250258fdf417424a8f185dd601a1a6374ce8b93dd553276cfef39875f959", "bytes": 323, - "line": 317 + "line": 267 }, { "lang": "bash", "meta": null, "sha256": "1d949072a36a628c98e3d17961acc9c59f07edcc89f63413f212adc3baec879e", "bytes": 290, - "line": 326 + "line": 276 }, { "lang": "bash", "meta": null, "sha256": "4cc080decc18686ffbbfe9c5c51c621d23d2b8de9f189ed8145973189681900b", "bytes": 219, - "line": 336 + "line": 286 }, { "lang": "bash", "meta": null, "sha256": "ab8b2eb4638d04f81b66e3eba3d9acfe49e6ae2531094ed48d0d3468537c188b", "bytes": 160, - "line": 343 + "line": 293 }, { "lang": "bash", "meta": "title=\"nightly-digest.sh\"", "sha256": "25d588b87d9f49723f0b1e41edadedfb33ec1eb28460b9b8574d2dfef87a7870", "bytes": 747, - "line": 352 - }, - { - "lang": "yaml", - "meta": "title=\".github/workflows/sim-workspace.yml\"", - "sha256": "9e7ef199fcc3626b482f4377b15d500c8cf417675cdf19fbdcf9188cce424963", - "bytes": 1136, - "line": 382 - }, - { - "lang": "bash", - "meta": null, - "sha256": "3b675df64318861fe48f8c955db2eaee667edaafd4389e2f4bb220fcf5445fee", - "bytes": 75, - "line": 427 + "line": 302 } ], "links": [ @@ -17430,392 +17416,392 @@ "meta": null, "sha256": "f094df6732656b52792e5e766a69079c3e8bd929326bda7284e0bcb760bedd79", "bytes": 28, - "line": 14 + "line": 18 }, { "lang": "bash", "meta": null, "sha256": "736889b5b5a59bc4fe7965922999b5cbec295acad8313c1e486d5668c7da961e", "bytes": 30, - "line": 39 + "line": 43 }, { "lang": "bash", "meta": null, "sha256": "ebfb60766394d803a01326b040ac37c5f122134555f1b968aeb6a79b10d74fc7", "bytes": 30, - "line": 57 + "line": 61 }, { "lang": "bash", "meta": null, "sha256": "66d1f7b4fc772fcb1ac84bcba2c1aa0e1a26105dda64b564c40dec35fc5fdaf2", "bytes": 43, - "line": 79 + "line": 83 }, { "lang": "bash", "meta": null, "sha256": "d941e4f91a379820ba5d640e7ceffd42c6fdd70b5b19da9c508c259b40ce14f7", "bytes": 53, - "line": 109 + "line": 113 }, { "lang": "bash", "meta": null, "sha256": "52be4758f4289e9f75875d8401cf57fda54283b2df00e413921d07303e728638", "bytes": 28, - "line": 138 + "line": 142 }, { "lang": "bash", "meta": null, "sha256": "5fc8d60c19e8e3fc1c640ea87e091d0b95642a210a7e1a7d9d19e527b6f11207", "bytes": 38, - "line": 157 + "line": 161 }, { "lang": "bash", "meta": null, "sha256": "d4de05e9142f532574133568e3fe2965c7fd82338e5b54ba0d8ae5713639eaca", "bytes": 43, - "line": 178 + "line": 182 }, { "lang": "bash", "meta": null, "sha256": "2b26aa6f404ab19bda2d846871eb04b732f6397d1899fc28d89a29706fc0a670", "bytes": 34, - "line": 206 + "line": 210 }, { "lang": "bash", "meta": null, "sha256": "7115696baaba8ca1ecd8f7cb22f215b7a53bf13d5757bd6932267644a0377807", "bytes": 36, - "line": 226 + "line": 230 }, { "lang": "bash", "meta": null, "sha256": "10330e610f59c2fb169fcff11cb8147563efbcc109f875222ecbfaaa48c05f31", "bytes": 50, - "line": 248 + "line": 252 }, { "lang": "bash", "meta": null, "sha256": "185227ff19342ab461c3e652c4158d8ece85c079b2542b9243b7c7cf0b2dac2c", "bytes": 34, - "line": 283 + "line": 287 }, { "lang": "bash", "meta": null, "sha256": "daf3ccbc5a308bc4c62d1a761e01fac3d40ff67cc256c4c9624d0cd00a0072c4", "bytes": 53, - "line": 305 + "line": 309 }, { "lang": "text", "meta": null, - "sha256": "97cc531dfb1566ea12bc24f48050c2c311d6a45510ff45c5708b6f5c216e5e63", - "bytes": 2535, - "line": 336 + "sha256": "6cf7c87da84d5ace685f6752652f51790aadb86153cc83330070235579ddb15d", + "bytes": 4141, + "line": 340 }, { "lang": "bash", "meta": null, "sha256": "48ecf1013a285c0de3e23936d53a850d85af0564a7e089de2eba1ac7f8881a44", "bytes": 53, - "line": 382 + "line": 400 }, { "lang": "bash", "meta": null, "sha256": "a09f283134986b066a49a41c5ef250ff1502ae2adbc3316baacf92712112cc2d", "bytes": 43, - "line": 415 + "line": 433 }, { "lang": "bash", "meta": null, "sha256": "4d6c0bc0130fd4a83c7b2fcac6f5b4b7bc2f275c05fa6101551ac61ce1405aca", "bytes": 44, - "line": 446 + "line": 464 }, { "lang": "bash", "meta": null, "sha256": "62d28b9be74c32c4ba00fefe878c492a6a5c671cc4a500373d7f2bdba9f7ef79", "bytes": 54, - "line": 466 + "line": 484 }, { "lang": "bash", "meta": null, "sha256": "7579bd6ac197afa0afa5f62d9b412a7e265725bd507c1c63b438a60fd72ce1d0", "bytes": 40, - "line": 494 + "line": 512 }, { "lang": "bash", "meta": null, "sha256": "63aac11606dc0eeb6cc452c20c405806840960425372cf2cf7c8b4b90a7de878", "bytes": 62, - "line": 512 + "line": 530 }, { "lang": "bash", "meta": null, "sha256": "7d00d2a238c8794c5479e28ef14e6e104bcaff1aaaef70a094a2a51c55b6420c", "bytes": 50, - "line": 541 + "line": 559 }, { "lang": "bash", "meta": null, "sha256": "f30977b7b952e6a369b72b828256fac3f9ede78ce6e7c45560a8d09989bd4db5", "bytes": 49, - "line": 570 + "line": 588 }, { "lang": "bash", "meta": null, "sha256": "f34921d79bc4b608cb3e3c3f882729808afe1d8cf95ca45c63cbdf00ab494a3e", "bytes": 62, - "line": 589 + "line": 607 }, { "lang": "bash", "meta": null, "sha256": "eb79c561c688b305a39f834bb39d74f65095db957e337d8e6081bbc00545bb08", "bytes": 53, - "line": 619 + "line": 637 }, { "lang": "bash", "meta": null, "sha256": "5ed096b4dcf0efad18c54d322d528b7bb0e80336d061ee7eaa5d39d3bd505a4d", "bytes": 62, - "line": 652 + "line": 670 }, { "lang": "bash", "meta": null, "sha256": "47af2a240e0fa4bca92d786d1fea2d4b6cd7ee8810c4540b619271457739f829", "bytes": 60, - "line": 685 + "line": 703 }, { "lang": "bash", "meta": null, "sha256": "f4a5d9b54707e03cc845a3ffc99493f9990d7c0a0aa96a48a492b303ef1959b4", "bytes": 45, - "line": 718 + "line": 736 }, { "lang": "bash", "meta": null, "sha256": "4a4ff033e75c32373422638e4f8079487d9cc37fa2b250cc2907584e690e2699", "bytes": 45, - "line": 751 + "line": 769 }, { "lang": "bash", "meta": null, "sha256": "fb10d8958f9f1b03ab76713459abf552755dae3334103a451c387c9d1c7b3605", "bytes": 40, - "line": 781 + "line": 799 }, { "lang": "bash", "meta": null, "sha256": "d683e8c6e5a1d063ea9f6c74fd9020d48aede0d5af7031f6f48bd5a173ad2d3d", "bytes": 33, - "line": 833 + "line": 851 }, { "lang": "bash", "meta": null, "sha256": "11658c406271a4f22a346aab51f697bc949342fbaaaabb2a786de824561bc4c3", "bytes": 35, - "line": 858 + "line": 876 }, { "lang": "bash", "meta": null, "sha256": "bfb90a10455a59ef26068d176221816b9c374c4001d386ffdbb0140c4cfe40ca", "bytes": 40, - "line": 883 + "line": 901 }, { "lang": "bash", "meta": null, "sha256": "d63bf37625acc32ec1ee6e59a56f57469b9cb4dab03e23067a54d2f7d8abd3a3", "bytes": 41, - "line": 916 + "line": 934 }, { "lang": "bash", "meta": null, "sha256": "96abc89ee23cb4a7e2fc3caca2afbd2dd57d2734ca9e73816c412a71c5c5eb9d", "bytes": 43, - "line": 949 + "line": 967 }, { "lang": "bash", "meta": null, "sha256": "653a412a8eeaffac8afbbbb2533375f02df67fe7ef882ca53fc7ca2755d0bcec", "bytes": 43, - "line": 981 + "line": 999 }, { "lang": "bash", "meta": null, "sha256": "b130d4ed01c735074275b1505e7959e6dd3ae89c6b7ac159d17ccd495bec8f38", "bytes": 38, - "line": 1013 + "line": 1031 }, { "lang": "bash", "meta": null, "sha256": "32709306f0caabb4378fce9efba6b9c60a3985bb3500402d9a7f9e89fe35e00e", "bytes": 49, - "line": 1037 + "line": 1055 }, { "lang": "bash", "meta": null, "sha256": "e63db5a4bab57e3229127bb086d0c5429dfe20de83eaf5097e8943f90520b9b3", "bytes": 51, - "line": 1081 + "line": 1099 }, { "lang": "bash", "meta": null, "sha256": "b5dc1e771889fb1bf5f4d81d340cfd35d3a2263c87a725341d1d5c70405eb78d", "bytes": 43, - "line": 1113 + "line": 1131 }, { "lang": "bash", "meta": null, "sha256": "4c51312bac2ca9ea2dba0e7cf27f06d5e99502bab35ab569064057a85514cc38", "bytes": 38, - "line": 1145 + "line": 1163 }, { "lang": "bash", "meta": null, "sha256": "e88ab81833a4d529271c80e2cdf0e7ff5037a60066a918a9702a28ceca73a846", "bytes": 30, - "line": 1169 + "line": 1187 }, { "lang": "bash", "meta": null, "sha256": "a7acb92552eae9b29dd7b973751bb7f3c2f7eb1dc00f36e84c594cb88dd9fc1c", "bytes": 33, - "line": 1199 + "line": 1217 }, { "lang": "bash", "meta": null, "sha256": "2fc4fd97c2a62f635b42d646e481b18b0402ec0d051e7532988c026d838f0534", "bytes": 36, - "line": 1228 + "line": 1246 }, { "lang": "bash", "meta": null, "sha256": "432348582be57741628ca2b6a762c385ed57bbbfd4e4794b914409b7a89db582", "bytes": 35, - "line": 1251 + "line": 1269 }, { "lang": "bash", "meta": null, "sha256": "25d75743717b8e1c96f6b78e334e3e3cbc6dac5e395068308a4e358e06a0bac6", "bytes": 45, - "line": 1271 + "line": 1289 }, { "lang": "bash", "meta": null, "sha256": "3da31453cf86b97920f8d013f00122dee830af847c064e30ed3e158bd8f642cb", "bytes": 47, - "line": 1300 + "line": 1318 }, { "lang": "bash", "meta": null, "sha256": "bb84857c237d2bfae0c6f63653597fe55263147428a5e8d36ceacfcda6bd6246", "bytes": 26, - "line": 1321 + "line": 1339 }, { "lang": "bash", "meta": null, "sha256": "29cc30facfddd548aa5873383ac3d90a6b392cf120894fd73a735f266196540d", "bytes": 47, - "line": 1341 + "line": 1359 }, { "lang": "bash", "meta": null, "sha256": "427c626ebed3055c690ff0dbbb3a20550a2daae5ae40f5f9e005f1eb47dd733a", "bytes": 37, - "line": 1373 + "line": 1391 }, { "lang": "bash", "meta": null, "sha256": "f43f6a034552660fdb745c0ac0cfe17c1af0c7a2995fd76ab45f79ebfd116bfb", "bytes": 37, - "line": 1397 + "line": 1416 }, { "lang": "bash", "meta": null, "sha256": "d58dd2280200d928a15de43483c5c709be8aedc38087ba95cbbe2a31a39466fa", "bytes": 49, - "line": 1423 + "line": 1443 }, { "lang": "bash", "meta": null, "sha256": "9065c4d4de3606f4362700b64aa3f856aa75214bebafe9334d48b9ff8466a80c", "bytes": 38, - "line": 1458 + "line": 1479 }, { "lang": "bash", "meta": null, "sha256": "529d96c3ff160cf6393f3f7a1f69014d8f2f9f3f3ce5733fc11c58133accb7d7", "bytes": 36, - "line": 1476 + "line": 1497 }, { "lang": "bash", "meta": null, "sha256": "e61ba28ca4eef131ee1291f39b5cb583b2a1dd4436bde33a061ce27ac8af05af", "bytes": 46, - "line": 1501 + "line": 1522 }, { "lang": "bash", "meta": null, "sha256": "2b6c40dcef94f6188188d6369383e982f5a6dc88654b8ab76664c189f9af8ab0", "bytes": 47, - "line": 1535 + "line": 1556 }, { "lang": "bash", "meta": null, "sha256": "face4eea006073000b49334d0a2bea7f15f9df86cb1f606ac8fe39004c754027", "bytes": 30, - "line": 1565 + "line": 1586 } ], "links": [ @@ -180376,8 +180362,8 @@ { "lang": "json", "meta": null, - "sha256": "a58b8caec4a62b60998e6e861527913aa75c729a95b8772f0bea51b5947f98c3", - "bytes": 302, + "sha256": "2a7fc012d9a65e44b43b9d3a71fc338005cb118dccc142cb009006420d9d329d", + "bytes": 322, "line": 90 }, { @@ -180385,7 +180371,7 @@ "meta": null, "sha256": "202789edbaae3ec51e3c5209888b456b40142eb9151fa7b2a56387b92205b373", "bytes": 135, - "line": 112 + "line": 113 } ], "links": [ diff --git a/apps/sim/app/(auth)/components/social-login-buttons.tsx b/apps/sim/app/(auth)/components/social-login-buttons.tsx index fa7cffde1bf..ea138482548 100644 --- a/apps/sim/app/(auth)/components/social-login-buttons.tsx +++ b/apps/sim/app/(auth)/components/social-login-buttons.tsx @@ -23,7 +23,7 @@ interface SocialLoginButtonsProps { microsoftAvailable: boolean view: 'login' | 'signup' callbackURL?: string - ssoEnabled?: boolean + ssoEnabled: boolean disabled?: boolean } diff --git a/apps/sim/app/(auth)/components/sso-login-button.tsx b/apps/sim/app/(auth)/components/sso-login-button.tsx index bf0e710ef0a..4e993d8980e 100644 --- a/apps/sim/app/(auth)/components/sso-login-button.tsx +++ b/apps/sim/app/(auth)/components/sso-login-button.tsx @@ -1,7 +1,6 @@ 'use client' import { AuthIcon, AuthButton as Chip } from '@sim/auth-ui' import { useRouter } from 'next/navigation' -import { isSsoEnabled } from '@/lib/core/config/env-flags' interface SSOLoginButtonProps { disabled?: boolean @@ -18,10 +17,6 @@ export function SSOLoginButton({ }: SSOLoginButtonProps) { const router = useRouter() - if (!isSsoEnabled) { - return null - } - const handleSSOClick = () => { const ssoUrl = `/sso${callbackURL ? `?callbackUrl=${encodeURIComponent(callbackURL)}` : ''}` router.push(ssoUrl) diff --git a/apps/sim/app/(auth)/login/login-form.tsx b/apps/sim/app/(auth)/login/login-form.tsx index 046e2830c73..5ac641a1ca1 100644 --- a/apps/sim/app/(auth)/login/login-form.tsx +++ b/apps/sim/app/(auth)/login/login-form.tsx @@ -9,7 +9,6 @@ import { useRouter, useSearchParams } from 'next/navigation' import { requestJson } from '@/lib/api/client/request' import { forgetPasswordContract } from '@/lib/api/contracts' import { client } from '@/lib/auth/client' -import { isSsoEnabled } from '@/lib/core/config/env-flags' import { validateCallbackUrl } from '@/lib/core/security/input-validation' import { getBaseUrl } from '@/lib/core/utils/urls' import { quickValidateEmail } from '@/lib/messaging/email/validation' @@ -79,12 +78,15 @@ export default function LoginPage({ googleAvailable, microsoftAvailable, emailPasswordEnabled, + ssoEnabled, }: { githubAvailable: boolean googleAvailable: boolean microsoftAvailable: boolean /** Whether `REGISTRATION_MODE` leaves email/password and email OTP sign-in on. */ emailPasswordEnabled: boolean + /** Whether SAML/OIDC single sign-on is enabled for this deployment. */ + ssoEnabled: boolean }) { const router = useRouter() const searchParams = useSearchParams() @@ -347,7 +349,6 @@ export default function LoginPage({ } } - const ssoEnabled = isSsoEnabled const hasSocial = githubAvailable || googleAvailable || microsoftAvailable const hasOnlySSO = ssoEnabled && !emailPasswordEnabled && !hasSocial const showTopSSO = hasOnlySSO diff --git a/apps/sim/app/(auth)/login/page.tsx b/apps/sim/app/(auth)/login/page.tsx index e5687891917..a53e1fb96b8 100644 --- a/apps/sim/app/(auth)/login/page.tsx +++ b/apps/sim/app/(auth)/login/page.tsx @@ -1,6 +1,6 @@ import { Suspense } from 'react' import type { Metadata } from 'next' -import { isEmailPasswordAuthEnabled } from '@/lib/core/config/env-flags' +import { isEmailPasswordAuthEnabled, isSsoEnabled } from '@/lib/core/config/env-flags' import { getOAuthProviderStatus } from '@/app/(auth)/components/oauth-provider-checker' import LoginLoading from '@/app/(auth)/login/loading' import LoginForm from '@/app/(auth)/login/login-form' @@ -21,6 +21,7 @@ export default async function LoginPage() { googleAvailable={googleAvailable} microsoftAvailable={microsoftAvailable} emailPasswordEnabled={isEmailPasswordAuthEnabled} + ssoEnabled={isSsoEnabled} /> ) diff --git a/apps/sim/app/(auth)/signup/page.tsx b/apps/sim/app/(auth)/signup/page.tsx index aed7c5093b1..2770c8fde10 100644 --- a/apps/sim/app/(auth)/signup/page.tsx +++ b/apps/sim/app/(auth)/signup/page.tsx @@ -1,6 +1,10 @@ import type { Metadata } from 'next' import type { SearchParams } from 'nuqs/server' -import { isEmailSignupAllowed, isSelfServeRegistrationClosed } from '@/lib/core/config/env-flags' +import { + isEmailSignupAllowed, + isSelfServeRegistrationClosed, + isSsoEnabled, +} from '@/lib/core/config/env-flags' import { validateCallbackUrl } from '@/lib/core/security/input-validation' import { isEmailVerificationEffectivelyEnabled } from '@/lib/messaging/email/verification' import { resolveAuthRedirect } from '@/app/(auth)/auth-redirect' @@ -45,6 +49,7 @@ export default async function SignupPage({ microsoftAvailable={microsoftAvailable} emailSignupEnabled={isEmailSignupAllowed} emailVerificationEnabled={isEmailVerificationEffectivelyEnabled()} + ssoEnabled={isSsoEnabled} /> ) } diff --git a/apps/sim/app/(auth)/signup/signup-form.tsx b/apps/sim/app/(auth)/signup/signup-form.tsx index 25cd401aa83..d9c91d4b207 100644 --- a/apps/sim/app/(auth)/signup/signup-form.tsx +++ b/apps/sim/app/(auth)/signup/signup-form.tsx @@ -10,7 +10,6 @@ import { client, useSession } from '@/lib/auth/client' import { DISPOSABLE_EMAIL_ERROR_CODE, DISPOSABLE_EMAIL_MESSAGE } from '@/lib/auth/constants' import { useTrackingConsent } from '@/lib/consent/tracking-consent' import { getEnv } from '@/lib/core/config/env' -import { isSsoEnabled } from '@/lib/core/config/env-flags' import { validateCallbackUrl } from '@/lib/core/security/input-validation' import { quickValidateEmail } from '@/lib/messaging/email/validation' import { captureEvent } from '@/lib/posthog/client' @@ -99,6 +98,8 @@ interface SignupFormProps { emailSignupEnabled: boolean /** Server-derived: verification is enabled AND a mail provider is configured. */ emailVerificationEnabled: boolean + /** Whether SAML/OIDC single sign-on is enabled for this deployment. */ + ssoEnabled: boolean } function SignupFormContent({ @@ -107,6 +108,7 @@ function SignupFormContent({ microsoftAvailable, emailSignupEnabled, emailVerificationEnabled, + ssoEnabled, }: SignupFormProps) { const router = useRouter() const searchParams = useSearchParams() @@ -387,7 +389,6 @@ function SignupFormContent({ } } - const ssoEnabled = isSsoEnabled const hasSocial = githubAvailable || googleAvailable || microsoftAvailable const hasOnlySSO = ssoEnabled && !emailSignupEnabled && !hasSocial const showBottomSection = hasSocial || (ssoEnabled && !hasOnlySSO) @@ -516,6 +517,7 @@ export default function SignupPage({ microsoftAvailable, emailSignupEnabled, emailVerificationEnabled, + ssoEnabled, }: SignupFormProps) { return ( }> @@ -525,6 +527,7 @@ export default function SignupPage({ microsoftAvailable={microsoftAvailable} emailSignupEnabled={emailSignupEnabled} emailVerificationEnabled={emailVerificationEnabled} + ssoEnabled={ssoEnabled} /> ) diff --git a/apps/sim/app/(landing)/components/footer/footer.tsx b/apps/sim/app/(landing)/components/footer/footer.tsx index 84ef7e7aa82..27c8f18d713 100644 --- a/apps/sim/app/(landing)/components/footer/footer.tsx +++ b/apps/sim/app/(landing)/components/footer/footer.tsx @@ -133,6 +133,7 @@ const SOCIAL_LINKS: FooterItem[] = [ href: 'https://github.com/simstudioai/sim', external: true, }, + { label: 'YouTube', href: 'https://www.youtube.com/@simdotai', external: true }, ] const LEGAL_LINKS: FooterItem[] = [ diff --git a/apps/sim/app/(landing)/components/home-faq/faqs.ts b/apps/sim/app/(landing)/components/home-faq/faqs.ts new file mode 100644 index 00000000000..79378841b0b --- /dev/null +++ b/apps/sim/app/(landing)/components/home-faq/faqs.ts @@ -0,0 +1,36 @@ +import { INTEGRATION_COUNT_LABEL } from '@sim/deployment-config/integration-claims' + +/** + * Category questions answer engines ask before they name a product: what Sim is, who can + * build with it, how it is hosted, deployed, and governed. Every answer restates a claim the + * homepage already makes (`HOME_FEATURES`, the security certifications) and names the plan or + * license a claim depends on. The FAQPage JSON-LD reads this same array, so the structured + * answers always equal the visible ones. + * Pricing questions live on `/pricing`; do not repeat them here. + */ +export const HOME_FAQS = [ + { + question: 'Is Sim an AI agent builder?', + answer: `Yes. Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Build an agent visually in the workflow builder, describe it in Chat and let Sim build it, or write it with code through the API and CLI, using ${INTEGRATION_COUNT_LABEL} integrations and every major LLM.`, + }, + { + question: 'Can non-technical teams build AI agents in Sim?', + answer: + 'Yes. In Chat, anyone can describe the agent they need in plain language and Sim builds it. The visual workflow builder shows every step, so teams can review and adjust an agent without writing code, and engineers can extend it with custom functions, the API, or the CLI.', + }, + { + question: 'Is Sim open source, and can I self-host it?', + answer: + "Yes. Sim's core is open source under the Apache 2.0 license and runs in your own cloud with Docker or Kubernetes, or you can use the hosted workspace at sim.ai. Enterprise features such as SSO and access control need a separate license.", + }, + { + question: 'How do teams deploy agents built in Sim?', + answer: + 'Deploy an agent as a chat, an API endpoint, or an MCP server, the standard way other AI tools call an agent. A chat can be public or limited to SSO, specific emails, or a password. Agents can also run on a schedule or start from event triggers in connected apps.', + }, + { + question: 'How does Sim govern AI agents across a company?', + answer: + "Sim's Enterprise plan gives administrators permission groups that control which models, integrations, and tools each team can use, organization and per-member spend limits, audit records, single sign-on with domain verification, and configurable data retention. Every plan traces each run in Logs, and Sim is SOC 2 Type II compliant.", + }, +] as const diff --git a/apps/sim/app/(landing)/components/home-faq/home-faq.tsx b/apps/sim/app/(landing)/components/home-faq/home-faq.tsx new file mode 100644 index 00000000000..f2d02026949 --- /dev/null +++ b/apps/sim/app/(landing)/components/home-faq/home-faq.tsx @@ -0,0 +1,68 @@ +import { ChevronDown, cn } from '@sim/emcn' +import { SITE_URL } from '@/lib/core/utils/urls' +import { HOME_FAQS } from '@/app/(landing)/components/home-faq/faqs' +import { JsonLd } from '@/app/(landing)/components/json-ld' +import { + HOME_INSET, + HOME_TYPE, + LANDING_CONTENT_WIDTH, + LANDING_GUTTER, +} from '@/app/(landing)/components/landing-layout' + +const HOME_FAQ_JSON_LD = { + '@context': 'https://schema.org', + '@type': 'FAQPage', + '@id': `${SITE_URL}#faq`, + mainEntity: HOME_FAQS.map(({ question, answer }) => ({ + '@type': 'Question', + name: question, + acceptedAnswer: { '@type': 'Answer', text: answer }, + })), +} + +/** + * Homepage FAQ with matching `FAQPage` JSON-LD. Native `
` rows keep it a server + * component: the homepage loads its animated islands with `next/dynamic`, and the animated + * `LandingFAQ` would put framer-motion in the initial bundle. Closed answers stay in the HTML. + */ +export function HomeFAQ() { + return ( +
+ +
+

+ Questions teams ask about Sim +

+
+ {HOME_FAQS.map(({ question, answer }, index) => ( +
+ +

{question}

+
+

{answer}

+
+ ))} +
+
+
+ ) +} diff --git a/apps/sim/app/(landing)/components/home-faq/index.ts b/apps/sim/app/(landing)/components/home-faq/index.ts new file mode 100644 index 00000000000..75cdfdc3b0a --- /dev/null +++ b/apps/sim/app/(landing)/components/home-faq/index.ts @@ -0,0 +1,2 @@ +export { HOME_FAQS } from './faqs' +export { HomeFAQ } from './home-faq' diff --git a/apps/sim/app/(landing)/components/index.ts b/apps/sim/app/(landing)/components/index.ts index a34d53b72ed..61e03318d61 100644 --- a/apps/sim/app/(landing)/components/index.ts +++ b/apps/sim/app/(landing)/components/index.ts @@ -11,6 +11,7 @@ export { FeaturedCustomer } from './featured-customer' export { Features } from './features' export { Footer } from './footer' export { Hero } from './hero' +export { HomeFAQ } from './home-faq' export { HomeStructuredData } from './home-structured-data' export type { JsonLdData } from './json-ld' export { JsonLd } from './json-ld' diff --git a/apps/sim/app/(landing)/components/security/components/cert-blocs/cert-blocs.tsx b/apps/sim/app/(landing)/components/security/components/cert-blocs/cert-blocs.tsx index 75b48705b90..5bcbb4727d1 100644 --- a/apps/sim/app/(landing)/components/security/components/cert-blocs/cert-blocs.tsx +++ b/apps/sim/app/(landing)/components/security/components/cert-blocs/cert-blocs.tsx @@ -15,11 +15,17 @@ const SCROLL_PORT_SELECTOR = '.overflow-y-auto' const MARK_STROKES = '[pathLength]' const CERT_MUTED = 'text-[var(--text-muted)]' -const CERTIFICATIONS = [ +interface Certification { + title: string + status?: string + Mark: typeof Soc2TypeIiMark +} + +const CERTIFICATIONS: readonly Certification[] = [ { title: 'SOC 2 Type II', Mark: Soc2TypeIiMark }, - { title: 'ISO 27001', Mark: Iso27001Mark }, + { title: 'ISO 27001', status: 'Certification in progress', Mark: Iso27001Mark }, { title: 'GDPR', Mark: GdprMark }, -] as const +] interface CertBlocsProps { href: string @@ -110,7 +116,7 @@ export function CertBlocs({ href }: CertBlocsProps) { drawn && styles.drawn )} > - {CERTIFICATIONS.map(({ title, Mark }) => ( + {CERTIFICATIONS.map(({ title, status, Mark }) => (
  • {title} + {status && ( + {status} + )} ` is a `flex flex-col` whose `gap` is the single source of truth for * major-section rhythm. Customer proof, platform media, and product controls @@ -67,6 +69,7 @@ export default function Landing() { + ) } diff --git a/apps/sim/app/(landing)/pricing/components/pricing-faq/pricing-faq.tsx b/apps/sim/app/(landing)/pricing/components/pricing-faq/pricing-faq.tsx index 7cbc3413457..4328c1668ac 100644 --- a/apps/sim/app/(landing)/pricing/components/pricing-faq/pricing-faq.tsx +++ b/apps/sim/app/(landing)/pricing/components/pricing-faq/pricing-faq.tsx @@ -5,6 +5,8 @@ import { DEFAULT_FREE_CREDITS, MAX_CREDIT_TIER, PRO_CREDIT_TIER, + PRO_TRIAL_DAYS, + PRO_TRIAL_USAGE_LIMIT_DOLLARS, } from '@/lib/billing/constants' import { SITE_URL } from '@/lib/core/utils/urls' import { JsonLd } from '@/app/(landing)/components/json-ld' @@ -22,6 +24,10 @@ const PRICING_FAQS = [ question: 'Is Sim free?', answer: `Yes. The Free plan costs $0 and includes ${formatCredits(DEFAULT_FREE_CREDITS * CREDITS_PER_DOLLAR)} one-time credits, one workspace, and all ${INTEGRATION_COUNT_LABEL} integrations, with no credit card required. On Free, models and tools run on your own provider keys; Sim-hosted keys come with paid plans. Sim is also open source, so you can self-host it for free.`, }, + { + question: 'Does Sim have a free trial?', + answer: `Yes. New Pro subscribers get a ${PRO_TRIAL_DAYS}-day free trial with ${formatCredits(PRO_TRIAL_USAGE_LIMIT_DOLLARS * CREDITS_PER_DOLLAR)} credits, including Sim-hosted models and tools. A card is required at checkout and is charged for Pro when the trial ends unless you cancel first. Each account and card can start one trial.`, + }, { question: 'How much does Sim cost?', answer: `Pro is $${PRO_CREDIT_TIER.dollars} per user per month with ${formatCredits(PRO_CREDIT_TIER.credits)} credits a month and a weekly refresh of ${formatCredits(PRO_CREDIT_TIER.weeklyRefreshCredits)} more. Max is $${MAX_CREDIT_TIER.dollars} per user per month with ${formatCredits(MAX_CREDIT_TIER.credits)} credits a month and a weekly refresh of ${formatCredits(MAX_CREDIT_TIER.weeklyRefreshCredits)}. Annual billing costs ${ANNUAL_DISCOUNT_RATE * 100}% less for the same credits. Enterprise pricing is custom.`, diff --git a/apps/sim/app/_styles/globals.css b/apps/sim/app/_styles/globals.css index 78b947eac66..ae00386a2e5 100644 --- a/apps/sim/app/_styles/globals.css +++ b/apps/sim/app/_styles/globals.css @@ -431,7 +431,6 @@ --auth-primary-btn-text: #000000; --auth-primary-btn-hover-bg: #e0e0e0; --auth-primary-btn-hover-border: #e0e0e0; - --auth-primary-btn-hover-text: #000000; /* z-index scale. The toast/notification stack is ambient: it sits above page content but BELOW the modal and the transient poppers (menus, selects, diff --git a/apps/sim/app/api/billing/update-cost/route.ts b/apps/sim/app/api/billing/update-cost/route.ts index 08c7f941e1c..27f1f545485 100644 --- a/apps/sim/app/api/billing/update-cost/route.ts +++ b/apps/sim/app/api/billing/update-cost/route.ts @@ -23,7 +23,7 @@ import { toBillingContext, } from '@/lib/billing/core/attribution' import { - isFreeRunPayer, + isCappedRunPayer, type MidRunUsageVerdict, readMidRunAccountUsageVerdict, readMidRunUsageVerdict, @@ -88,7 +88,7 @@ function invalidBillingProtocolResponse(requestId: string, span: Span): NextResp * A duplicate callback answers too: it is often a retry whose first answer was lost. The charge * is already recorded when this runs. * - * A free payer's spend past its limit is never billed, so its standing is read from the ledger + * A capped payer's spend past its limit is never billed, so its standing is read from the ledger * on every callback, and a standing that cannot be read (a gate that cannot answer, or a read * that outlasts {@link USAGE_STANDING_TIMEOUT_MS}) pauses the run. A paid payer's admission is * cached per payer and actor (briefly once near the limit) and a refusal is always re-read, so @@ -101,7 +101,7 @@ async function readUsageStanding( billingAttribution: BillingAttributionSnapshot | undefined, accountDecision: AccountBillingDecision | undefined ): Promise { - const readOptions = { uncachedForFreePayer: true } + const readOptions = { uncachedForCappedPayer: true } const payer = billingAttribution ?? accountDecision const readVerdict = billingAttribution ? () => readMidRunUsageVerdict(billingAttribution, 0, readOptions) @@ -109,12 +109,12 @@ async function readUsageStanding( ? () => readMidRunAccountUsageVerdict(accountDecision, readOptions) : null if (!isHosted || !payer || !readVerdict) return { usageExceeded: false } - const freePayer = isFreeRunPayer(payer) + const cappedPayer = isCappedRunPayer(payer) let verdict: MidRunUsageVerdict try { verdict = await withinDeadline(readVerdict, Date.now() + USAGE_STANDING_TIMEOUT_MS) } catch { - logger.warn('Usage standing read outlasted the callback budget', { freePayer }) + logger.warn('Usage standing read outlasted the callback budget', { cappedPayer }) verdict = { status: 'unknown' } } if (verdict.status === 'exceeded') { @@ -129,7 +129,7 @@ async function readUsageStanding( } // A blocked account is refused at the run's next continuation or re-check, with // blocked-account copy rather than the upgrade card. - if (verdict.status !== 'unknown' || !freePayer) return { usageExceeded: false } + if (verdict.status !== 'unknown' || !cappedPayer) return { usageExceeded: false } return { usageExceeded: true, usageUpgrade: await resolveUsageUpgradePayload(userId, { diff --git a/apps/sim/app/api/copilot/api-keys/validate/route.test.ts b/apps/sim/app/api/copilot/api-keys/validate/route.test.ts index 160e3c756fd..48393fb1648 100644 --- a/apps/sim/app/api/copilot/api-keys/validate/route.test.ts +++ b/apps/sim/app/api/copilot/api-keys/validate/route.test.ts @@ -71,7 +71,7 @@ const ATTRIBUTION = { payerSubscription: null, } -const ACCOUNT_SUBSCRIPTION = { id: 'account-subscription' } +const ACCOUNT_SUBSCRIPTION = { id: 'account-subscription', plan: 'pro_6000', status: 'active' } const ACCOUNT_BILLING_DECISION = { userId: 'user-1', billingEntity: { type: 'organization' as const, id: 'account-org' }, @@ -463,7 +463,11 @@ describe('POST /api/copilot/api-keys/validate billing protocols', () => { expect(mockGetWorkspaceBillingSettings).not.toHaveBeenCalled() expect( JSON.parse(decodeURIComponent(res.headers.get('x-sim-billing-account-decision') ?? '')) - ).toEqual({ ...ACCOUNT_BILLING_DECISION, payerSubscriptionId: ACCOUNT_SUBSCRIPTION.id }) + ).toEqual({ + ...ACCOUNT_BILLING_DECISION, + payerSubscriptionId: ACCOUNT_SUBSCRIPTION.id, + payerBillsOverage: true, + }) }) it('fails direct-v1 admission closed when its payer cannot be resolved', async () => { diff --git a/apps/sim/app/api/copilot/api-keys/validate/route.ts b/apps/sim/app/api/copilot/api-keys/validate/route.ts index 242cd8ea90f..5d4e4c9a513 100644 --- a/apps/sim/app/api/copilot/api-keys/validate/route.ts +++ b/apps/sim/app/api/copilot/api-keys/validate/route.ts @@ -28,13 +28,14 @@ import { } from '@/lib/billing/core/attribution' import { payerHasChatAccess } from '@/lib/billing/core/chat-access' import { - isFreeRunPayer, + isCappedRunPayer, readMidRunAccountUsageVerdict, readMidRunUsageVerdict, } from '@/lib/billing/core/mid-run-usage' import { getHighestPrioritySubscription } from '@/lib/billing/core/plan' import { isEnterprisePlan } from '@/lib/billing/core/subscription' import { deriveBillingContext } from '@/lib/billing/core/usage-log' +import { billsOverage } from '@/lib/billing/subscriptions/utils' import { resolveUsageUpgradePayload, type UsageUpgradePayer } from '@/lib/billing/usage-upgrade' import { isBillingEnabled, isHosted } from '@/lib/core/config/env-flags' import { asOrchestrationError } from '@/lib/core/orchestration/types' @@ -292,6 +293,7 @@ async function checkAdmissionUsage(admission: AdmissionBillingDecision): Promise : {}), }, ...(subscription ? { payerSubscriptionId: subscription.id } : {}), + payerBillsOverage: billsOverage(subscription), }, } } @@ -431,7 +433,7 @@ export const POST = withRouteHandler((req: NextRequest) => }) // A continuation, and a worker's periodic re-check of a long run, also reads the // original payer's spend through the cached execution usage gate. A read that fails - // refuses a free payer, whose spend past the limit is never billed, and admits a paid + // refuses a capped payer, whose spend past the limit is never billed, and admits a paid // one: the run is already under way, and the next re-check reads again. const verdict = !blocked?.blocked && purpose === COPILOT_VALIDATION_PURPOSE.continuation && billing @@ -458,14 +460,14 @@ export const POST = withRouteHandler((req: NextRequest) => { status: 402 } ) } - const unreadFreePayer = + const unreadCappedPayer = verdict?.status === 'unknown' && billing !== null && - isFreeRunPayer(billing.kind === 'attributed' ? billing.attribution : billing.decision) - if (verdict?.status === 'exceeded' || unreadFreePayer) { + isCappedRunPayer(billing.kind === 'attributed' ? billing.attribution : billing.decision) + if (verdict?.status === 'exceeded' || unreadCappedPayer) { logger.info('[API VALIDATION] Continuation usage exceeded', { userId, - unread: unreadFreePayer, + unread: unreadCappedPayer, }) span.setAttribute( TraceAttr.CopilotValidateOutcome, diff --git a/apps/sim/app/api/providers/ollama/models/route.test.ts b/apps/sim/app/api/providers/ollama/models/route.test.ts index c815c43c360..0ff9e7c3d6d 100644 --- a/apps/sim/app/api/providers/ollama/models/route.test.ts +++ b/apps/sim/app/api/providers/ollama/models/route.test.ts @@ -1,6 +1,6 @@ import { createMockRequest, resetEnvFlagsMock, setEnvFlags } from '@sim/testing' +import { setEnv } from '@sim/testing/mocks/env.mock' import { providersUtilsMock, providersUtilsMockFns } from '@sim/testing/mocks/providers-utils.mock' -import { urlsMockFns } from '@sim/testing/mocks/urls.mock' import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest' const mockFetch = vi.hoisted(() => vi.fn()) @@ -10,13 +10,12 @@ vi.mock('@/providers/utils', () => providersUtilsMock) import { GET } from '@/app/api/providers/ollama/models/route' const { mockFilterBlacklistedModels, mockIsProviderBlacklisted } = providersUtilsMockFns -const mockIsOllamaUrlConfigured = urlsMockFns.mockIsOllamaUrlConfigured const request = () => createMockRequest('GET') describe('ollama models route', () => { beforeEach(() => { - mockIsOllamaUrlConfigured.mockReturnValue(false) + setEnv({ OLLAMA_URL: undefined }) mockIsProviderBlacklisted.mockReturnValue(false) mockFilterBlacklistedModels.mockImplementation((models: string[]) => models) vi.stubGlobal('fetch', mockFetch) @@ -36,7 +35,7 @@ describe('ollama models route', () => { it('still honours an explicit OLLAMA_URL on the hosted platform', async () => { setEnvFlags({ isHosted: true }) - mockIsOllamaUrlConfigured.mockReturnValue(true) + setEnv({ OLLAMA_URL: 'http://ollama.internal:11434' }) mockFetch.mockResolvedValue({ ok: true, json: async () => ({ models: [{ name: 'llama3' }] }) }) const response = await GET(request()) diff --git a/apps/sim/app/api/providers/ollama/models/route.ts b/apps/sim/app/api/providers/ollama/models/route.ts index 13274f69d6e..f32075c02d9 100644 --- a/apps/sim/app/api/providers/ollama/models/route.ts +++ b/apps/sim/app/api/providers/ollama/models/route.ts @@ -5,10 +5,9 @@ import { ollamaUpstreamResponseSchema, providerModelsResponseSchema, } from '@/lib/api/contracts/providers' -import { isHosted } from '@/lib/core/config/env-flags' -import { getOllamaUrl, isOllamaUrlConfigured } from '@/lib/core/utils/urls' +import { getOllamaUrl, isOllamaAvailable } from '@/lib/core/utils/urls' import { withRouteHandler } from '@/lib/core/utils/with-route-handler' -import { filterBlacklistedModels, isProviderBlacklisted } from '@/providers/utils' +import { filterBlacklistedModels } from '@/providers/utils' const logger = createLogger('OllamaModelsAPI') const OLLAMA_HOST = getOllamaUrl() @@ -17,23 +16,16 @@ const OLLAMA_HOST = getOllamaUrl() * Get available Ollama models */ export const GET = withRouteHandler(async (_request: NextRequest) => { - if (isProviderBlacklisted('ollama')) { - logger.info('Ollama provider is blacklisted, returning empty models') - return NextResponse.json({ models: [] }) - } - /** - * Ollama runs alongside the app it serves, so the hosted platform never has one - * and `OLLAMA_URL`'s loopback default cannot answer there. Skip the probe rather - * than dial an address known to refuse on every poll. - * - * Only the unconfigured default is skipped: an explicit `OLLAMA_URL` states an - * intent to reach a real server and is still honoured. Self-hosted deployments - * are untouched either way, including the localhost default that needs no - * configuration to work. + * Ollama runs alongside the app it serves, so the hosted platform never has one and + * `OLLAMA_URL`'s loopback default cannot answer there: skip the probe rather than dial an + * address known to refuse on every poll. An explicit `OLLAMA_URL` is still honoured, and + * self-hosted deployments probe the localhost default that needs no configuration. */ - if (isHosted && !isOllamaUrlConfigured()) { - logger.info('Ollama is not available on the hosted platform, returning empty models') + if (!isOllamaAvailable()) { + logger.info( + 'Ollama is blacklisted or not configured on this deployment, returning empty models' + ) return NextResponse.json({ models: [] }) } diff --git a/apps/sim/app/api/resume/[workflowId]/[executionId]/[contextId]/route.test.ts b/apps/sim/app/api/resume/[workflowId]/[executionId]/[contextId]/route.test.ts index 54f3a68e6e1..8d06460b71e 100644 --- a/apps/sim/app/api/resume/[workflowId]/[executionId]/[contextId]/route.test.ts +++ b/apps/sim/app/api/resume/[workflowId]/[executionId]/[contextId]/route.test.ts @@ -480,6 +480,7 @@ describe('POST /api/resume/[workflowId]/[executionId]/[contextId]', () => { success: false, status: 'failed', output: { partial: true }, + paused: null, error: 'Route: Condition evaluation failed', structuredError: { message: 'Condition evaluation failed', diff --git a/apps/sim/app/api/users/me/subscription/[id]/transfer/route.ts b/apps/sim/app/api/users/me/subscription/[id]/transfer/route.ts index 161349f2ffb..5f6d8a8f596 100644 --- a/apps/sim/app/api/users/me/subscription/[id]/transfer/route.ts +++ b/apps/sim/app/api/users/me/subscription/[id]/transfer/route.ts @@ -17,6 +17,7 @@ import { isOrgPlan } from '@/lib/billing/plan-helpers' import { ENTITLED_SUBSCRIPTION_STATUSES, hasPaidSubscriptionStatus, + isTrialingSubscription, } from '@/lib/billing/subscriptions/utils' import { withRouteHandler } from '@/lib/core/utils/with-route-handler' import { captureServerEvent } from '@/lib/posthog/server' @@ -70,6 +71,14 @@ export const POST = withRouteHandler( } } + if (isTrialingSubscription(sub)) { + return { + kind: 'error', + status: 400, + error: 'A subscription in its free trial can be transferred once the trial ends.', + } + } + const [org] = await tx .select({ id: organization.id }) .from(organization) diff --git a/apps/sim/app/api/v1/admin/credits/route.ts b/apps/sim/app/api/v1/admin/credits/route.ts index f2179c2a31d..72ce4241e4f 100644 --- a/apps/sim/app/api/v1/admin/credits/route.ts +++ b/apps/sim/app/api/v1/admin/credits/route.ts @@ -114,7 +114,6 @@ export const POST = withRouteHandler( let entityType: 'user' | 'organization' let entityId: string - const plan = userSubscription.plan let seats: number | null = null // Route admin credits to the subscription's entity (org if org-scoped). @@ -181,7 +180,7 @@ export const POST = withRouteHandler( newCreditBalance = Number.parseFloat(stats?.creditBalance || '0') } - await setUsageLimitForCredits(entityType, entityId, plan, seats, newCreditBalance) + await setUsageLimitForCredits(entityType, entityId, userSubscription, seats, newCreditBalance) let newUsageLimit: number if (entityType === 'organization') { diff --git a/apps/sim/app/api/v2/logs/[runId]/route.test.ts b/apps/sim/app/api/v2/logs/[runId]/route.test.ts index e2a5123e3b8..4833b786ca6 100644 --- a/apps/sim/app/api/v2/logs/[runId]/route.test.ts +++ b/apps/sim/app/api/v2/logs/[runId]/route.test.ts @@ -105,6 +105,253 @@ describe('GET /api/v2/logs/[runId]', () => { }) }) + /** + * A reader scanning a long record for why a run failed used to find it only past + * the workflow state, inside the spans. The failed block leads the record instead. + */ + it('leads with the block the run failed in and the error it recorded', async () => { + mocks.execute.mockResolvedValue({ + log: { ...log, status: 'failed', level: 'error' }, + workflowFolderPath: '/agents', + executionData: { + traceSpans: [ + { + id: 'workflow-execution', + name: 'Workflow Execution', + type: 'workflow', + duration: 120, + status: 'error', + startTime: '2026-08-06T00:00:00.000Z', + endTime: '2026-08-06T00:00:00.120Z', + children: [ + { + id: 'span-fn', + blockId: 'block-fn', + name: 'Score', + type: 'function', + duration: 10, + status: 'error', + startTime: '2026-08-06T00:00:00.010Z', + endTime: '2026-08-06T00:00:00.020Z', + output: { + error: 'Line 3: boom\nthrow new Error("boom")', + errorMessage: 'boom', + }, + }, + ], + }, + ], + finalOutput: null, + }, + }) + + const response = await GET(new NextRequest('http://localhost:3000/api/v2/logs/run-1'), { + params: Promise.resolve({ runId: 'run-1' }), + }) + const { data } = await response.json() + + expect(data.failure).toEqual({ + blockId: 'block-fn', + blockName: 'Score', + blockType: 'function', + error: 'Line 3: boom\nthrow new Error("boom")', + errorMessage: 'boom', + }) + const keys = Object.keys(data) + expect(keys.indexOf('failure')).toBeLessThan(keys.indexOf('workflowState')) + expect(keys.indexOf('failure')).toBeLessThan(keys.indexOf('traceSpans')) + }) + + /** + * Two parallel blocks failing in the same instant leave the trace unable to say which + * one ended the run; the run's own error names it. + */ + it('uses the run error to pick between blocks that failed together', async () => { + const failedBlock = (blockId: string, name: string) => ({ + id: `span-${blockId}`, + blockId, + name, + type: 'agent', + duration: 10, + status: 'error', + startTime: '2026-08-06T00:00:00.000Z', + endTime: '2026-08-06T00:00:01.000Z', + output: { error: `${name} failed` }, + }) + mocks.execute.mockResolvedValue({ + log: { ...log, status: 'failed', level: 'error' }, + workflowFolderPath: '/agents', + executionData: { + traceSpans: [ + { + id: 'workflow-execution', + name: 'Workflow Execution', + type: 'workflow', + duration: 1000, + status: 'error', + startTime: '2026-08-06T00:00:00.000Z', + endTime: '2026-08-06T00:00:01.000Z', + children: [failedBlock('a', 'Agent A'), failedBlock('b', 'Agent B')], + }, + ], + finalizationPath: 'force_failed', + completionFailure: 'Agent B: timeout', + finalOutput: { error: 'Agent B: timeout' }, + }, + }) + + const response = await GET(new NextRequest('http://localhost:3000/api/v2/logs/run-1'), { + params: Promise.resolve({ runId: 'run-1' }), + }) + + expect((await response.json()).data.failure).toMatchObject({ blockId: 'b' }) + }) + + it('reads a run error recorded as an object with a message', async () => { + const failedBlock = (blockId: string, name: string) => ({ + id: `span-${blockId}`, + blockId, + name, + type: 'agent', + duration: 10, + status: 'error', + startTime: '2026-08-06T00:00:00.000Z', + endTime: '2026-08-06T00:00:01.000Z', + output: { error: `${name} failed` }, + }) + mocks.execute.mockResolvedValue({ + log: { ...log, status: 'failed', level: 'error' }, + workflowFolderPath: '/agents', + executionData: { + traceSpans: [ + { + id: 'workflow-execution', + name: 'Workflow Execution', + type: 'workflow', + duration: 1000, + status: 'error', + startTime: '2026-08-06T00:00:00.000Z', + endTime: '2026-08-06T00:00:01.000Z', + children: [failedBlock('a', 'Agent A'), failedBlock('b', 'Agent B')], + }, + ], + error: { message: 'Agent B: timeout' }, + }, + }) + + const response = await GET(new NextRequest('http://localhost:3000/api/v2/logs/run-1'), { + params: Promise.resolve({ runId: 'run-1' }), + }) + + expect((await response.json()).data.failure).toMatchObject({ blockId: 'b' }) + }) + + it('reports no failure for a cancelled run that kept error spans', async () => { + mocks.execute.mockResolvedValue({ + log: { ...log, status: 'cancelled', level: 'error' }, + workflowFolderPath: '/agents', + executionData: { + traceSpans: [ + { + id: 'span-fn', + blockId: 'block-fn', + name: 'Score', + type: 'function', + duration: 10, + status: 'error', + startTime: '2026-08-06T00:00:00.010Z', + endTime: '2026-08-06T00:00:00.020Z', + output: { error: 'aborted' }, + }, + ], + finalOutput: null, + }, + }) + + const response = await GET(new NextRequest('http://localhost:3000/api/v2/logs/run-1'), { + params: Promise.resolve({ runId: 'run-1' }), + }) + + expect((await response.json()).data.failure).toBeNull() + }) + + it('names no block when the run error matches none of the failed ones', async () => { + mocks.execute.mockResolvedValue({ + log: { ...log, status: 'failed', level: 'error' }, + workflowFolderPath: '/agents', + executionData: { + traceSpans: [ + { + id: 'span-fn', + blockId: 'block-fn', + name: 'Score', + type: 'function', + duration: 10, + status: 'error', + startTime: '2026-08-06T00:00:00.010Z', + endTime: '2026-08-06T00:00:00.020Z', + output: { error: 'Score failed' }, + }, + ], + finalizationPath: 'force_failed', + completionFailure: 'upstream returned 500', + finalOutput: { error: 'upstream returned 500' }, + }, + }) + + const response = await GET(new NextRequest('http://localhost:3000/api/v2/logs/run-1'), { + params: Promise.resolve({ runId: 'run-1' }), + }) + + expect((await response.json()).data.failure).toBeNull() + }) + + /** + * A run whose status comes from a block's error keeps the workflow's own `finalOutput`, which + * can hold an `error` field of its own: that is the workflow's data, not the run's error. + */ + it('names the failed block of a run whose workflow output holds an error field of its own', async () => { + mocks.execute.mockResolvedValue({ + log: { ...log, status: 'failed', level: 'error' }, + workflowFolderPath: '/agents', + executionData: { + traceSpans: [ + { + id: 'span-fn', + blockId: 'block-fn', + name: 'Score', + type: 'function', + duration: 10, + status: 'error', + startTime: '2026-08-06T00:00:00.010Z', + endTime: '2026-08-06T00:00:00.020Z', + output: { error: 'Line 1 - boom' }, + }, + ], + finalizationPath: 'completed', + finalOutput: { error: 'no matching customer' }, + }, + }) + + const response = await GET(new NextRequest('http://localhost:3000/api/v2/logs/run-1'), { + params: Promise.resolve({ runId: 'run-1' }), + }) + + expect((await response.json()).data.failure).toMatchObject({ + blockId: 'block-fn', + blockName: 'Score', + error: 'Line 1 - boom', + }) + }) + + it('reports no failure for a run whose trace has none', async () => { + const response = await GET(new NextRequest('http://localhost:3000/api/v2/logs/run-1'), { + params: Promise.resolve({ runId: 'run-1' }), + }) + + expect((await response.json()).data.failure).toBeNull() + }) + /** * Stored spans carry only `duration`; the contract publishes `durationMs` * beside it, and readers that trusted the documented name found it empty on diff --git a/apps/sim/app/api/v2/logs/[runId]/route.ts b/apps/sim/app/api/v2/logs/[runId]/route.ts index 8b9847a31e3..780972b2af6 100644 --- a/apps/sim/app/api/v2/logs/[runId]/route.ts +++ b/apps/sim/app/api/v2/logs/[runId]/route.ts @@ -4,8 +4,9 @@ import { defineV2JsonRoute, v2ApiKeyAuth, v2RateLimits } from '@/lib/api/server/ import { v2LogErrorPolicies } from '@/lib/logs/api/route-policies' import { getPublicLog } from '@/lib/logs/application/get-public-log' import { logOperations } from '@/lib/logs/application/operations' -import { withSpanDurationMs } from '@/lib/logs/execution/trace-spans/trace-spans' +import { findTraceFailure, withSpanDurationMs } from '@/lib/logs/execution/trace-spans/trace-spans' import { projectLogFiles } from '@/lib/logs/files' +import { runFailureMessage } from '@/lib/workflows/executor/failure-message' export const revalidate = 0 @@ -26,6 +27,16 @@ function buildCostProjection( return null } +/** + * Where a failed run failed. The run's own error names the block when several failed in the same + * instant; one that names none of them yields no failure rather than an unrelated block, as the + * status read does. A run that did not fail (a cancelled one keeps its abort spans) has none. + */ +function failureOf(status: string, executionData: Record): V2LogDetail['failure'] { + if (status !== 'failed') return null + return findTraceFailure(executionData.traceSpans, runFailureMessage(executionData)) +} + /** * Returns the diagnostic representation of a run. The run ID is the sole * public identity; canonical workflow and workspace scope come from the run. @@ -52,6 +63,7 @@ export const GET = defineV2JsonRoute({ startedAt: log.startedAt.toISOString(), endedAt: log.endedAt ? log.endedAt.toISOString() : null, totalDurationMs: log.totalDurationMs, + failure: failureOf(log.status, executionData), files: projectLogFiles(log), executedByEmail: log.executedByEmail, workflow: { diff --git a/apps/sim/app/api/v2/workflows/[workflowId]/execute/route.test.ts b/apps/sim/app/api/v2/workflows/[workflowId]/execute/route.test.ts index 0f8ecd035de..b6e70d1d042 100644 --- a/apps/sim/app/api/v2/workflows/[workflowId]/execute/route.test.ts +++ b/apps/sim/app/api/v2/workflows/[workflowId]/execute/route.test.ts @@ -333,6 +333,32 @@ describe('POST /api/v2/workflows/[workflowId]/execute', () => { }) }) + it('names where a paused run waits: the run to resume and each pause point', async () => { + mockExecuteWorkflowCore.mockResolvedValueOnce({ + success: true, + status: 'paused', + output: {}, + pausePoints: [ + { contextId: 'ctx-1', pauseKind: 'human', resumeStatus: 'paused' }, + { contextId: 'ctx-2', pauseKind: 'time', resumeStatus: 'paused' }, + ], + metadata: { duration: 5 }, + }) + + const body = await (await callExecute({ input: {} })).json() + + expect(body.data).toMatchObject({ + status: 'paused', + paused: { + runId: 'execution-123', + points: [ + { contextId: 'ctx-1', kind: 'human', status: 'paused' }, + { contextId: 'ctx-2', kind: 'time', status: 'paused' }, + ], + }, + }) + }) + it('streams an immediate heartbeat and the same sync result when NDJSON is accepted', async () => { vi.useFakeTimers() try { @@ -382,6 +408,7 @@ describe('POST /api/v2/workflows/[workflowId]/execute', () => { status: 'completed', output: { result: 'done' }, blockOutputs: null, + paused: null, error: null, startedAt: '2026-07-31T00:00:00.000Z', endedAt: '2026-07-31T00:00:01.000Z', diff --git a/apps/sim/app/api/v2/workflows/[workflowId]/execute/route.ts b/apps/sim/app/api/v2/workflows/[workflowId]/execute/route.ts index ab53f25617b..e15e4e10e89 100644 --- a/apps/sim/app/api/v2/workflows/[workflowId]/execute/route.ts +++ b/apps/sim/app/api/v2/workflows/[workflowId]/execute/route.ts @@ -36,7 +36,7 @@ import { SIM_VIA_HEADER, validateCallChain, } from '@/lib/execution/call-chain' -import { v2WorkflowErrorPolicies } from '@/lib/workflows/api' +import { presentV2RunPause, v2WorkflowErrorPolicies } from '@/lib/workflows/api' import { executeManualWorkflowFromBlockOperation, executeManualWorkflowOperation, @@ -140,6 +140,7 @@ function presentRun(result: ExecuteWorkflowServiceRun) { executionTimeoutSeconds: executionTimeoutSeconds(result.executionTimeoutMs), output: result.output ?? null, blockOutputs: result.blockOutputs ?? null, + paused: presentV2RunPause(result.paused), } } diff --git a/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/resume/route.test.ts b/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/resume/route.test.ts index 9e8e18d0c12..53322ddd5c5 100644 --- a/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/resume/route.test.ts +++ b/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/resume/route.test.ts @@ -137,6 +137,35 @@ describe('POST /api/v2/workflows/[workflowId]/runs/[runId]/resume', () => { expect(v2ResumeWorkflowContract.response.schema.parse(body)).toEqual(body) }) + it("presents the pause the resume reports, not the resume attempt's own run id", async () => { + mocks.resume.mockResolvedValueOnce({ + kind: 'sync', + success: true, + status: 'paused', + executionId: 'resume-execution-4', + output: {}, + error: undefined, + structuredError: null, + paused: { + runId: 'run-1', + points: [{ contextId: 'context-4', pauseKind: 'human', resumeStatus: 'paused' }], + }, + }) + const { request, context } = makeRequest(JSON.stringify({ contextId: 'context-3' })) + + const body = await (await POST(request, context)).json() + + expect(body.data).toMatchObject({ + runId: 'resume-execution-4', + status: 'paused', + paused: { + runId: 'run-1', + points: [{ contextId: 'context-4', kind: 'human', status: 'paused' }], + }, + }) + expect(v2ResumeWorkflowContract.response.schema.parse(body)).toEqual(body) + }) + it('wraps synchronous resume results in the canonical v2 run shape', async () => { mocks.resume.mockResolvedValueOnce({ kind: 'sync', @@ -165,6 +194,7 @@ describe('POST /api/v2/workflows/[workflowId]/runs/[runId]/resume', () => { status: 'completed', output: { approved: true }, blockOutputs: null, + paused: null, error: null, startedAt: '2026-08-05T00:00:00.000Z', endedAt: '2026-08-05T00:00:01.000Z', @@ -208,6 +238,7 @@ describe('POST /api/v2/workflows/[workflowId]/runs/[runId]/resume', () => { status: 'failed', output: { partial: true }, blockOutputs: null, + paused: null, error: { message: 'Condition evaluation failed', code: 'BLOCK_EXECUTION_FAILED', diff --git a/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/resume/route.ts b/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/resume/route.ts index e34f27d2bcb..5608c1364ee 100644 --- a/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/resume/route.ts +++ b/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/resume/route.ts @@ -18,7 +18,7 @@ import { } from '@/lib/api/server/routes' import { getBaseUrl } from '@/lib/core/utils/urls' import { withRouteHandler } from '@/lib/core/utils/with-route-handler' -import { v2WorkflowErrorPolicies } from '@/lib/workflows/api' +import { presentV2RunPause, v2WorkflowErrorPolicies } from '@/lib/workflows/api' import { workflowOperations } from '@/lib/workflows/application/operations' import { resumeWorkflowRun } from '@/lib/workflows/application/resume-run' import { ResumeWorkflowExecutionError } from '@/lib/workflows/executor/resume-execution' @@ -118,6 +118,7 @@ export const POST = withRouteHandler( output: result.output ?? null, // Resume has no request body to name selectors in, so selection never applies here. blockOutputs: null, + paused: presentV2RunPause(result.paused), }, { headers } ) diff --git a/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/route.test.ts b/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/route.test.ts index 54c0fc63784..e1b301f5761 100644 --- a/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/route.test.ts +++ b/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/route.test.ts @@ -150,11 +150,13 @@ describe('v2 run detail and cancel adapters', () => { pausePointCount: 1, resumedCount: 0, }, + pausedRunId: 'run-parent', }) const body = await (await callStatus()).json() expect(body.data.paused.contextId).toBe('context-1') + expect(body.data.paused.runId).toBe('run-parent') expect(body.data.paused).not.toHaveProperty('pausedExecutionId') }) diff --git a/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/route.ts b/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/route.ts index dffdb4e639a..35465bcdfb7 100644 --- a/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/route.ts +++ b/apps/sim/app/api/v2/workflows/[workflowId]/runs/[runId]/route.ts @@ -49,6 +49,7 @@ export const GET = defineV2JsonRoute({ paused: status.paused ? v2WorkflowRunStatusSchema.shape.paused.parse({ ...status.paused, + runId: status.pausedRunId, points: status.pausePoints ?? [], }) : null, diff --git a/apps/sim/app/api/v2/workspaces/[workspaceId]/workflows/source/resources/route.test.ts b/apps/sim/app/api/v2/workspaces/[workspaceId]/workflows/source/resources/route.test.ts index dcb32f2e1be..b9ed2d1ee11 100644 --- a/apps/sim/app/api/v2/workspaces/[workspaceId]/workflows/source/resources/route.test.ts +++ b/apps/sim/app/api/v2/workspaces/[workspaceId]/workflows/source/resources/route.test.ts @@ -60,7 +60,7 @@ const manifest = { }, ], skills: [{ key: 'triage', id: 'skl_1', name: 'Triage' }], - customTools: [{ key: 'lookup-order', id: 'ctl_1', name: 'lookup_order' }], + customTools: [{ key: 'lookup-order', id: 'ctl_1', name: 'Lookup order' }], mcpServers: [{ key: 'github', id: 'mcp-1', name: 'GitHub', tools: ['create_issue'] }], env: ['CRM_KEY'], truncated: false, diff --git a/apps/sim/app/index.md/route.ts b/apps/sim/app/index.md/route.ts index 51749fc2be6..90a8791450a 100644 --- a/apps/sim/app/index.md/route.ts +++ b/apps/sim/app/index.md/route.ts @@ -1,5 +1,6 @@ import { SITE_URL } from '@/lib/core/utils/urls' import { DOCS_URL } from '@/lib/help-links' +import { HOME_FAQS } from '@/app/(landing)/components/home-faq' import { HOME_FEATURES, HOME_HERO_HEADING, @@ -53,6 +54,11 @@ export async function GET() { 'What teams do in Sim', HOME_FEATURES.map((feature) => `- ${feature}`) ), + section( + 'Questions teams ask about Sim', + HOME_FAQS.map(({ question, answer }) => `### ${question}\n\n${answer}`), + '\n\n' + ), section('Platform', navMenuLines(PLATFORM_MENU)), section('Solutions', SOLUTION_LINES), section('More', [ diff --git a/apps/sim/app/llms.txt/llms.ts b/apps/sim/app/llms.txt/llms.ts index 09292468663..38360344f8b 100644 --- a/apps/sim/app/llms.txt/llms.ts +++ b/apps/sim/app/llms.txt/llms.ts @@ -59,7 +59,7 @@ export const SECURITY_LINES = [ linkLine( 'Trust Center', 'https://trust.sim.ai/', - 'SOC 2 Type II, ISO 27001, and GDPR: reports, policies, and subprocessors' + 'SOC 2 Type II (Security criterion), GDPR, and ISO 27001 certification in progress: reports, policies, and subprocessors' ), linkLine( 'Single sign-on', diff --git a/apps/sim/app/manifest.ts b/apps/sim/app/manifest.ts index 1a0b3f0e160..9cada5117d0 100644 --- a/apps/sim/app/manifest.ts +++ b/apps/sim/app/manifest.ts @@ -2,8 +2,6 @@ import { INTEGRATION_COUNT_LABEL } from '@sim/deployment-config/integration-clai import type { MetadataRoute } from 'next' import { WORKSPACES_PATH } from '@/lib/navigation/paths' -export const dynamic = 'force-dynamic' - export default function manifest(): MetadataRoute.Manifest { return { name: 'Sim — The AI Workspace | Build, Deploy & Manage AI Agents', diff --git a/apps/sim/app/workspace/[workspaceId]/prefetch.ts b/apps/sim/app/workspace/[workspaceId]/prefetch.ts index d69738630c8..751f55dfb40 100644 --- a/apps/sim/app/workspace/[workspaceId]/prefetch.ts +++ b/apps/sim/app/workspace/[workspaceId]/prefetch.ts @@ -27,8 +27,8 @@ import { } from '@/hooks/queries/workspace-host' /** - * Resolves and caches the route-derived host context before any workspace UI or - * host branding renders. A `null` result is an explicit access denial. + * Resolves and caches the route-derived host context before any workspace UI + * renders. A `null` result is an explicit access denial. */ export function prefetchWorkspaceHostContext( queryClient: QueryClient, diff --git a/apps/sim/app/workspace/[workspaceId]/settings/components/billing/billing.tsx b/apps/sim/app/workspace/[workspaceId]/settings/components/billing/billing.tsx index 0105c89b89d..87d559d2644 100644 --- a/apps/sim/app/workspace/[workspaceId]/settings/components/billing/billing.tsx +++ b/apps/sim/app/workspace/[workspaceId]/settings/components/billing/billing.tsx @@ -31,7 +31,6 @@ import { getDisplayPlanName, getPlanTierCredits, getPlanTierDollars, - getPlanWeeklyRefreshDollars, isEnterprise, isFree, isPaid, @@ -40,8 +39,10 @@ import { } from '@/lib/billing/plan-helpers' import { getEffectiveSeats, + getSubscriptionWeeklyRefreshDollars, hasPaidSubscriptionStatus, hasUsableSubscriptionAccess, + isTrialingSubscription, } from '@/lib/billing/subscriptions/utils' import { buildUpgradeHref } from '@/lib/billing/upgrade-reasons' import { getBaseUrl } from '@/lib/core/utils/urls' @@ -81,6 +82,12 @@ const INVOICE_STATUS_BADGES: Record = { void: { variant: 'gray', label: 'Void' }, } +function getPeriodEndLabel(isCancelledAtPeriodEnd: boolean, isTrialing: boolean): string { + if (isCancelledAtPeriodEnd) return 'Access until' + if (isTrialing) return 'Free trial ends' + return 'Next billing date' +} + /** Resolve a Stripe invoice status to its badge presentation. */ function getInvoiceStatusBadge(status: string | null): InvoiceStatusBadge { return ( @@ -337,7 +344,7 @@ export function Billing({ scope, organizationId, creditUsageHref }: BillingProps } const handleOpenBillingPortal = () => { - if (!permissions.canEditUsageLimit) { + if (!permissions.canManageBilling) { toast.error("Can't manage payment method", { description: 'Only organization admins can manage billing.', }) @@ -375,7 +382,7 @@ export function Billing({ scope, organizationId, creditUsageHref }: BillingProps } const handleCancelSubscription = async () => { - if (!permissions.canEditUsageLimit) { + if (!permissions.canManageBilling) { toast.error("Can't cancel subscription", { description: 'Only organization admins can cancel the subscription.', }) @@ -403,7 +410,7 @@ export function Billing({ scope, organizationId, creditUsageHref }: BillingProps } const handleRestoreSubscription = async () => { - if (!permissions.canEditUsageLimit) { + if (!permissions.canManageBilling) { toast.error("Can't restore subscription", { description: 'Only organization admins can restore the subscription.', }) @@ -475,8 +482,9 @@ export function Billing({ scope, organizationId, creditUsageHref }: BillingProps ? organizationBilling?.cancelAtPeriodEnd === true : subscriptionData?.data?.cancelAtPeriodEnd === true + const isTrialing = isTrialingSubscription(subscription) const weeklyRefreshDollars = - getPlanWeeklyRefreshDollars(subscription.plan) * + getSubscriptionWeeklyRefreshDollars(subscription) * (isOrganizationScope ? subscription.seats || 1 : 1) const invoices = (invoicesData?.invoices ?? []).map((invoice) => ({ @@ -488,10 +496,10 @@ export function Billing({ scope, organizationId, creditUsageHref }: BillingProps url: invoice.hostedInvoiceUrl ?? invoice.invoicePdf, })) - const canManageBilling = permissions.canEditUsageLimit + const canManageBilling = permissions.canManageBilling const canExplorePlans = permissions.showUpgradePlans const showUsageLimit = subscription.isPaid && !subscription.isEnterprise - const showOnDemand = hasUsablePaidAccess && !subscription.isEnterprise + const showOnDemand = hasUsablePaidAccess && !subscription.isEnterprise && !isTrialing const usageLimitCurrent = subscription.isOrgScoped && organizationBilling @@ -614,7 +622,7 @@ export function Billing({ scope, organizationId, creditUsageHref }: BillingProps {periodEnd && (
    - {isCancelledAtPeriodEnd ? 'Access until' : 'Next billing date'} + {getPeriodEndLabel(isCancelledAtPeriodEnd, isTrialing)} {new Date(periodEnd).toLocaleDateString()} diff --git a/apps/sim/app/workspace/[workspaceId]/settings/components/billing/subscription-permissions.ts b/apps/sim/app/workspace/[workspaceId]/settings/components/billing/subscription-permissions.ts index 94e514d1112..af1c7f6a63c 100644 --- a/apps/sim/app/workspace/[workspaceId]/settings/components/billing/subscription-permissions.ts +++ b/apps/sim/app/workspace/[workspaceId]/settings/components/billing/subscription-permissions.ts @@ -1,8 +1,13 @@ +import { isTrialingSubscription } from '@/lib/billing/subscriptions/utils' + export interface SubscriptionPermissions { canUpgradeToPro: boolean canUpgradeToTeam: boolean canViewEnterprise: boolean canManageTeam: boolean + /** Manage payment method and cancel or restore the plan. */ + canManageBilling: boolean + /** Change the usage limit or on-demand usage; a trial's allowance is fixed. */ canEditUsageLimit: boolean canCancelSubscription: boolean showTeamMemberView: boolean @@ -37,6 +42,7 @@ export function getSubscriptionPermissions( userRole: UserRole ): SubscriptionPermissions { const { isFree, isPro, isEnterprise, isPaid, isOrgScoped } = subscription + const isTrialing = isTrialingSubscription(subscription) const { isTeamAdmin } = userRole // Non-admin org members see the "team member" view: no edit / no cancel @@ -45,14 +51,17 @@ export function getSubscriptionPermissions( const orgAdminOrSolo = !isOrgScoped || isTeamAdmin const isEnterpriseMember = isEnterprise && !isTeamAdmin + const canManageBilling = (isFree || (isPaid && !isEnterprise)) && orgAdminOrSolo const canViewUsageInfo = !isEnterpriseMember return { canUpgradeToPro: isFree, - canUpgradeToTeam: isFree || (isPro && !isOrgScoped), + // A trial becomes a team plan only after it converts. + canUpgradeToTeam: isFree || (isPro && !isOrgScoped && !isTrialing), canViewEnterprise: !isEnterprise && !orgMemberOnly, canManageTeam: isOrgScoped && isTeamAdmin && !isEnterprise, - canEditUsageLimit: (isFree || (isPaid && !isEnterprise)) && orgAdminOrSolo, + canManageBilling, + canEditUsageLimit: canManageBilling && !isTrialing, canCancelSubscription: isPaid && !isEnterprise && orgAdminOrSolo, showTeamMemberView: orgMemberOnly, showUpgradePlans: diff --git a/apps/sim/app/workspace/[workspaceId]/upgrade/components/comparison-table/comparison-data.ts b/apps/sim/app/workspace/[workspaceId]/upgrade/components/comparison-table/comparison-data.ts index badb0d3a16f..b774683aa09 100644 --- a/apps/sim/app/workspace/[workspaceId]/upgrade/components/comparison-table/comparison-data.ts +++ b/apps/sim/app/workspace/[workspaceId]/upgrade/components/comparison-table/comparison-data.ts @@ -1,5 +1,10 @@ import { DEFAULT_BILLING_CONCURRENCY_LIMITS } from '@/lib/billing/concurrency-defaults' -import { CREDIT_TIERS, CREDITS_PER_DOLLAR, DEFAULT_FREE_CREDITS } from '@/lib/billing/constants' +import { + CREDIT_TIERS, + CREDITS_PER_DOLLAR, + DEFAULT_FREE_CREDITS, + PRO_TRIAL_DAYS, +} from '@/lib/billing/constants' /** * Looks up a credit tier by name, so a column binds to the right tier even if @@ -84,6 +89,10 @@ export const COMPARISON_SECTIONS: ComparisonSection[] = [ 'Custom', ], }, + { + label: 'Free trial for new subscribers', + values: [false, `${PRO_TRIAL_DAYS} days`, false, false], + }, { label: 'Weekly refresh', values: [ diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/chat/components/output-select/output-select.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/chat/components/output-select/output-select.tsx index 60b730175ab..cdcb9f1b350 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/chat/components/output-select/output-select.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/chat/components/output-select/output-select.tsx @@ -15,6 +15,7 @@ import { buildWorkflowOutputMenu, buildWorkflowOutputOptions, collectReferencedWorkflowIds, + selectBlockPathOptions, type WorkflowOutputMenuNode, type WorkflowOutputOption, } from '@/lib/workflows/streaming/nested-output-options' @@ -42,6 +43,8 @@ interface OutputSelectProps { disabled?: boolean /** Placeholder text when no outputs are selected */ placeholder?: string + /** Offers one option per block of this type, selecting this output path */ + outputFilter?: { blockType: string; path: string } /** Whether to emit internal IDs, display labels, or public dot selectors */ valueMode?: 'id' | 'label' | 'public' /** Alignment of the dropdown relative to the trigger */ @@ -127,6 +130,7 @@ function OutputSelectContent({ onOutputSelect, disabled = false, placeholder = 'Select outputs', + outputFilter, valueMode = 'id', align = 'start', maxHeight = 200, @@ -206,7 +210,7 @@ function OutputSelectContent({ const thirdLevelStates = useWorkflowStates(thirdLevelWorkflowIds) const workflowStates = new Map([...firstLevelStates, ...secondLevelStates, ...thirdLevelStates]) - const workflowOutputs = workflowId + const allWorkflowOutputs = workflowId ? buildWorkflowOutputOptions({ rootWorkflowId: workflowId, rootState, @@ -214,6 +218,9 @@ function OutputSelectContent({ maxChildDepth: DEFAULTS.MAX_SSE_CHILD_DEPTH, }) : [] + const workflowOutputs = outputFilter + ? selectBlockPathOptions(allWorkflowOutputs, outputFilter.blockType, outputFilter.path) + : allWorkflowOutputs const outputMenu = buildWorkflowOutputMenu(workflowOutputs) const outputMenuRevision = JSON.stringify([ workflowId, diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/code/code.test.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/code/code.test.tsx index da05646819e..5e761625e42 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/code/code.test.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/code/code.test.tsx @@ -50,6 +50,7 @@ describe('Code tab', () => { files: { 'workflow.ts': `// read ${sourceReads.length}` }, lock: { version: 1, blocks: {}, variables: {} }, base: { + version: 1, workflowId: WORKFLOW_ID, workspaceId: WORKSPACE_ID, fingerprint: `f${sourceReads.length}`, diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/combobox/combobox.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/combobox/combobox.tsx index 2b6deebe620..ad1b752586f 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/combobox/combobox.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/combobox/combobox.tsx @@ -19,13 +19,13 @@ import { useAccessibleReferencePrefixes } from '@/app/workspace/[workspaceId]/w/ import type { SubBlockConfig } from '@/blocks/types' import { useDebounce } from '@/hooks/use-debounce' import { usePermissionConfig } from '@/hooks/use-permission-config' +import { DEFAULT_BLOCK_MODEL } from '@/providers/default-model' import { useWorkflowRegistry } from '@/stores/workflows/registry/store' import { useSubBlockStore } from '@/stores/workflows/subblock/store' /** * Constants for ComboBox component behavior */ -const DEFAULT_MODEL = 'claude-sonnet-5-5' const ZOOM_FACTOR_BASE = 0.96 const MIN_ZOOM = 0.1 const MAX_ZOOM = 1 @@ -308,7 +308,7 @@ export const ComboBox = memo(function ComboBox({ /** * Determines the default option value to use. - * Priority: explicit defaultValue > DEFAULT_MODEL for model field > first option + * Priority: explicit defaultValue > DEFAULT_BLOCK_MODEL for model field > first option */ const defaultOptionValue = useMemo(() => { if (defaultValue !== undefined) { @@ -322,7 +322,7 @@ export const ComboBox = memo(function ComboBox({ if (subBlockId === 'model') { const defaultModelOption = evaluatedOptions.find( - (opt) => getOptionValue(opt) === DEFAULT_MODEL + (opt) => getOptionValue(opt) === DEFAULT_BLOCK_MODEL ) if (defaultModelOption) { return getOptionValue(defaultModelOption) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/file-upload/file-upload.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/file-upload/file-upload.tsx index c8457d034f0..4b8cee7c0a1 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/file-upload/file-upload.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/file-upload/file-upload.tsx @@ -28,6 +28,7 @@ import { useActiveCanonicalSubBlockValue } from '@/app/workspace/[workspaceId]/w import { useResourceFolders } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-resource-folders' import { useSubBlockValue } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-value' import { useActiveSearchTarget } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/providers/active-search-target-provider' +import { findConfiguredModelProvider } from '@/blocks/utils' import { invalidateWorkspaceFileReads } from '@/hooks/queries/utils/workspace-file-cache' import { workspaceFileListParams, @@ -42,7 +43,6 @@ import { } from '@/hooks/queries/workspace-files' import { useSearchFilterValue } from '@/hooks/use-search-filter-value' import { getProviderAttachmentMaxBytes } from '@/providers/attachments' -import { getProviderFromModel } from '@/providers/utils' import { useWorkflowRegistry } from '@/stores/workflows/registry/store' import { useWorkflowStore } from '@/stores/workflows/workflow/store' @@ -322,11 +322,9 @@ export function FileUpload({ const maxSizeInBytes = useMemo(() => { const fallback = maxSize * 1024 * 1024 if (typeof modelValue !== 'string' || !modelValue) return fallback - try { - return Math.max(fallback, getProviderAttachmentMaxBytes(getProviderFromModel(modelValue))) - } catch { - return fallback - } + // sim-auto has no provider until routed, and may route images to an inline-only model. + const provider = findConfiguredModelProvider(modelValue) + return provider ? Math.max(fallback, getProviderAttachmentMaxBytes(provider)) : fallback }, [modelValue, maxSize]) const maxSizeLabel = `${Math.round(maxSizeInBytes / (1024 * 1024))}MB` diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.test.ts b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.test.ts index 79b6e14a8e8..3391c26b06e 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.test.ts +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.test.ts @@ -3,6 +3,7 @@ import type { StoredTool } from '@/app/workspace/[workspaceId]/w/[workflowId]/co import { isAgentToolBlock, isCustomToolAlreadySelected, + supportsToolUsageControlForModel, } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/utils' describe('isAgentToolBlock', () => { @@ -47,3 +48,15 @@ describe('already-selected checks', () => { ).toBe(false) }) }) + +describe('supportsToolUsageControlForModel', () => { + it('offers the control for Auto, which falls back to a provider that supports it', () => { + expect(supportsToolUsageControlForModel('agent', 'sim-auto')).toBe(true) + }) + + it('offers it for a supporting provider and never without a model', () => { + expect(supportsToolUsageControlForModel('agent', 'claude-sonnet-5-5')).toBe(true) + expect(supportsToolUsageControlForModel('agent', '')).toBe(false) + expect(supportsToolUsageControlForModel('mothership', '')).toBe(true) + }) +}) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx index f19e9af9771..7f007010acc 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx @@ -72,6 +72,7 @@ import { isCustomToolAlreadySelected, isMcpToolAlreadySelected, isWorkflowAlreadySelected, + supportsToolUsageControlForModel, } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/utils' import { getActiveWorkflowSearchHighlight } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/workflow-search-highlight' import { useSubBlockValue } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-value' @@ -105,8 +106,7 @@ import { useCollaborativeWorkflow } from '@/hooks/use-collaborative-workflow' import { useOperationAccess } from '@/hooks/use-operation-access' import { usePermissionConfig } from '@/hooks/use-permission-config' import { useSettingsNavigation } from '@/hooks/use-settings-navigation' -import { supportsForcedToolUse, supportsToolUsageControl } from '@/providers/models' -import { getProviderFromModel } from '@/providers/utils' +import { supportsForcedToolUse } from '@/providers/models' import type { ActiveSearchTarget } from '@/stores/panel/editor/store' import { useSubBlockStore } from '@/stores/workflows/subblock/store' import { useWorkflowStore } from '@/stores/workflows/workflow/store' @@ -603,9 +603,7 @@ export const ToolInput = memo(function ToolInput({ const modelValue = useSubBlockStore((state) => state.getValue(blockId, 'model')) const model = typeof modelValue === 'string' ? modelValue : '' - const provider = model ? getProviderFromModel(model) : '' - const supportsToolControl = - blockType === 'mothership' || (provider ? supportsToolUsageControl(provider) : false) + const supportsToolControl = supportsToolUsageControlForModel(blockType, model) const supportsForce = blockType === 'mothership' || supportsForcedToolUse(model) const { diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/utils.ts b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/utils.ts index 49a0bb1428b..710674aeea2 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/utils.ts +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/utils.ts @@ -1,6 +1,8 @@ import { stripVersionSuffix } from '@sim/utils/string' import type { StoredTool } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/types' import type { BlockConfig } from '@/blocks/types' +import { resolveModelProviderId } from '@/blocks/utils' +import { supportsToolUsageControl } from '@/providers/models' /** * Core blocks the agent tool picker offers even though they are not @@ -71,3 +73,13 @@ export function isWorkflowAlreadySelected( (tool) => tool.type === 'workflow_input' && tool.params?.workflowId === workflowId ) } + +/** + * Whether the tool picker offers the per-tool usage control (auto, force, none) for the + * block's model. Sim Chat always does; any other block asks its model's provider. + */ +export function supportsToolUsageControlForModel(blockType: string, model: string): boolean { + if (blockType === 'mothership') return true + if (!model) return false + return supportsToolUsageControl(resolveModelProviderId(model)) +} diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/workflow-output-selector/workflow-output-selector.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/workflow-output-selector/workflow-output-selector.tsx index bbe921224b8..a611f6302f5 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/workflow-output-selector/workflow-output-selector.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/workflow-output-selector/workflow-output-selector.tsx @@ -11,6 +11,7 @@ interface WorkflowOutputSelectorProps { previewValue?: string[] | null disabled?: boolean placeholder?: string + outputFilter?: { blockType: string; path: string } } export function WorkflowOutputSelector({ @@ -20,6 +21,7 @@ export function WorkflowOutputSelector({ previewValue, disabled = false, placeholder, + outputFilter, }: WorkflowOutputSelectorProps) { const workflowId = useWorkflowRegistry((state) => state.activeWorkflowId) const [storedValue, setStoredValue] = useSubBlockValue(blockId, subBlockId) @@ -34,6 +36,7 @@ export function WorkflowOutputSelector({ onOutputSelect={setStoredValue} disabled={disabled || isPreview} placeholder={placeholder} + outputFilter={outputFilter} valueMode='public' size='md' className='w-full' diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-value.ts b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-value.ts index 6381ff29cba..6192b33f835 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-value.ts +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-value.ts @@ -4,8 +4,8 @@ import { isEqual } from 'es-toolkit' import { useShallow } from 'zustand/react/shallow' import { useStoreWithEqualityFn } from 'zustand/traditional' import { isMcpRuntimeReference } from '@/lib/mcp/operation-policy' +import { findConfiguredModelProvider } from '@/blocks/utils' import { useCollaborativeWorkflow } from '@/hooks/use-collaborative-workflow' -import { getProviderFromModel } from '@/providers/utils' import { useWorkflowDiffStore } from '@/stores/workflow-diff/store' import { useWorkflowRegistry } from '@/stores/workflows/registry/store' import { useSubBlockStore } from '@/stores/workflows/subblock/store' @@ -193,8 +193,8 @@ export function useSubBlockValue( const currentApiKeyValue = useSubBlockStore.getState().getValue(blockId, 'apiKey') if (currentApiKeyValue && currentApiKeyValue !== '') { const oldModelValue = storeValue as string - const oldProvider = oldModelValue ? getProviderFromModel(oldModelValue) : null - const newProvider = getProviderFromModel(newValue) + const oldProvider = oldModelValue ? findConfiguredModelProvider(oldModelValue) : null + const newProvider = findConfiguredModelProvider(newValue) if (oldProvider !== newProvider) { collaborativeSetSubblockValue(blockId, 'apiKey', '') } diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/sub-block.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/sub-block.tsx index 9607c3b70a5..59658cb5ee4 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/sub-block.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/sub-block.tsx @@ -1152,6 +1152,7 @@ function SubBlockComponent({ previewValue={previewValue as string[] | null | undefined} disabled={isDisabled} placeholder={config.placeholder} + outputFilter={config.outputFilter} /> ) diff --git a/apps/sim/blocks/blocks/agent.test.ts b/apps/sim/blocks/blocks/agent.test.ts index c701852780e..05936948cfb 100644 --- a/apps/sim/blocks/blocks/agent.test.ts +++ b/apps/sim/blocks/blocks/agent.test.ts @@ -112,4 +112,16 @@ describe('AgentBlock', () => { }) }) }) + + describe('tools.config.tool function', () => { + const toolFunction = AgentBlock.tools.config?.tool + + it('records the provider sim-auto falls back to, since it has none of its own', () => { + expect(toolFunction?.({ model: 'sim-auto' })).toBe('anthropic') + }) + + it('falls back to the same provider when no model is set', () => { + expect(toolFunction?.({})).toBe('anthropic') + }) + }) }) diff --git a/apps/sim/blocks/blocks/agent.ts b/apps/sim/blocks/blocks/agent.ts index 816a7232fe4..8316335b58a 100644 --- a/apps/sim/blocks/blocks/agent.ts +++ b/apps/sim/blocks/blocks/agent.ts @@ -8,10 +8,11 @@ import { getAgentModelOptions, getModelCapabilityCondition, getProviderCredentialSubBlocks, - getSerializedModelProviderId, normalizeFileInput, RESPONSE_FORMAT_WAND_CONFIG, + resolveModelProviderId, } from '@/blocks/utils' +import { DEFAULT_BLOCK_MODEL } from '@/providers/default-model' import { getBaseModelProviders, getEvaluationModels, @@ -24,15 +25,11 @@ import { getReasoningEffortValuesForModel, getThinkingLevelsForModel, getVerbosityValuesForModel, - isAutoModel, supportsTemperature, } from '@/providers/models' const logger = createLogger('AgentBlock') -/** Model the agent block falls back to when `model` is unset or the auto pseudo-model. */ -const AGENT_FALLBACK_MODEL = 'claude-sonnet-5-5' - const MODELS_WITH_REASONING_EFFORT = getModelsWithReasoningEffort() const MODELS_WITH_VERBOSITY = getModelsWithVerbosity() const MODELS_WITH_THINKING = getModelsWithThinking() @@ -130,7 +127,7 @@ Return ONLY the JSON array.`, type: 'combobox', placeholder: 'Type or select a model...', required: true, - defaultValue: 'claude-sonnet-5-5', + defaultValue: DEFAULT_BLOCK_MODEL, options: getAgentModelOptions, commandSearchable: true, }, @@ -428,10 +425,7 @@ Return ONLY the JSON array.`, ], config: { tool: (params: Record) => { - const model = params.model || AGENT_FALLBACK_MODEL - // sim-auto has no provider of its own until the pool resolves it at execution time. - const lookupModel = isAutoModel(model) ? AGENT_FALLBACK_MODEL : model - return getSerializedModelProviderId(lookupModel, AGENT_FALLBACK_MODEL) + return resolveModelProviderId(params.model) }, params: (params: Record) => { const normalizedFiles = normalizeFileInput(params.files) diff --git a/apps/sim/blocks/blocks/api.ts b/apps/sim/blocks/blocks/api.ts index 9c0f51140b2..a3859d628fb 100644 --- a/apps/sim/blocks/blocks/api.ts +++ b/apps/sim/blocks/blocks/api.ts @@ -193,7 +193,11 @@ Example: }, }, outputs: { - data: { type: 'json', description: 'API response data (JSON, text, or other formats)' }, + data: { + type: 'json', + description: 'API response data (JSON, text, or other formats)', + mayBeText: true, + }, status: { type: 'number', description: 'HTTP status code (200, 404, 500, etc.)' }, headers: { type: 'json', description: 'HTTP response headers as key-value pairs' }, }, diff --git a/apps/sim/blocks/blocks/evaluator.ts b/apps/sim/blocks/blocks/evaluator.ts index 11708998be6..95890acf151 100644 --- a/apps/sim/blocks/blocks/evaluator.ts +++ b/apps/sim/blocks/blocks/evaluator.ts @@ -4,11 +4,12 @@ import { getModelFallbackSubBlock, MODEL_FALLBACK_INPUTS } from '@/blocks/model- import type { BlockConfig, ParamType } from '@/blocks/types' import { BEDROCK_SAVED_CREDENTIAL_INPUTS, - getModelOptions, + getModelOptionsWithAuto, getProviderCredentialSubBlocks, - getSerializedModelProviderId, PROVIDER_CREDENTIAL_INPUTS, + resolveModelProviderId, } from '@/blocks/utils' +import { DEFAULT_BLOCK_MODEL } from '@/providers/default-model' const logger = createLogger('EvaluatorBlock') @@ -168,8 +169,8 @@ export const EvaluatorBlock: BlockConfig = { type: 'combobox', placeholder: 'Type or select a model...', required: true, - defaultValue: 'claude-sonnet-5-5', - options: getModelOptions, + defaultValue: DEFAULT_BLOCK_MODEL, + options: getModelOptionsWithAuto, }, ...getProviderCredentialSubBlocks({ bedrockSavedCredential: true }), getModelFallbackSubBlock(), @@ -236,7 +237,7 @@ export const EvaluatorBlock: BlockConfig = { 'deepseek_reasoner', ], config: { - tool: (params: Record) => getSerializedModelProviderId(params.model), + tool: (params: Record) => resolveModelProviderId(params.model), }, }, inputs: { diff --git a/apps/sim/blocks/blocks/function.ts b/apps/sim/blocks/blocks/function.ts index c5456c532fc..3dde96bf241 100644 --- a/apps/sim/blocks/blocks/function.ts +++ b/apps/sim/blocks/blocks/function.ts @@ -172,7 +172,11 @@ try { }, }, outputs: { - result: { type: 'json', description: 'Structured result emitted by the executed code' }, + result: { + type: 'json', + description: 'Structured result emitted by the executed code', + mayBeText: true, + }, stdout: { type: 'string', description: 'Console log output and debug messages from function execution', @@ -182,4 +186,11 @@ try { description: `Files the code wrote to ${SANDBOX_OUTPUT_DIR}, ready to attach or upload downstream`, }, }, + errorOutputs: { + errorMessage: { + type: 'string', + description: + 'The thrown message alone, without the line and code that error leads with. Use it in a reply to a caller.', + }, + }, } diff --git a/apps/sim/blocks/blocks/pi.ts b/apps/sim/blocks/blocks/pi.ts index fed7c3ee8ee..074d0a69ce3 100644 --- a/apps/sim/blocks/blocks/pi.ts +++ b/apps/sim/blocks/blocks/pi.ts @@ -1,5 +1,5 @@ import { PiIcon } from '@/components/icons' -import { getEnv, isTruthy } from '@/lib/core/config/env' +import { getDeploymentShape } from '@/lib/core/config/deployment-shape' import type { BlockConfig } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { @@ -164,7 +164,7 @@ export const PiBlock: BlockConfig = { title: 'Mode', type: 'dropdown', /** Cloud modes require E2B and stay hidden when it is disabled. */ - value: () => (isTruthy(getEnv('NEXT_PUBLIC_E2B_ENABLED')) ? 'cloud' : 'local'), + value: () => (getDeploymentShape().e2bEnabled ? 'cloud' : 'local'), options: () => { const options = [ { @@ -173,7 +173,7 @@ export const PiBlock: BlockConfig = { description: 'Edits files on your own machine over SSH', }, ] - if (isTruthy(getEnv('NEXT_PUBLIC_E2B_ENABLED'))) { + if (getDeploymentShape().e2bEnabled) { options.unshift( { label: 'Create PR', diff --git a/apps/sim/blocks/blocks/router.ts b/apps/sim/blocks/blocks/router.ts index a978d261f18..60aa7ef7436 100644 --- a/apps/sim/blocks/blocks/router.ts +++ b/apps/sim/blocks/blocks/router.ts @@ -3,11 +3,12 @@ import { getModelFallbackSubBlock, MODEL_FALLBACK_INPUTS } from '@/blocks/model- import { AuthMode, type BlockConfig } from '@/blocks/types' import { BEDROCK_SAVED_CREDENTIAL_INPUTS, - getModelOptions, + getModelOptionsWithAuto, getProviderCredentialSubBlocks, - getSerializedModelProviderId, PROVIDER_CREDENTIAL_INPUTS, + resolveModelProviderId, } from '@/blocks/utils' +import { DEFAULT_BLOCK_MODEL } from '@/providers/default-model' interface TargetBlock { id: string @@ -161,8 +162,8 @@ export const RouterBlock: BlockConfig = { type: 'combobox', placeholder: 'Type or select a model...', required: true, - defaultValue: 'claude-sonnet-5-5', - options: getModelOptions, + defaultValue: DEFAULT_BLOCK_MODEL, + options: getModelOptionsWithAuto, }, ...getProviderCredentialSubBlocks({ bedrockSavedCredential: true }), getModelFallbackSubBlock(), @@ -194,7 +195,7 @@ export const RouterBlock: BlockConfig = { 'deepseek_reasoner', ], config: { - tool: (params: Record) => getSerializedModelProviderId(params.model), + tool: (params: Record) => resolveModelProviderId(params.model), }, }, inputs: { @@ -253,8 +254,8 @@ export const RouterV2Block: BlockConfig = { type: 'combobox', placeholder: 'Type or select a model...', required: true, - defaultValue: 'claude-sonnet-5-5', - options: getModelOptions, + defaultValue: DEFAULT_BLOCK_MODEL, + options: getModelOptionsWithAuto, }, ...getProviderCredentialSubBlocks({ bedrockSavedCredential: true }), getModelFallbackSubBlock(), @@ -269,7 +270,7 @@ export const RouterV2Block: BlockConfig = { 'deepseek_reasoner', ], config: { - tool: (params: Record) => getSerializedModelProviderId(params.model), + tool: (params: Record) => resolveModelProviderId(params.model), }, }, inputs: { diff --git a/apps/sim/blocks/blocks/slack.ts b/apps/sim/blocks/blocks/slack.ts index 5ff889943bf..b7d9502124a 100644 --- a/apps/sim/blocks/blocks/slack.ts +++ b/apps/sim/blocks/blocks/slack.ts @@ -3551,6 +3551,7 @@ export const SlackV2Block: BlockConfig = { 'Build Slack workflows with messages, conversations, files, reactions, pins, bookmarks, user groups, profiles, Lists, canvases, and Agent Sessions. Operations that need additional app scopes use custom Slack bots. Lists require lists:read/lists:write and a paid Slack plan. Native Sim connections retain their existing permissions. Page through list outputs explicitly.', bestPractices: `${SlackBlock.bestPractices} Native agent-session streaming uses a custom Slack bot and a supported trigger event. Enable streamResponse and select the intended outputs in streamOutputs; Sim Chat (mothership) streams its content output. The trigger owns the streamed reply, so another send needs a separate purpose. +To show an Agent's tool steps without posting its text (for example an analyst whose output a later block reviews), list that Agent in streamTimelineSources while streamOutputs keeps the block that posts the answer (a block cannot be in both), and optionally name its tools in streamToolLabels. The custom-bot manifest's baseline agent scopes are ${SLACK_AGENT_SCOPES.join(', ')}. Selected capabilities add their required scopes and event subscriptions. Verify the installed app's grants, resource access and event configuration; a saved credential or edited manifest alone does not prove access. streamIncludeToolCalls displays tool activity; it does not authorize tool execution. Configure Sim Chat's selected operations and their credentials separately. Choose streamIncludeThinking deliberately for the destination audience. Block Kit messages can contain buttons, selects and forms, but interactions require the app's interactivity request URL and the corresponding interaction trigger. Treat message events, button/select callbacks and modal submissions as separate paths. A control's action_id/value correlates work; runtime actor and state checks authorize it.`, diff --git a/apps/sim/blocks/blocks/table.ts b/apps/sim/blocks/blocks/table.ts index cee3e621c26..0eba39cf6bc 100644 --- a/apps/sim/blocks/blocks/table.ts +++ b/apps/sim/blocks/blocks/table.ts @@ -9,8 +9,11 @@ import { mapperOperation, parseOptionalNumberInput, resolveTableColumnSelection, + TABLE_IGNORED_COLUMNS_OUTPUT, TABLE_OUTPUT_COLUMNS_INPUT, TABLE_OUTPUT_COLUMNS_SUBBLOCK, + TABLE_ROW_OUTPUT, + TABLE_ROWS_OUTPUT, toolCallArg, } from '@/blocks/utils' import { TABLE_ID_PARAM } from '@/tools/table/params' @@ -440,7 +443,7 @@ Return ONLY the data JSON:`, type: 'short-input', canonicalParamId: 'conflictColumn', mode: 'advanced', - placeholder: 'Enter the column id', + placeholder: 'Enter the column name', dependsOn: ['tableId'], condition: { field: 'operation', value: 'upsert_row' }, }, @@ -809,30 +812,19 @@ Return ONLY the sort JSON:`, conflictColumn: { type: 'string', description: - 'Unique column to match on for upsert (required if the table has multiple unique columns)', + 'Unique column (name or id) to match on for upsert (required if the table has multiple unique columns)', }, }, outputs: { success: { type: 'boolean', description: 'Operation success status' }, - row: { - type: 'json', - description: 'Single row data', - condition: { - field: 'operation', - value: ['get_row', 'insert_row', 'upsert_row', 'update_row'], - }, - }, + row: TABLE_ROW_OUTPUT, operation: { type: 'string', description: 'Operation performed (insert or update)', condition: { field: 'operation', value: 'upsert_row' }, }, - rows: { - type: 'array', - description: 'Array of rows', - condition: { field: 'operation', value: ['query_rows', 'batch_insert_rows'] }, - }, + rows: TABLE_ROWS_OUTPUT, rowCount: { type: 'number', description: 'Rows returned (query) or total rows in the table (get schema)', @@ -888,6 +880,7 @@ Return ONLY the sort JSON:`, description: "Max rows per table for the workspace's plan", condition: { field: 'operation', value: 'get_schema' }, }, + ignoredColumns: TABLE_IGNORED_COLUMNS_OUTPUT, message: { type: 'string', description: 'Operation status message' }, }, triggers: { diff --git a/apps/sim/blocks/blocks/table_v2.ts b/apps/sim/blocks/blocks/table_v2.ts index e7e303b2934..7c260cc254e 100644 --- a/apps/sim/blocks/blocks/table_v2.ts +++ b/apps/sim/blocks/blocks/table_v2.ts @@ -16,8 +16,11 @@ import { failToolCallOnError, mapperOperation, resolveTableColumnSelection, + TABLE_IGNORED_COLUMNS_OUTPUT, TABLE_OUTPUT_COLUMNS_INPUT, TABLE_OUTPUT_COLUMNS_SUBBLOCK, + TABLE_ROW_OUTPUT, + TABLE_ROWS_OUTPUT, toolCallArg, } from '@/blocks/utils' import { TABLE_ID_PARAM } from '@/tools/table/params' @@ -412,7 +415,7 @@ Return ONLY the data JSON:`, type: 'short-input', canonicalParamId: 'conflictColumn', mode: 'advanced', - placeholder: 'Enter the column id', + placeholder: 'Enter the column name', dependsOn: ['tableId'], condition: { field: 'operation', value: 'upsert_row' }, }, @@ -604,30 +607,19 @@ Return ONLY the JSON object:`, conflictColumn: { type: 'string', description: - 'Unique column to match on for upsert (required if the table has multiple unique columns)', + 'Unique column (name or id) to match on for upsert (required if the table has multiple unique columns)', }, }, outputs: { success: { type: 'boolean', description: 'Operation success status' }, - row: { - type: 'json', - description: 'Single row data', - condition: { - field: 'operation', - value: ['get_row', 'insert_row', 'upsert_row', 'update_row'], - }, - }, + row: TABLE_ROW_OUTPUT, operation: { type: 'string', description: 'Operation performed (insert or update)', condition: { field: 'operation', value: 'upsert_row' }, }, - rows: { - type: 'array', - description: 'Array of rows', - condition: { field: 'operation', value: ['query_rows', 'batch_insert_rows'] }, - }, + rows: TABLE_ROWS_OUTPUT, rowCount: { type: 'number', description: 'Rows returned (query) or total rows in the table (get schema)', @@ -688,6 +680,7 @@ Return ONLY the JSON object:`, description: "Max rows per table for the workspace's plan", condition: { field: 'operation', value: 'get_schema' }, }, + ignoredColumns: TABLE_IGNORED_COLUMNS_OUTPUT, message: { type: 'string', description: 'Operation status message' }, }, triggers: { diff --git a/apps/sim/blocks/types.ts b/apps/sim/blocks/types.ts index 9741d29939d..54efa034522 100644 --- a/apps/sim/blocks/types.ts +++ b/apps/sim/blocks/types.ts @@ -393,6 +393,8 @@ export interface SubBlockConfig { min?: number max?: number columns?: string[] + /** Limits a `workflow-output-selector` to blocks of one type, each selecting `path`. */ + outputFilter?: { blockType: string; path: string } placeholder?: string /** * Conceals the stored value in the editor until the field is focused. @@ -724,6 +726,13 @@ export interface BlockConfig { url: string } } + /** + * Text outputs the block writes only when it fails into an error edge, beside the `error` + * every failed block writes (`BlockExecutor.handleBlockError`). A reference to one is valid + * exactly where `` is: a successful run resolves it empty, and workflow source + * checks it against the block's `onError` edge as it does `error`. + */ + errorOutputs?: Record hideFromToolbar?: boolean /** * For published custom blocks only: the bound source workflow's id. Discovery diff --git a/apps/sim/blocks/utils.test.ts b/apps/sim/blocks/utils.test.ts index 9d81b8f0d4e..5db6ba4e670 100644 --- a/apps/sim/blocks/utils.test.ts +++ b/apps/sim/blocks/utils.test.ts @@ -1,7 +1,7 @@ import { resetEnvFlagsMock, setEnvFlags } from '@sim/testing' import { oauthUtilsMock } from '@sim/testing/mocks/oauth-utils.mock' import { providersUtilsMock } from '@sim/testing/mocks/providers-utils.mock' -import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest' +import { afterAll, afterEach, beforeEach, describe, expect, it, vi } from 'vitest' afterAll(resetEnvFlagsMock) @@ -26,6 +26,9 @@ const { mockProviders } = vi.hoisted(() => ({ litellm: { models: [] as string[], isLoading: false }, openrouter: { models: [] as string[], isLoading: false }, fireworks: { models: [] as string[], isLoading: false }, + 'ollama-cloud': { models: [] as string[], isLoading: false }, + together: { models: [] as string[], isLoading: false }, + baseten: { models: [] as string[], isLoading: false }, }, }, })) @@ -62,16 +65,21 @@ import { evaluateSubBlockCondition } from '@sim/workflow-code/catalog/canonical- import { S3Icon } from '@/components/icons' import type { BlockConfig } from '@/blocks/types' import { + findConfiguredModelProvider, + getAgentModelOptions, getApiKeyCondition, + getModelOptions, + getModelOptionsWithAuto, getProviderCredentialSubBlocks, getSelectedBedrockCredential, - getSerializedModelProviderId, parseOptionalBooleanInput, parseOptionalJsonInput, parseOptionalNumberInput, requiresProviderFamilyCredentials, + resolveModelProviderId, withSavedCredential, } from '@/blocks/utils' +import { DEFAULT_BLOCK_MODEL } from '@/providers/default-model' import { getProviderFromModel } from '@/providers/utils' const BASE_CLOUD_MODELS: Record = { @@ -213,6 +221,9 @@ describe('getApiKeyCondition / shouldRequireApiKeyForModel', () => { litellm: { models: [], isLoading: false }, openrouter: { models: [], isLoading: false }, fireworks: { models: [], isLoading: false }, + 'ollama-cloud': { models: [], isLoading: false }, + together: { models: [], isLoading: false }, + baseten: { models: [], isLoading: false }, } mockGetHostedModels.mockReturnValue([]) mockGetProviderModels.mockReturnValue([]) @@ -323,33 +334,101 @@ describe('parseOptionalBooleanInput', () => { }) }) -describe('getSerializedModelProviderId', () => { +describe('model options', () => { + const ids = (options: { id: string }[]) => options.map(({ id }) => id) + + const empty = { models: [] as string[], isLoading: false } + const originalProviders = mockProviders.value + + beforeEach(() => { + mockProviders.value = { + base: { models: ['gpt-4o'], isLoading: false }, + ollama: empty, + 'ollama-cloud': empty, + vllm: empty, + litellm: empty, + openrouter: empty, + fireworks: empty, + together: empty, + baseten: empty, + } + }) + + afterEach(() => { + mockProviders.value = originalProviders + setEnvFlags({ isHosted: false }) + }) + + it('offers Auto on hosted Sim only to blocks that resolve it through the model router', () => { + setEnvFlags({ isHosted: true }) + + expect(ids(getModelOptions())).toEqual(['gpt-4o']) + expect(ids(getModelOptionsWithAuto())).toEqual(['gpt-4o', 'sim-auto']) + expect(ids(getAgentModelOptions())).toEqual(['gpt-4o', 'sim-auto']) + }) + + it('never offers Auto on self-hosted Sim', () => { + expect(ids(getModelOptionsWithAuto())).toEqual(['gpt-4o']) + expect(ids(getAgentModelOptions())).toEqual(['gpt-4o']) + }) +}) + +describe('resolveModelProviderId', () => { const resolver = vi.mocked(getProviderFromModel) beforeEach(() => { resolver.mockReset() resolver.mockImplementation(((model: string) => { if (model.startsWith('openrouter/')) return 'openrouter' - if (model === 'gpt-4o') return 'openai' - if (model === 'claude-sonnet-5') return 'anthropic' + if (model === DEFAULT_BLOCK_MODEL) return 'anthropic' throw new Error(`No provider found for model: ${model}`) }) as unknown as typeof getProviderFromModel) }) it('resolves a gateway model that the base model map deliberately omits', () => { - expect(getSerializedModelProviderId('openrouter/meta-llama/llama-4-maverick')).toBe( - 'openrouter' - ) + expect(resolveModelProviderId('openrouter/meta-llama/llama-4-maverick')).toBe('openrouter') }) - it('uses the fallback model when the model is still an unresolved reference', () => { - expect(getSerializedModelProviderId('openrouter/')).toBe('openai') + it('uses the default block model when the model is unset or still an unresolved reference', () => { + expect(resolveModelProviderId('openrouter/')).toBe('anthropic') + expect(resolveModelProviderId(undefined)).toBe('anthropic') expect(resolver).not.toHaveBeenCalledWith('openrouter/') }) + it('looks up sim-auto as the model it falls back to, never as itself', () => { + expect(resolveModelProviderId('sim-auto')).toBe('anthropic') + expect(resolveModelProviderId(' SIM-AUTO ')).toBe('anthropic') + expect(resolver).toHaveBeenCalledWith(DEFAULT_BLOCK_MODEL) + expect(resolver).not.toHaveBeenCalledWith('sim-auto') + expect(resolver).not.toHaveBeenCalledWith(' SIM-AUTO ') + }) + it('never throws when the resolver rejects the model', () => { - expect(() => getSerializedModelProviderId('totally-unknown-model')).not.toThrow() - expect(getSerializedModelProviderId('totally-unknown-model')).toBe('openai') + expect(() => resolveModelProviderId('totally-unknown-model')).not.toThrow() + expect(resolveModelProviderId('totally-unknown-model')).toBe('openai') + }) +}) + +describe('findConfiguredModelProvider', () => { + const resolver = vi.mocked(getProviderFromModel) + + beforeEach(() => { + resolver.mockReset() + resolver.mockImplementation(((model: string) => { + if (model.startsWith('openrouter/')) return 'openrouter' + if (model === 'sim-auto') throw new Error('sim-auto has no provider') + if (model === 'blacklisted-model') throw new Error('blacklisted') + return 'anthropic' + }) as unknown as typeof getProviderFromModel) + }) + + it('keeps the explicit namespace of a model reference', () => { + expect(findConfiguredModelProvider('openrouter/')).toBe('openrouter') + }) + + it('names no provider for sim-auto or a blacklisted model', () => { + expect(findConfiguredModelProvider('sim-auto')).toBeNull() + expect(findConfiguredModelProvider('blacklisted-model')).toBeNull() }) }) diff --git a/apps/sim/blocks/utils.ts b/apps/sim/blocks/utils.ts index 60e5a75d7ff..cc0bcff444e 100644 --- a/apps/sim/blocks/utils.ts +++ b/apps/sim/blocks/utils.ts @@ -8,7 +8,13 @@ import type { SelectorKey } from '@/lib/selectors/manifest' import { containsReference } from '@/lib/workflows/sanitization/references' import { getDependsOnFields } from '@/lib/workflows/subblocks/dependencies' import { isTriggerModeSubBlock } from '@/lib/workflows/subblocks/visibility' -import type { BlockConfig, BlockToolParamsContext, SubBlockConfig } from '@/blocks/types' +import type { + BlockConfig, + BlockToolParamsContext, + OutputFieldDefinition, + SubBlockConfig, +} from '@/blocks/types' +import { DEFAULT_BLOCK_MODEL } from '@/providers/default-model' import { findProviderFromModel, getBaseModelProviders, @@ -31,6 +37,7 @@ import { SAVED_CREDENTIAL_OAUTH, type SavedCredentialService, } from '@/tools/shared/saved-credentials' +import { IGNORED_COLUMNS_OUTPUT } from '@/tools/table/types' export const AZURE_MODELS = [ ...getProviderModels('azure-openai'), @@ -232,18 +239,47 @@ function dependOnCredential( } /** - * Returns model options for combobox subblocks, combining all provider sources. + * Model options for a combobox whose block sends the chosen model straight to its provider: + * every provider source, without the sim-auto pseudo-model, which only a block that runs + * the model router can resolve. */ export function getModelOptions() { - return buildModelOptions(false) + return buildModelOptions({ includeEvaluation: false, includeAuto: false }) } -/** Agent supports both conversational and native evaluation models. */ +/** + * {@link getModelOptions} plus Auto (hosted only), for a block whose handler resolves + * sim-auto through the model router before any provider lookup (router, evaluator). + */ +export function getModelOptionsWithAuto() { + return buildModelOptions({ includeEvaluation: false, includeAuto: true }) +} + +/** Agent supports Auto and both conversational and native evaluation models. */ export function getAgentModelOptions() { - return buildModelOptions(true) + return buildModelOptions({ includeEvaluation: true, includeAuto: true }) } -function buildModelOptions(includeEvaluation: boolean) { +/** + * The model-option sources whose values editing validation checks against Sim's model + * catalog, and whether each offers Auto (so accepts sim-auto on hosted Sim). + * + * {@link getAgentModelOptions} is deliberately absent: the agent's model field also takes + * free-typed ids (Bedrock inference profiles, fine-tunes) and retired ids, so validation + * passes its values through unchanged. + */ +export const MODEL_OPTION_SOURCES: ReadonlyMap = new Map([ + [getModelOptions, { auto: false }], + [getModelOptionsWithAuto, { auto: true }], +]) + +function buildModelOptions({ + includeEvaluation, + includeAuto, +}: { + includeEvaluation: boolean + includeAuto: boolean +}) { const providersState = useProvidersStore.getState() const baseModels = orderModelIdsByReleaseDate(providersState.providers.base.models) const ollamaModels = providersState.providers.ollama.models @@ -282,7 +318,7 @@ function buildModelOptions(includeEvaluation: boolean) { // Hosted-only automatic model. Deliberately LAST in the list (limited // visibility for the initial release): available to anyone who scrolls or // searches for it, but never the first thing the dropdown offers. - if (getDeploymentShape().hosted) { + if (includeAuto && getDeploymentShape().hosted) { options.push({ label: 'Auto', id: SIM_AUTO_MODEL_ID, icon: SimAutoIcon }) } @@ -316,12 +352,12 @@ function getProviderFromStore(model: string): string | null { } /** - * Whether an Ollama instance is available. `isOllamaConfigured` reads the + * Whether this browser knows of an Ollama instance. `isOllamaConfigured` reads the * server-only `OLLAMA_URL` env var, which is always undefined in the browser — * there the providers store (populated from the server's model list, which is * non-empty only when Ollama is configured) is the signal. */ -function isOllamaAvailable(): boolean { +function hasOllamaInstance(): boolean { if (isOllamaConfigured) return true return useProvidersStore.getState().providers.ollama.models.length > 0 } @@ -381,7 +417,7 @@ export function shouldRequireApiKeyForModel(model: string): boolean { return false if (storeProvider) return true - if (isOllamaAvailable()) { + if (hasOllamaInstance()) { if (normalizedModel.includes('/')) return true if (normalizedModel in getBaseModelProviders()) return true return false @@ -390,37 +426,35 @@ export function shouldRequireApiKeyForModel(model: string): boolean { return true } -/** Model whose provider is recorded when a block's own `model` cannot be resolved. */ -const SERIALIZATION_FALLBACK_MODEL = 'gpt-4o' - -/** Last-resort provider for when even {@link SERIALIZATION_FALLBACK_MODEL} cannot be resolved. */ +/** Provider recorded when the model's own lookup throws (a blacklisted provider or model). */ const SERIALIZATION_FALLBACK_PROVIDER: ProviderId = 'openai' /** - * Provider id a model-driven block records for `model` during serialization. + * Best-effort provider id for a model a block has not executed yet, for serialization and + * the editor's tool-usage control. Editor decisions about the provider the user configured + * use {@link findConfiguredModelProvider} instead. * * Serialization runs before variable resolution, and every model block's handler * re-derives the provider from the *resolved* model without ever reading this - * value — so it only has to be shape-correct, and it must never throw. Two cases - * reach here that {@link getBaseModelProviders} cannot answer: `model` may still - * hold a `` reference, and gateway providers (OpenRouter, vLLM, - * LiteLLM, Ollama, …) are deliberately absent from that map even when the model - * id is perfectly valid. A reference resolves to {@link SERIALIZATION_FALLBACK_MODEL}'s - * provider; anything else is left to `getProviderFromModel`, which defaults an - * unrecognised id to `ollama` rather than failing serialization with an error the - * user cannot act on. + * value — so it only has to be shape-correct, and it must never throw. Three cases + * reach here that {@link getBaseModelProviders} cannot answer: `model` may be unset or + * still hold a `` reference, it may be sim-auto, which has no provider until + * the model router resolves it, and gateway providers (OpenRouter, vLLM, LiteLLM, Ollama, …) + * are deliberately absent from that map even when the model id is perfectly valid. The + * first two answer as {@link DEFAULT_BLOCK_MODEL}; anything else is left to + * `getProviderFromModel`, which defaults an unrecognised id to `ollama` rather than + * failing with an error the user cannot act on. * * The remaining throw is a blacklisted provider or model, which is env-driven and - * can name the fallback itself — so recovery returns + * can name the default itself — so recovery returns * {@link SERIALIZATION_FALLBACK_PROVIDER} outright rather than resolving a second * time through the function that just threw. */ -export function getSerializedModelProviderId( - model: unknown, - fallbackModel: string = SERIALIZATION_FALLBACK_MODEL -): ProviderId { +export function resolveModelProviderId(model: unknown): ProviderId { const candidate = - typeof model === 'string' && model && !containsReference(model) ? model : fallbackModel + typeof model === 'string' && model && !containsReference(model) && !isAutoModel(model) + ? model + : DEFAULT_BLOCK_MODEL try { return getProviderFromModel(candidate) @@ -429,6 +463,22 @@ export function getSerializedModelProviderId( } } +/** + * The provider a model value names as written, or `null` when it names none yet: sim-auto, + * which the model router resolves at execution and may route to any pool provider, or a + * blacklisted model. Unlike {@link resolveModelProviderId} it never substitutes the default + * model, so a reference keeps its explicit namespace (`openrouter/`). The editor + * uses it for decisions that follow the configured provider: clearing the API key when the + * provider changes, and how large an attachment the model is known to accept. + */ +export function findConfiguredModelProvider(model: string): ProviderId | null { + try { + return getProviderFromModel(model) + } catch { + return null + } +} + /** * Visibility condition for a model-tuning field that only some models accept, such as * reasoning effort or verbosity. Gates on the capability list, but keeps the field visible @@ -879,6 +929,55 @@ export const TABLE_OUTPUT_COLUMNS_SUBBLOCK: SubBlockConfig = { condition: { field: 'operation', value: 'query_rows' }, } +/** + * The `ignoredColumns` output of the Table blocks: present on every operation that writes row + * data, which drops a key naming no column instead of failing. + */ +export const TABLE_IGNORED_COLUMNS_OUTPUT = { + type: 'array', + description: IGNORED_COLUMNS_OUTPUT.description, + condition: { + field: 'operation', + value: ['insert_row', 'batch_insert_rows', 'upsert_row', 'update_row', 'update_rows_by_filter'], + }, +} satisfies OutputFieldDefinition + +/** + * One row as the Table blocks output it (`presentNamedTableRow` and `presentNamedTableQueryRow` + * in `lib/internal/table/presentation.ts`): its cells sit under `data`, keyed by column name. + */ +const TABLE_ROW_PROPERTIES = { + id: { type: 'string', description: 'Row ID' }, + data: { type: 'json', description: 'The row’s cells, keyed by column name' }, + position: { type: 'number', description: 'Row position in the table' }, + orderKey: { type: 'string', description: 'Sort key (query and insert results only)' }, + executions: { + type: 'json', + description: 'Workflow run state per column group (query and insert results only)', + }, + createdAt: { type: 'string', description: 'ISO timestamp when the row was created' }, + updatedAt: { type: 'string', description: 'ISO timestamp when the row was last updated' }, +} satisfies Record + +/** The `row` output of the Table blocks: a cell reads as `row.data.`. */ +export const TABLE_ROW_OUTPUT = { + type: 'json', + description: 'The row: its cells are row.data.', + condition: { + field: 'operation', + value: ['get_row', 'insert_row', 'upsert_row', 'update_row'], + }, + properties: TABLE_ROW_PROPERTIES, +} satisfies OutputFieldDefinition + +/** The `rows` output of the Table blocks: a cell reads as `rows[i].data.`. */ +export const TABLE_ROWS_OUTPUT = { + type: 'array', + description: 'The rows: a cell is rows[i].data.', + condition: { field: 'operation', value: ['query_rows', 'batch_insert_rows'] }, + items: { type: 'json', properties: TABLE_ROW_PROPERTIES }, +} satisfies OutputFieldDefinition + /** Block input entry for {@link TABLE_OUTPUT_COLUMNS_SUBBLOCK}. */ export const TABLE_OUTPUT_COLUMNS_INPUT = { type: 'array', diff --git a/apps/sim/components/emails/billing/plan-welcome-email.tsx b/apps/sim/components/emails/billing/plan-welcome-email.tsx index 62dffa15bb9..8e3ae5de2f0 100644 --- a/apps/sim/components/emails/billing/plan-welcome-email.tsx +++ b/apps/sim/components/emails/billing/plan-welcome-email.tsx @@ -7,13 +7,21 @@ interface PlanWelcomeEmailProps { planName: string userName?: string loginLink?: string + trial?: { + /** When the trial ends and the card is first charged, already formatted for display. */ + endsOn: string + /** Credits the trial includes, already formatted for display. */ + credits: string + } } -export function PlanWelcomeEmail({ planName, userName, loginLink }: PlanWelcomeEmailProps) { +export function PlanWelcomeEmail({ planName, userName, loginLink, trial }: PlanWelcomeEmailProps) { const baseUrl = getBaseUrl() const cta = loginLink || `${baseUrl}/login` - const previewText = `Sim: Your ${planName} plan is active` + const previewText = trial + ? `Sim: Your ${planName} free trial has started` + : `Sim: Your ${planName} plan is active` return ( @@ -23,6 +31,14 @@ export function PlanWelcomeEmail({ planName, userName, loginLink }: PlanWelcomeE your workflows. + {trial && ( + + Your free trial includes {trial.credits} credits and runs until{' '} + {trial.endsOn}. Your card is charged for {planName} when the + trial ends unless you cancel before then in Settings → Subscription. + + )} + Open Sim diff --git a/apps/sim/components/emails/billing/usage-limit-reached-email.tsx b/apps/sim/components/emails/billing/usage-limit-reached-email.tsx index 90d8d35b903..4a12d7cd4a6 100644 --- a/apps/sim/components/emails/billing/usage-limit-reached-email.tsx +++ b/apps/sim/components/emails/billing/usage-limit-reached-email.tsx @@ -11,6 +11,39 @@ interface UsageLimitReachedEmailProps { currentUsage: number limit: number ctaLink: string + /** Set during a free trial, whose allowance is fixed until the trial ends on this date. */ + trialEndsOn?: string +} + +const PAUSED_PRODUCTS = 'Workflow runs, knowledge base search, document uploads, and Chat' + +/** The email's wording: a trial waits for its end date, other plans raise the limit. */ +function getLimitReachedCopy( + planName: string, + scope: 'user' | 'organization', + trialEndsOn: string | undefined +): { preview: string; status: string; remedy?: string; action: string } { + if (trialEndsOn) { + return { + preview: `Sim: You've used your ${planName} trial credits`, + status: `You've used the credits included in your ${planName} free trial. ${PAUSED_PRODUCTS} are paused until your trial ends on ${trialEndsOn}, when your full ${planName} allowance starts.`, + action: 'View Billing', + } + } + if (scope === 'organization') { + return { + preview: `Sim: You've reached your ${planName} usage limit`, + status: `Your organization has reached its monthly usage limit on the ${planName} plan. ${PAUSED_PRODUCTS} are paused until the limit goes up.`, + remedy: 'Raise the organization usage limit in billing settings to resume.', + action: 'Raise Organization Limit', + } + } + return { + preview: `Sim: You've reached your ${planName} usage limit`, + status: `You've reached your monthly usage limit on the ${planName} plan. ${PAUSED_PRODUCTS} are paused until the limit goes up.`, + remedy: 'Raise your usage limit in billing settings, or upgrade your plan, to resume.', + action: 'Raise Usage Limit', + } } /** @@ -25,21 +58,15 @@ export function UsageLimitReachedEmail({ currentUsage, limit, ctaLink, + trialEndsOn, }: UsageLimitReachedEmailProps) { - const isOrganization = scope === 'organization' - const previewText = `Sim: You've reached your ${planName} usage limit` + const copy = getLimitReachedCopy(planName, scope, trialEndsOn) return ( - + {userName ? `Hi ${userName},` : 'Hi,'} - - {isOrganization - ? `Your organization has reached its monthly usage limit on the ${planName} plan.` - : `You've reached your monthly usage limit on the ${planName} plan.`}{' '} - Workflow runs, knowledge base search, document uploads, and Chat are paused until the limit - goes up. - + {copy.status}
    Usage @@ -49,15 +76,9 @@ export function UsageLimitReachedEmail({
    - - {isOrganization - ? 'Raise the organization usage limit in billing settings to resume.' - : 'Raise your usage limit in billing settings, or upgrade your plan, to resume.'} - + {copy.remedy && {copy.remedy}} - - {isOrganization ? 'Raise Organization Limit' : 'Raise Usage Limit'} - + {copy.action}
    diff --git a/apps/sim/components/emails/billing/usage-threshold-email.tsx b/apps/sim/components/emails/billing/usage-threshold-email.tsx index 15fed183055..105d0dd4502 100644 --- a/apps/sim/components/emails/billing/usage-threshold-email.tsx +++ b/apps/sim/components/emails/billing/usage-threshold-email.tsx @@ -10,6 +10,8 @@ interface UsageThresholdEmailProps { currentUsage: number limit: number ctaLink: string + /** Set during a free trial, whose allowance is fixed until the trial ends on this date. */ + trialEndsOn?: string } export function UsageThresholdEmail({ @@ -19,16 +21,27 @@ export function UsageThresholdEmail({ currentUsage, limit, ctaLink, + trialEndsOn, }: UsageThresholdEmailProps) { - const previewText = `Sim: You're at ${percentUsed}% of your ${planName} monthly budget` + const copy = trialEndsOn + ? { + preview: `Sim: You're at ${percentUsed}% of your ${planName} trial credits`, + status: `You're approaching the credits included in your ${planName} free trial.`, + remedy: `Your full ${planName} allowance starts when your trial ends on ${trialEndsOn}.`, + action: 'View Billing', + } + : { + preview: `Sim: You're at ${percentUsed}% of your ${planName} monthly budget`, + status: `You're approaching your monthly budget on the ${planName} plan.`, + remedy: 'To avoid interruptions, consider increasing your monthly limit.', + action: 'Review Limits', + } return ( - + {userName ? `Hi ${userName},` : 'Hi,'} - - You're approaching your monthly budget on the {planName} plan. - + {copy.status}
    Usage @@ -38,11 +51,9 @@ export function UsageThresholdEmail({
    - - To avoid interruptions, consider increasing your monthly limit. - + {copy.remedy} - Review Limits + {copy.action}
    diff --git a/apps/sim/components/emails/render.ts b/apps/sim/components/emails/render.ts index ac49bb129ce..ca80b2478f5 100644 --- a/apps/sim/components/emails/render.ts +++ b/apps/sim/components/emails/render.ts @@ -140,17 +140,9 @@ export async function renderUsageThresholdEmail(params: { currentUsage: number limit: number ctaLink: string + trialEndsOn?: string }): Promise { - return await render( - UsageThresholdEmail({ - userName: params.userName, - planName: params.planName, - percentUsed: params.percentUsed, - currentUsage: params.currentUsage, - limit: params.limit, - ctaLink: params.ctaLink, - }) - ) + return await render(UsageThresholdEmail(params)) } export async function renderUsageLimitReachedEmail(params: { @@ -160,6 +152,7 @@ export async function renderUsageLimitReachedEmail(params: { currentUsage: number limit: number ctaLink: string + trialEndsOn?: string }): Promise { return await render(UsageLimitReachedEmail(params)) } @@ -227,14 +220,9 @@ export async function renderPlanWelcomeEmail(params: { planName: string userName?: string loginLink?: string + trial?: { endsOn: string; credits: string } }): Promise { - return await render( - PlanWelcomeEmail({ - planName: params.planName, - userName: params.userName, - loginLink: params.loginLink, - }) - ) + return await render(PlanWelcomeEmail(params)) } export async function renderWelcomeEmail(userName?: string): Promise { diff --git a/apps/sim/components/emails/subjects.ts b/apps/sim/components/emails/subjects.ts index a049b44d9c4..284342f7e21 100644 --- a/apps/sim/components/emails/subjects.ts +++ b/apps/sim/components/emails/subjects.ts @@ -16,6 +16,8 @@ export type EmailSubjectType = | 'permission-access-request-decided' | 'enterprise-subscription' | 'usage-threshold' + | 'trial-usage-threshold' + | 'trial-credits-exhausted' | 'free-tier-upgrade' | 'payment-failed' | 'credit-purchase' @@ -61,6 +63,10 @@ export function getEmailSubject(type: EmailSubjectType): string { return `Your Enterprise Plan is now active on Sim` case 'usage-threshold': return `You're nearing your monthly budget on Sim` + case 'trial-usage-threshold': + return `You're at 80% of your trial credits on Sim` + case 'trial-credits-exhausted': + return `You've used your trial credits on Sim` case 'free-tier-upgrade': return `You're at 80% of your free credits on Sim` case 'payment-failed': @@ -96,8 +102,10 @@ export function getLimitEmailSubject(reason: UpgradeReason, kind: 'warning' | 'r } /** The plan's display name is resolved at send time; it carries tier qualifiers. */ -export function getPlanWelcomeSubject(planDisplayName: string): string { - return `Your ${planDisplayName} plan is now active on Sim` +export function getPlanWelcomeSubject(planDisplayName: string, isTrial = false): string { + return isTrial + ? `Your ${planDisplayName} free trial has started on Sim` + : `Your ${planDisplayName} plan is now active on Sim` } /** Echoes the sender's own subject line so the reply threads correctly. */ diff --git a/apps/sim/content/blog/enterprise/index.mdx b/apps/sim/content/blog/enterprise/index.mdx index e6677ec3c61..b41ed37a5ff 100644 --- a/apps/sim/content/blog/enterprise/index.mdx +++ b/apps/sim/content/blog/enterprise/index.mdx @@ -17,7 +17,7 @@ featured: true draft: false faq: - q: "Does Sim have a SOC 2 Type II report, and can we get a copy for vendor review?" - a: "Yes. Sim maintains a SOC 2 Type II report based on annual examinations of security, availability, and confidentiality controls. Sim shares the report directly with prospective customers under NDA and also provides penetration test reports, architecture documentation, and completed security questionnaires in SIG, CAIQ, and custom formats." + a: "Yes. Sim has completed a SOC 2 Type II audit covering the Security Trust Services Criterion, performed by an independent auditor, and maintains continuous control monitoring. Sim shares the report directly with prospective customers under NDA and also provides penetration test reports, architecture documentation, and completed security questionnaires in SIG, CAIQ, and custom formats." - q: "What does Sim provide for an enterprise security review?" a: "Sim provides its SOC 2 Type II report under NDA, penetration test reports, architecture documentation, and completed security questionnaires for enterprise security reviews. Reviewers can also evaluate SSO through SAML 2.0 or OIDC, permission groups enforced at the execution layer, configurable data-retention policies for execution traces, BYOK with customer-managed model credentials, and self-hosted deployment on customer infrastructure." - q: "How are SLAs and dedicated support handled?" @@ -131,9 +131,9 @@ This centralizes your authentication and audit trail. Your security team's polic ## Compliance & Data Retention -![Compliance Certifications](/blog/enterprise/compliance.png) +![Compliance](/blog/enterprise/compliance.png) -Sim maintains **SOC 2 Type II** certification with annual audits covering security, availability, and confidentiality controls. We share our SOC 2 report directly with prospective customers under NDA. +Sim has completed a **SOC 2 Type II** audit covering the Security Trust Services Criterion, performed by an independent auditor, and maintains continuous control monitoring. We share our SOC 2 report directly with prospective customers under NDA. **Data Retention** — Configure how long workflow execution traces, inputs, and outputs are stored before automatic deletion. We work with enterprise customers to set retention policies that match their compliance requirements. diff --git a/apps/sim/content/library/agentforce-pricing/index.mdx b/apps/sim/content/library/agentforce-pricing/index.mdx new file mode 100644 index 00000000000..86e43aae175 --- /dev/null +++ b/apps/sim/content/library/agentforce-pricing/index.mdx @@ -0,0 +1,128 @@ +--- +slug: agentforce-pricing +title: 'Salesforce Agentforce Pricing: What IT and Salesforce Owners Pay' +seoTitle: 'Salesforce Agentforce Pricing and Total Cost' +description: 'Salesforce Agentforce Flex Credits cost $500 per 100,000 credits. Estimate action, conversation, license, Data Cloud, and implementation costs.' +date: 2026-11-24 +updated: 2026-11-24 +authors: + - andrew +readingTime: 7 +tags: [Salesforce, Agentforce, AI Agents, Pricing, Sim] +ogImage: /library/agentforce-pricing/cover.jpg +draft: false +faq: + - q: "What counts as a Salesforce Agentforce conversation?" + a: "Salesforce Agentforce treats a conversation as the applicable billable customer interaction defined by Salesforce’s usage rules and contract, so buyers should confirm session boundaries, channel behavior, and reconnect rules on their order form." + - q: "Is Salesforce Agentforce pricing predictable?" + a: "Salesforce Agentforce pricing is predictable only when the team can forecast conversations, actions per outcome, licensed users, and Data Cloud consumption with reasonable accuracy." + - q: "Is Salesforce Agentforce billed separately from model usage?" + a: "Salesforce Agentforce pricing should be reviewed with the complete Salesforce order form because Agentforce usage, Data Cloud services, prerequisite editions, and connected third-party APIs can create separate cost components." + - q: "Can Salesforce Agentforce and Sim be used together?" + a: "Salesforce Agentforce and Sim can be used together when Agentforce handles Salesforce-native experiences while Sim coordinates agents and workflows across Salesforce and other systems." + - q: "Can Sim replace Salesforce Agentforce?" + a: "Sim can replace Salesforce Agentforce for workflows where Salesforce is one connected system rather than the required agent runtime, but Agentforce may remain the better fit for deeply Salesforce-native experiences." + - q: "Does Sim support bring-your-own-key for Salesforce AI agents?" + a: "Sim supports workspace BYOK on every Sim Cloud plan, while organization-level model keys require Pro for Teams, Max for Teams, or Enterprise." + - q: "What is the best AI agent builder for Salesforce automation?" + a: "Sim fits Salesforce automation that prioritizes cross-system workflows, visual building, model choice, BYOK, and self-hosting, while Salesforce Agentforce fits predominantly Salesforce-native agent experiences." + - q: "Which AI agent tools offer a Salesforce MCP server for CRM data?" + a: "Salesforce provides the hosted Salesforce MCP server, and Sim can connect that server to an AI agent workflow so the agent can use authorized CRM tools alongside other systems." + - q: "Should IT compare Salesforce Agentforce by cost per conversation or cost per outcome?" + a: "IT should compare Salesforce Agentforce by cost per completed business outcome because one conversation can trigger multiple actions, data operations, integrations, and human review steps." + - q: "Are Salesforce Agentforce implementation costs included in the list price?" + a: "Salesforce Agentforce list prices do not provide one universal implementation allowance, so buyers should budget separately for design, integration, security review, testing, deployment, training, and ongoing evaluation." +--- + +## TL;DR + +[Salesforce Agentforce pricing](https://www.salesforce.com/agentforce/pricing/) uses a mix of usage-based and per-user models. Flex Credits cost $500 per 100,000 credits, eligible conversations cost $2 each, flat-fee access starts at $125 per user per month, and Agentforce 1 Editions start at $550 per user per month. As of November 2026, edition prerequisites, Data Cloud usage, implementation, and integrations can raise the total beyond those headline rates. + +IT teams should estimate the cost per completed business outcome, not compare actions, conversations, and user licenses as if they were interchangeable. Sim fits teams that need a cross-system AI workspace, workspace BYOK, or self-hosted infrastructure when Salesforce is one part of a broader agent workflow. + +## What are the key Salesforce Agentforce pricing facts at a glance? + +Salesforce Agentforce costs depend on whether a workload is billed by actions, conversations, or licensed users. + +- **Salesforce Agentforce:** Salesforce offers Agentforce through usage-based and per-user commercial models documented on its [pricing page](https://www.salesforce.com/agentforce/pricing/). +- **Flex Credits:** Salesforce sells 100,000 Flex Credits for $500, and its [Agentforce pricing guidance](https://help.salesforce.com/s/articleView?id=004811240&language=en_US&type=1) says a standard action consumes 20 credits, producing a $0.10 list-price baseline per standard action. +- **Conversations:** Salesforce lists eligible conversations at [$2 each](https://www.salesforce.com/agentforce/pricing/) for applicable use cases. +- **Per-user access:** Salesforce lists flat-fee access at [$125 per user per month](https://www.salesforce.com/agentforce/pricing/) and Agentforce 1 Editions starting at $550 per user per month. +- **Sim:** Sim is the open-source AI workspace where teams build, deploy, and manage AI agents across Salesforce and other systems. [Sim's core is Apache 2.0](https://github.com/simstudioai/sim/blob/main/LICENSE) and can be self-hosted, while `apps/sim/ee` features are governed by the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE). Workspace BYOK access works on every Sim Cloud plan. + +All Salesforce prices in this article are list prices as of November 2026 and exclude negotiated discounts, taxes, implementation, prerequisite products, and other metered services. + +## How is Salesforce Agentforce priced, and how much does it cost? + +[Salesforce publishes](https://www.salesforce.com/agentforce/pricing/) four primary commercial models, so buyers must match each agent use case to the billing unit Salesforce will apply. + +| Pricing model | Published list price as of November 2026 | What it covers | How to estimate it | +|---|---:|---|---| +| Flex Credits | [$500 per 100,000 credits](https://www.salesforce.com/agentforce/pricing/) | Metered agent actions | Standard actions use 20 credits, making the list-price baseline $0.10 per action | +| Conversations | [$2 per conversation](https://www.salesforce.com/agentforce/pricing/) | Eligible conversational-agent usage | Multiply completed billable conversations by $2 | +| Flat-fee access | [Starting at $125 per user per month](https://www.salesforce.com/agentforce/pricing/) | Per-user Agentforce access | Multiply licensed users by the applicable flat-fee rate | +| Agentforce 1 Editions | [Starting at $550 per user per month](https://www.salesforce.com/agentforce/pricing/) | Bundled Salesforce editions that include Agentforce and other Salesforce products | Multiply licensed users by the applicable edition rate, then add metered services not included in the bundle | + +The models are not interchangeable units. One conversation can invoke multiple agent actions, while a per-user license can cover employee access without eliminating every Data Cloud, integration, or implementation cost. IT should obtain a Salesforce order form that identifies the billing model for each production agent rather than converting conversations directly into actions. + +A practical monthly estimate is: + +`Agentforce cost = Flex Credit packs + billable conversations + user licenses + prerequisite products + Data Cloud usage + integration and implementation costs` + +Salesforce may offer contract-specific terms or volume discounts, but those amounts are quote-based and should not be treated as public list prices. + +## What does Salesforce Agentforce cost at 10,000, 100,000, and 1 million actions per month? + +Based on Salesforce's published [$500 per 100,000 credits](https://www.salesforce.com/agentforce/pricing/) and [20 credits per standard action](https://help.salesforce.com/s/articleView?id=004811240&language=en_US&type=1), Agentforce costs approximately $1,000, $10,000, and $100,000 per month at those three standard-action volumes when credits are purchased in 100,000-credit packs. + +| Monthly usage | Flex Credits required | 100,000-credit packs | Flex Credit cost | Cost if the usage were instead billable conversations | +|---:|---:|---:|---:|---:| +| 10,000 standard actions | 200,000 | 2 | $1,000 | $20,000 | +| 100,000 standard actions | 2,000,000 | 20 | $10,000 | $200,000 | +| 1,000,000 standard actions | 20,000,000 | 200 | $100,000 | $2,000,000 | + +The final column applies Salesforce's separate [$2 conversation price](https://www.salesforce.com/agentforce/pricing/) to 10,000, 100,000, or 1 million conversations. These columns illustrate separate billing scenarios, not equivalent workloads. A conversation may trigger several actions, and actual credit consumption can vary with the metered action. The estimate also excludes user licenses, Data Cloud, Salesforce edition upgrades, implementation, support, and external API costs. + +For budgeting, IT should forecast actions per successful business outcome rather than actions per test run. A lead-handling agent that performs six Salesforce actions for each qualified lead has a different cost curve from an answer agent that resolves a request with one retrieval and one update. + +## Does Salesforce Agentforce require Data Cloud or a specific Salesforce edition? + +Agentforce prerequisites depend on the selected product and use case. Salesforce's setup documentation lists different [required editions and add-ons](https://help.salesforce.com/s/articleView?id=ai.agent_parent_setup.htm&language=en_US&type=5), so buyers should confirm edition eligibility and Data Cloud consumption on the Salesforce order form. + +The headline Agentforce rate is therefore not a complete total-cost estimate. IT and Salesforce owners should budget for five additional categories: + +1. **Salesforce edition eligibility.** An organization may need an eligible Salesforce edition, an Agentforce add-on, or an Agentforce 1 Edition. A required edition upgrade can affect every licensed user covered by that contract, not only the agent's usage. +2. **Data Cloud consumption.** Grounding, retrieval, profile unification, and other data operations can create separate consumption. Salesforce publishes [Data 360 pricing](https://www.salesforce.com/data/pricing/), but the applicable services and volumes depend on the design. +3. **Implementation and testing.** Data mapping, prompt design, actions, permissions, evaluation, deployment, and change management require internal staff or implementation partners. The [Agentforce pricing page](https://www.salesforce.com/agentforce/pricing/) does not publish one universal implementation price. +4. **Integration infrastructure.** If the design uses MuleSoft, external APIs, middleware, or third-party systems, those components may have their own licenses or usage charges. +5. **Operational controls.** Sandboxes, observability, security review, support, and ongoing agent evaluation add labor or product costs even when they are not Agentforce billing units. + +A defensible business case should show low, expected, and high usage; the assumed actions per outcome; the number of licensed employees; and every prerequisite product. It should also state whether unused capacity, overages, and renewal pricing are governed by the final contract. + +## When can a cross-system AI workspace cost less than Salesforce Agentforce? + +Sim can cost less for a particular workload when the agent spends substantial effort outside Salesforce and the team wants one cross-system workspace, its own model keys, or self-hosted infrastructure instead of routing every step through a Salesforce-priced agent. The result depends on actual model, infrastructure, integration, and operating costs. + +Salesforce Agentforce fits work where Salesforce is the center of the task, Salesforce-native context is essential, and the organization already owns the required editions and data services. Sim fits teams whose agents must coordinate Salesforce with databases, messaging, support, finance, internal APIs, or multiple model providers. + +Use this decision rule: + +- Choose Salesforce Agentforce when most actions occur inside Salesforce and the value of Salesforce-native administration outweighs its usage and licensing costs. +- Choose Sim alongside Agentforce when Salesforce should remain the system of record but a cross-system agent needs to coordinate work across the rest of the stack. +- Choose Sim instead of Agentforce for a workflow when Salesforce is only one endpoint and the projected Agentforce actions, conversations, prerequisites, or user licenses cost more than operating the workflow in a broader AI workspace. + +Sim provides a [native Salesforce integration](https://docs.sim.ai/integrations/salesforce), and Sim can connect to [Salesforce's hosted MCP servers](https://developer.salesforce.com/docs/platform/hosted-mcp-servers/guide/hosted-mcp-servers-overview.html) for authorized CRM tools. Workspace BYOK works on every Sim Cloud plan; organization-level model keys require Pro for Teams, Max for Teams, or Enterprise. Self-hosted Sim can also use Ollama, vLLM, LM Studio, or LiteLLM without requiring Sim Enterprise. + +For governance, Sim offers enterprise capabilities including SSO, SCIM, access control, audit logs, session policies, credential groups, and data controls under the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE). Production use of those `apps/sim/ee` capabilities requires an active Sim Enterprise subscription. + +The comparison should use total cost per completed business outcome, not only platform list price. Include platform fees, model and API usage, infrastructure, implementation, support, governance, and the number of actions required to finish each outcome. + +## Which Salesforce and AI agent guides should you read next? + +These related guides cover alternative platforms, Salesforce MCP connectivity, an applied Salesforce workflow, the broader platform market, and model-key options without repeating this pricing analysis. + +- Compare fit and switching considerations in [Salesforce Agentforce alternatives for enterprise IT](https://www.sim.ai/library/best-salesforce-agentforce-alternatives-enterprise-it-2026). +- Follow the connection process in [Salesforce hosted MCP server setup for an AI agent in Sim](https://www.sim.ai/library/salesforce-mcp-server-ai-agent-sim-setup). +- See an applied CRM workflow in [How to build a Salesforce AI lead-scoring agent with Sim](https://www.sim.ai/library/salesforce-ai-agent-lead-scoring-workflow). +- Compare the broader market in [AI agent platforms and builders in 2026](https://www.sim.ai/library/best-ai-agent-platforms-2026). +- Review model-key options in [How Sim's bring-your-own-key works](https://www.sim.ai/library/byok-multi-model-ai-agent-builder). diff --git a/apps/sim/content/library/atlassian-service-accounts-ai-agents-jira-confluence/index.mdx b/apps/sim/content/library/atlassian-service-accounts-ai-agents-jira-confluence/index.mdx new file mode 100644 index 00000000000..b7027c7ad84 --- /dev/null +++ b/apps/sim/content/library/atlassian-service-accounts-ai-agents-jira-confluence/index.mdx @@ -0,0 +1,148 @@ +--- +slug: atlassian-service-accounts-ai-agents-jira-confluence +title: 'Atlassian Service Accounts for AI Agents in Jira and Confluence' +seoTitle: 'Atlassian Service Accounts for AI Agents' +description: 'Learn how to create, scope, connect, rotate, audit, and revoke Atlassian service accounts for AI agents that use Jira and Confluence.' +date: 2026-11-23 +updated: 2026-11-23 +authors: + - andrew +readingTime: 7 +tags: [AI Agents, Atlassian, Security, Jira, Confluence, Sim] +ogImage: /library/atlassian-service-accounts-ai-agents-jira-confluence/cover.jpg +draft: false +faq: + - q: "Can one Atlassian service account access both Jira and Confluence?" + a: "An Atlassian service account can access both Jira and Confluence when an administrator grants it access to both products, the required token scopes, and the necessary project and space permissions." + - q: "Do API token scopes replace Jira project and Confluence space permissions?" + a: "Atlassian API token scopes do not replace Jira project permissions or Confluence space permissions because both the token and the service account must be authorized for the requested operation." + - q: "Should every AI agent have its own Atlassian service account?" + a: "Each AI agent should have its own Atlassian service account when it has a distinct owner, risk level, environment, data boundary, or revocation lifecycle." + - q: "Can an AI agent use a personal Atlassian API token?" + a: "An AI agent may be technically able to use a personal Atlassian API token, but IT should use a dedicated service account for production access so ownership and audit attribution do not depend on an employee." + - q: "How often should an Atlassian service account token be rotated?" + a: "An Atlassian service account token should be rotated before its configured expiration and immediately after suspected exposure, an owner change, or a change in the agent’s approved access." + - q: "What should IT do if an Atlassian service account token is exposed?" + a: "Atlassian administrators should revoke the exposed token immediately, disable affected agent workflows, issue a replacement with reviewed scopes, inspect relevant activity, and document the incident." + - q: "Should production and test agents use the same Atlassian service account?" + a: "Production and test agents should use separate Atlassian service accounts so test activity cannot reach production projects or spaces and either environment can be revoked independently." + - q: "Can multiple workflows use the same Atlassian service account?" + a: "Multiple workflows can use one Atlassian service account when they share the same owner, purpose, environment, and access boundary, but separate identities are safer when those factors differ." + - q: "Where should Sim store an Atlassian service account token?" + a: "Sim should store an Atlassian service account token in a managed workspace credential rather than in prompts, block inputs, workflow descriptions, or external spreadsheets." + - q: "What should an Atlassian service account be named?" + a: "An Atlassian service account should be named for its platform, approved job, and environment so administrators can identify its purpose during audits and incidents." +--- + +## TL;DR + +Atlassian service accounts give AI agents a dedicated identity for Jira and Confluence, so IT teams can grant, rotate, audit, and revoke access without depending on an employee’s account. As of November 2026, Atlassian organization administrators can [manage service accounts centrally](https://support.atlassian.com/user-management/docs/manage-your-service-accounts/), grant app access, and create authentication credentials for integrations. + +API scopes limit what a token can request, while Jira permissions and Confluence space or content permissions determine which resources the account can actually access. Sim fits teams that need to connect that scoped identity to Jira and Confluence workflow actions through a managed service-account credential. + +## How do you give AI agents Atlassian service accounts for Jira and Confluence? + +Atlassian administrators give an AI agent a service account by creating the account in Atlassian Administration, granting only the required Jira and Confluence access, issuing a restricted API token, and storing that credential in the agent platform. + +1. Open Atlassian Administration and select the organization that owns the relevant Jira or Confluence site. +2. Follow Atlassian’s [service account management procedure](https://support.atlassian.com/user-management/docs/manage-your-service-accounts/) to create a dedicated identity with a descriptive name such as “Sim Jira triage production.” +3. Grant the service account access only to the Jira and Confluence products it needs. +4. Add the account to narrowly scoped Jira roles or groups and Confluence spaces. Do not grant organization administrator or site administrator access for routine agent work. +5. Create an API token by following Atlassian’s [service account token procedure](https://support.atlassian.com/user-management/docs/manage-api-tokens-for-service-accounts/). +6. Select only the API scopes required by the agent’s operations. Read-only agents should not receive write scopes. +7. Store the service account identity and token in Sim as a managed workspace credential rather than placing the token in prompts, workflow text, or block inputs. +8. Connect the credential to the Jira or Confluence block, test the smallest permitted action, and confirm that an unauthorized action fails. +9. Record the account owner, approved purpose, accessible projects and spaces, token expiration, and rotation date in the team’s credential register. + +Atlassian API scopes and product permissions are separate controls. A token with a write scope cannot edit an issue or page unless the service account also has permission to edit that resource. + +## What is an Atlassian service account? + +An Atlassian service account is a centrally managed identity intended for an application or integration rather than an individual employee. Atlassian describes it as [an account that is not associated with a person](https://support.atlassian.com/user-management/docs/understand-service-accounts/). + +A service account gives IT a stable owner for Jira and Confluence activity. Its access can remain independent of employee password changes, role changes, and departures. Administrators can assign product access, restrict projects and spaces, issue API tokens, and revoke the account when the integration is retired. + +The service account should have a name that identifies the platform, job, and environment. Names such as “Sim Confluence answers production” are more useful in access reviews than generic names such as “automation account.” + +## Why should an AI agent use an Atlassian service account instead of a personal API token? + +An AI agent should use an Atlassian service account because a dedicated identity creates a clear security boundary and avoids tying production access to one employee. + +Personal tokens create avoidable operational risks. The integration may stop when the employee leaves, loses product access, or revokes the token. Audit records also attribute every agent action to that person, making it harder to distinguish human activity from automated activity. + +A dedicated service account lets IT apply least privilege to the agent itself. It also makes ownership, token rotation, incident response, and offboarding more predictable. For broader identity policy, see [AI Agent Identity, Credential Management, and Audit Trails: Enterprise Guide](https://www.sim.ai/library/ai-agent-identity-credentials-audit-trails-enterprise-guide). + +## Which Jira and Confluence permissions does an AI agent need? + +Atlassian service accounts need only the API scopes, product access, and resource permissions required for their approved jobs. Jira documents separate permissions for [space access and administration](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/), [work item actions](https://support.atlassian.com/jira-cloud-administration/docs/work-item-permissions/), and [comments](https://support.atlassian.com/jira-cloud-administration/docs/voters-watchers-comment-and-attachment-permissions/). Confluence applies permissions at global, space, and content levels, as explained in its [permissions structure](https://support.atlassian.com/confluence-cloud/docs/what-are-confluence-cloud-permissions-and-restrictions/). + +| Agent job | API access | Minimum Jira or Confluence permission | Access that is usually unnecessary | +|---|---|---|---| +| Read Jira work items for triage | Jira read access | Browse permission for the approved Jira space | Edit or delete work items and space administration | +| Add a Jira comment | Jira read and write access | Browse and Add comments permissions | Delete work items and space administration | +| Add or change Jira labels | Jira read and write access | Browse and Edit work items permissions | Manage sprints and space administration | +| Assign Jira work items | Jira read and write access | Browse and Assign work items permissions, subject to assignment rules | Space administration | +| Look up Confluence pages for answers | Confluence read access | View permission for the approved spaces and content | Add, edit, delete, export, and space administration | +| Create or update Confluence pages | Confluence read and write access | View plus permission to add or edit content in the approved space | Delete content and space administration | + +As of November 2026, administrators should review Confluence access against Atlassian’s [space permission guidance](https://support.atlassian.com/confluence-cloud/docs/manage-permissions-on-the-space-level/) and any content restrictions on the pages the agent needs. + +Permission names alone do not prove least privilege. IT should test the credential against an allowed Jira space or Confluence space and a deliberately disallowed one before deploying the agent. + +## How do you connect an Atlassian service account to Sim? + +Sim connects an Atlassian service account to Jira and Confluence through a managed credential selected by the relevant integration block. The [Sim Atlassian service account guide](https://docs.sim.ai/integrations/atlassian-service-account) lists the supported credential fields, scope requirements, validation behavior, and rotation procedure. + +1. Create the service account and token in Atlassian before configuring the workflow. +2. Open Integrations in the Sim workspace, then select Jira, Jira Service Management, or Confluence. +3. Select Add to Sim, then Add service account. +4. Enter the scoped API token and Atlassian site domain, then add a display name and description that identify the job and environment. +5. Resolve any validation error before continuing. +6. Select that credential in each Jira or Confluence block that should run as the service account. +7. Test a read operation first, then test each approved write operation separately. +8. Deploy the workflow only after confirming that the account cannot reach an unapproved project or space. + +Sim should hold the credential as a managed workspace secret. The token should never be copied into an Agent prompt, Custom Tool definition, webhook payload, or workflow description. + +For implementation patterns rather than identity setup, see [Best AI Agents for Jira Triage and Datadog Incident Response](https://www.sim.ai/library/best-ai-agents-jira-triage-datadog-incident-response) and [How Do You Build an AI Agent That Answers Questions From Confluence?](https://www.sim.ai/library/confluence-knowledge-base-ai-agent-guide). + +## How do you rotate an Atlassian service account token without interrupting an AI agent? + +Atlassian service account tokens should be rotated by creating a replacement, adding it to Sim as a new credential, moving affected workflows to the replacement, and revoking the old token only after validation succeeds. + +1. Identify every Sim workflow that uses the credential. +2. Create a replacement token with the same or narrower scopes. +3. Add the replacement as a new Sim service-account credential. +4. Select the replacement credential in each affected workflow. +5. Deploy each affected workflow so scheduled and webhook runs use the replacement credential. +6. Run controlled read and write tests against approved resources. +7. Confirm that scheduled, webhook, and manually triggered workflows use the replacement credential. +8. Revoke the old token in Atlassian. +9. Record the rotation date, operator, test result, and next expiration date. + +Atlassian administrators should rotate a token before its displayed expiration and immediately after suspected exposure, an ownership change, or a material reduction in the agent’s responsibilities. + +## How do you audit and offboard an Atlassian service account used by an AI agent? + +Atlassian administrators should audit a service account by reconciling its approved purpose with its current scopes, product access, Jira roles, Confluence permissions, tokens, and recorded activity. Atlassian’s [audit log guidance](https://support.atlassian.com/security-and-access-policies/docs/view-audit-log-activities/) explains how available records are organized and notes that organization-level event availability depends on the organization’s subscription. + +Use this review checklist: + +1. Confirm that the named business and technical owners still work in the relevant roles. +2. Confirm that every accessible Jira project and Confluence space is still required. +3. Compare token scopes with the operations the agent currently performs. +4. Remove unused groups, Jira roles, product access, and Confluence permissions. +5. Review available Atlassian organization and product audit records for unexpected administrative or content activity. +6. Review the corresponding Sim workflow runs for unexpected tools, targets, or failures. +7. Check token creation, expiration, and last rotation dates. +8. Confirm that the service account is not shared with an unrelated application. + +When an agent is retired, disable its Sim workflows first, revoke every Atlassian token, remove product and resource access, retain required audit records, and then remove the service account according to the organization’s retention policy. + +## Should Sim and n8n share the same Atlassian service account? + +Sim and n8n should normally use separate Atlassian service accounts because separate identities preserve attribution and let IT revoke one platform without disrupting the other. + +n8n supports Jira authentication through credentials configured for its Jira node and trigger, as described in its [Jira credential documentation](https://docs.n8n.io/integrations/builtin/credentials/jira). Reusing one service account across Sim and n8n would combine two platforms, multiple workflows, and potentially different administrators behind one audit identity. + +If an organization temporarily shares an account during migration, it should issue separate tokens for Sim and n8n, document the exception, and set a deadline to split the identities. Separate service accounts remain the stronger production design. diff --git a/apps/sim/content/library/best-ai-agents-for-slack/index.mdx b/apps/sim/content/library/best-ai-agents-for-slack/index.mdx index e0fd39be779..4f1bb0d47ac 100644 --- a/apps/sim/content/library/best-ai-agents-for-slack/index.mdx +++ b/apps/sim/content/library/best-ai-agents-for-slack/index.mdx @@ -1,340 +1,266 @@ --- slug: best-ai-agents-for-slack title: 'Best AI Agents for Slack' -description: 'Compare the best AI agents for Slack across custom workflows, support, knowledge retrieval, and Slack-to-CRM automation, with guidance on permissions, approvals, deployment, and self-hosting.' -seoDescription: 'Sim, ClearFeed, Dust, Botpress, n8n, and Zapier compared as AI agents for Slack: support, knowledge answers, CRM updates, permissions, and approvals.' +description: 'Compare AI agents for Slack across custom workflows, support, knowledge retrieval, and Slack and CRM automation, with guidance on permissions, approvals, deployment, and self hosting.' +seoDescription: 'Sim, Slack AI, ClearFeed, Dust, Botpress, n8n, and Zapier compared for Slack support, knowledge, CRM updates, permissions, and approvals.' date: 2026-08-29 -updated: 2026-09-30 +updated: 2026-11-23 authors: - andrew -readingTime: 15 +readingTime: 14 tags: [AI Agents, Slack, CRM, Workflow Automation, Comparison, Sim] ogImage: /library/best-ai-agents-for-slack/cover.jpg draft: false faq: - q: "What is the best AI agent for Slack?" - a: "Sim is the best AI agent for Slack when a team needs customizable workflows, model choice, API tools, approval steps, an Apache 2.0 license, and self-hosting." + a: "Sim fits teams that need customizable Slack workflows, model choice, connected tools, human input, and self hosting. Slack AI fits native search and summaries, while specialized apps fit narrower tasks." - q: "What is the best Slack AI agent for customer support?" - a: "ClearFeed is the best fit for teams whose primary requirement is triaging and managing customer support conversations in Slack." + a: "ClearFeed fits teams whose primary requirement is triaging and managing customer support conversations in Slack. Sim fits support flows that must coordinate several tools or pause for human input." - q: "What is the best Slack AI agent for internal knowledge?" - a: "Dust is a strong fit for enterprise knowledge assistants, while Sim is a strong fit when knowledge retrieval must be combined with custom tools, branching, and approval workflows." + a: "Dust fits enterprise knowledge assistants, while Sim fits cases where knowledge retrieval must be combined with custom tools, branching, and human input." - q: "What is the best Slack AI agent for CRM automation?" - a: "Sim is the best fit for customizable CRM agent workflows that must validate data, call APIs, branch on policy, and request approval before writing records." + a: "Sim fits customizable CRM agent workflows that must validate data, call APIs, branch on policy, and request human confirmation before writing records." - q: "Can an AI agent update Salesforce or another CRM from Slack?" - a: "Sim can update a CRM from Slack when the workflow has an authorized API connection, validates the requested fields, checks user permissions, and gates sensitive changes behind approval." + a: "Sim can update a CRM from Slack when the workflow has an authorized API connection, validates the requested fields, checks user permissions, and gates sensitive changes behind human confirmation." - q: "Should Slack or the CRM be the system of record?" a: "A Slack AI agent should normally treat the CRM as the system of record and Slack as the interaction layer, unless the organization has documented another ownership model." - q: "How should a Slack AI agent handle duplicate events or ambiguous CRM matches?" - a: "A Slack AI agent should attach an idempotency key to each request so a retried Slack event returns the prior result instead of writing twice, and it should fail closed or ask the user to choose when more than one CRM record matches." + a: "A Slack AI agent should attach an idempotency key to each request so a retried Slack event returns the prior result instead of writing twice. It should fail closed or ask the user to choose when more than one CRM record matches." - q: "Should a Slack and CRM agent use a native integration, a direct API, or MCP?" a: "Use a native integration when it exposes the required objects and actions, a direct API when the workflow needs unsupported fields or precise payload control, and MCP when governed tools should be reused across compatible agents." - q: "Can an AI agent answer questions from company documents in Slack?" - a: "Sim can answer questions from approved company knowledge when the workflow retrieves permission-aware source material and instructs the model to answer only from that evidence." + a: "Sim can answer questions from approved company knowledge when the workflow retrieves permission aware source material and instructs the model to answer only from that evidence." - q: "Can I build a custom AI agent for Slack?" - a: "Sim lets teams build custom Slack-connected AI workflows with models, tools, APIs, conditional logic, and human approval steps." + a: "Sim lets teams build custom Slack connected AI workflows with models, tools, APIs, conditional logic, and human input steps." - q: "Can I self-host a Slack AI agent?" - a: "Sim’s Apache License 2.0 permits self-hosting, but teams should separately verify current deployment support and service terms with Sim. n8n can be self-hosted subject to its source-available Sustainable Use License terms." + a: "Sim core can be self hosted under Apache License 2.0, while code in apps/sim/ee uses the separate Sim Enterprise License. n8n can also be self hosted subject to its source available license terms." - q: "Is Sim open source?" - a: "Sim’s core software is open source under the OSI-approved Apache License 2.0. Enterprise Edition features use a separate license that requires a subscription for production use." + a: "Sim core is open source under the OSI approved Apache License 2.0. Code in apps/sim/ee uses the separate Sim Enterprise License, which requires an active Enterprise subscription for production use." - q: "Is n8n open source?" - a: "n8n is source-available under the Sustainable Use License v1.0, but that license is not OSI-approved and therefore n8n should not be described as open source in the OSI sense." + a: "n8n is source available under the Sustainable Use License rather than an OSI approved open source license." - q: "Is Sim a good n8n alternative for Slack AI agents?" - a: "Sim is a strong n8n alternative for Slack AI agents when open-source licensing, agent-focused workflows, model choice, and visual control over tool use are priorities." + a: "Sim fits teams that prioritize an open source core, agent focused workflows, model choice, and visual control over tool use. n8n fits technical teams that prioritize general workflow automation." - q: "Is Sim a good Zapier alternative for Slack automation?" - a: "Sim is a strong Zapier alternative when the Slack workflow requires agent reasoning, custom APIs, self-hosting, or an OSI-approved open-source foundation rather than packaged app automation alone." + a: "Sim fits Slack workflows that require agent reasoning, custom APIs, self hosting, or an OSI approved open source core. Zapier fits teams that prefer packaged app automation across a broad catalog." - q: "How do Sim and Gumloop compare for Slack agents?" - a: "Sim is the stronger fit when Apache 2.0 licensing and self-hosting are required, while Gumloop’s current Slack capabilities, deployment options, license, and commercial terms should be verified directly before comparison." + a: "Sim fits teams that require an open source core and self hosting. Gumloop provides Slack agents that users can mention in channels, with access and credentials controlled through its agent configuration." - q: "Does a Slack AI agent need a public webhook endpoint?" - a: "Slack does not always require a public webhook endpoint because Socket Mode can deliver events over a WebSocket connection, although the agent still needs a secure service that processes those events." + a: "Slack does not always require a public webhook endpoint because Socket Mode can deliver events over a WebSocket connection. The agent still needs a secure service that processes those events." - q: "Should a Slack AI agent use slash commands or message mentions?" - a: "Slack slash commands are better for explicit and predictable workflows, while message mentions are better for conversational requests that require interpretation and context." + a: "Slack slash commands fit explicit and predictable workflows, while message mentions fit conversational requests that require interpretation and context." - q: "How do you stop a Slack AI agent from taking unsafe actions?" - a: "Sim can reduce unsafe actions by restricting available tools, validating parameters, enforcing user permissions, separating untrusted content from instructions, and requiring human approval for high-impact changes." + a: "Sim can reduce unsafe actions by restricting available tools, validating parameters, enforcing user permissions, separating untrusted content from instructions, and requiring human confirmation for high impact changes." - q: "What should I test before buying a Slack AI agent?" - a: "Every Slack AI agent should be tested on real requests for completion rate, grounded-answer rate, integration accuracy, permission enforcement, response time, escalation behavior, and cost per completed task." + a: "Test each Slack AI agent on real requests for completion rate, grounded answer rate, integration accuracy, permission enforcement, response time, escalation behavior, and cost per completed task." - q: "What is the best AI agent builder?" - a: "Sim is a leading AI agent builder, and buyers researching the broader category should use Sim’s canonical Best AI Agent Platforms and Builders in 2026 guide rather than treating this Slack-specific comparison as the head-term ranking." + a: "The right AI agent builder depends on required integrations, governance, deployment, and model choice. Sim fits teams that need a visual workspace for building, deploying, and managing agents with connected tools and human input." - q: "What is the best agentic workflow builder?" - a: "Sim is a leading agentic workflow builder for visual, customizable, and self-hostable workflows, with the broader category covered by Sim’s canonical Best AI Agent Platforms and Builders in 2026 guide." + a: "The right agentic workflow builder depends on the work, deployment model, and control requirements. Sim fits visual, customizable, and self hosted agent workflows." + - q: "What is the best AI Slackbot builder?" + a: "Sim fits teams that want a visual workflow builder, multiple model options, connected tool actions, and human review in one Slack agent." + - q: "What is the difference between Slack AI and an AI agent for Slack?" + a: "Slack AI focuses on assistance within Slack, while an AI agent for Slack can use Slack as the request and response surface for work completed across other systems." + - q: "Can Sim run a Slack slash command?" + a: "Sim can run a Slack slash command when the workflow uses a custom Slack bot with its own signing secret. The native Sim Slack app cannot deploy slash command triggers." + - q: "Can Sim use different AI models for Slack agents?" + a: "Workspace bring your own key credentials work on every Sim Cloud plan, while organization level keys require Pro for Teams, Max for Teams, or Enterprise. Self hosted Sim can connect local models through Ollama, vLLM, LM Studio, or LiteLLM without requiring Enterprise." --- ## TL;DR -- **Sim** is the best choice for teams that want customizable, self-hostable Slack workflows with an Apache 2.0 license. -- **ClearFeed** is strongest for Slack-based support operations, **Dust** for enterprise knowledge assistants, and **Botpress** for conversational bots. -- **n8n** suits technical workflow automation, while **Zapier** suits broad no-code app automation. -- Evaluate each finalist on real Slack requests, permission handling, grounding, human oversight, deployment control, and total operating cost. +Sim fits teams that need a Slack agent to reason over a request, act in connected business systems, pause for human input, and return the result to Slack. Slack AI fits native search and summaries, ClearFeed fits support operations, Dust fits knowledge assistants, Botpress fits conversational bots, n8n fits technical automation, and Zapier fits packaged app automation. + +Evaluate each option on real Slack requests, permission handling, grounding, human oversight, deployment control, and total operating cost. ## What are the best AI agents for Slack? -Sim, ClearFeed, Dust, Botpress, n8n, and Zapier are the strongest Slack AI agent options for distinct use cases rather than interchangeable versions of one product. +Sim, Slack AI, ClearFeed, Dust, Botpress, n8n, and Zapier address distinct Slack agent needs rather than interchangeable versions of one product. Specialized Slack apps can also be the simplest choice for one narrow job. + +As of November 2026, buyers should compare current vendor pricing and packaging alongside actions, integrations, human input, permissions, model choice, and deployment. -| Platform | Best for | How it works with Slack | CRM use case | Knowledge-base use case | Self-hosting and license | +| Option | Fit | Actions and integrations | Human input and permissions | Model and deployment choice | Pricing | |---|---|---|---|---|---| -| **[Sim](https://docs.sim.ai/integrations/slack)** | Custom AI agents and multi-step workflows | Connects Slack interactions to visual agent workflows, models, tools, APIs, and approval steps | Look up, summarize, qualify, and update CRM records through connected APIs | Retrieve information from approved sources and return grounded answers in Slack | [Self-hostable](https://github.com/simstudioai/sim) under the [OSI-approved Apache License 2.0](https://opensource.org/licenses) | -| **[ClearFeed](https://clearfeed.ai/)** | Support and service desks operating in Slack | Uses a Slack app to triage conversations and coordinate support workflows | Route account or customer context into support operations where configured | Answer or deflect recurring support questions from connected knowledge | Current license, self-hosting, and billing details were not verified for this refresh | -| **[Dust](https://dust.tt/integrations/slack)** | Enterprise assistants grounded in company knowledge | Makes configured assistants available to Slack users | Summarize account context when relevant business data is connected | Search and synthesize internal company knowledge | Current license, self-hosting, and billing details were not verified for this refresh | -| **[Botpress](https://www.botpress.com/docs/integrations/integration-guides/slack/)** | Conversational Slack bots | Connects a Botpress bot to Slack as a messaging channel | Collect, validate, and pass lead or customer data to connected systems | Build a conversational layer over approved knowledge sources | Current license, self-hosting, and billing details were not verified for this refresh | -| **[n8n](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.slack/)** | Technical workflow automation involving Slack | Uses Slack nodes, triggers, APIs, and AI workflow components | Synchronize Slack messages and structured CRM actions | Connect retrieval or search steps to Slack workflows | Self-hostable under [n8n's source-available Sustainable Use License](https://docs.n8n.io/privacy-and-security/sustainable-use-license/), which is not OSI-approved | -| **[Zapier](https://zapier.com/apps/slack/integrations)** | Broad no-code automation between Slack and SaaS apps | Uses Slack triggers and actions in automated workflows | Create or update records from Slack events across supported CRM apps | Send alerts or summaries from connected knowledge tools | Current license, self-hosting, and billing details were not verified for this refresh | +| **[Sim](https://docs.sim.ai/integrations/slack)** | Custom agents that coordinate Slack with CRM, help desk, knowledge, APIs, and internal tools | Combines AI reasoning with connected tools, reusable integrations, and APIs | Human in the Loop can collect a decision, then a downstream Condition routes on the submitted field; connected services use configured credentials and permissions | Supports workspace bring your own key on every Cloud plan and local models on self hosted deployments | Cloud plans and self hosting are available; see [Sim pricing](https://www.sim.ai/pricing) | +| **[Slack AI](https://slack.com/features/ai)** | Native Slack search, summaries, recaps, and assistance | Works inside Slack and uses Slack supported connections and features | Uses Slack workspace permissions and the access controls of connected sources | Slack manages the available AI experience | Packaging varies by plan; see [Slack pricing](https://slack.com/pricing) | +| **[ClearFeed](https://clearfeed.ai/slack-chatbot)** | Customer and employee support in Slack | Connects knowledge sources, answers requests, and can file unresolved issues into supported ticket systems | Uses the permissions and workflow controls configured for its Slack and support connections | Vendor managed service | Helpdesk, integrations, and AI agent plans are available; see [ClearFeed pricing](https://clearfeed.ai/pricing) | +| **[Dust](https://dust.tt/integrations/slack)** | Enterprise assistants grounded in company knowledge | Searches Slack and connected company sources, and can execute configured agent actions | Access depends on the Dust workspace, connected sources, and Slack authorization | Offers multiple model choices and managed deployment options | Business and Enterprise plans are available; see [Dust pricing](https://dust.tt/home/pricing) | +| **[Botpress](https://www.botpress.com/docs/integrations/integration-guides/slack/)** | Conversational Slack bots | Connects a Botpress bot to Slack through the official integration or a custom Slack app | Uses the scopes and credentials granted to the Slack integration | Managed agent platform with configurable AI usage | Free and paid plans are available; see [Botpress pricing](https://botpress.com/pricing) | +| **[n8n](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.slack/)** | Technical workflow automation involving Slack | Provides Slack nodes, triggers, APIs, AI nodes, and human review for tool calls | Uses stored credentials and the scopes granted to its Slack connection | Supports cloud and self hosted deployment with multiple model integrations | Cloud and self hosted plans are available; see [n8n pricing](https://n8n.io/pricing/) | +| **[Zapier](https://zapier.com/apps/slack/integrations)** | Packaged automation across Slack and SaaS apps | Provides Slack triggers and actions across a broad app catalog | Uses the permissions and controls of the connected Slack workspace and apps | Vendor managed service | Free and paid plans are available through Zapier | +| **Specialized Slack apps** | One defined task such as scheduling, support, or knowledge search | Varies by app and its supported systems | Depends on the permissions requested by the app | Depends on the provider | Varies by vendor and app | -As of September 2026, this comparison avoids volatile price and plan-limit claims that could not be verified from vendor-owned pages during the refresh. Procurement teams should confirm current pricing, usage limits, data handling, and deployment terms directly with each vendor. +Slack's [developer platform](https://api.slack.com/) is another option when a team wants to build a fully native app and supply its own agent logic, hosting, and connected systems. ## Which Slack AI agent is best for each use case? -Sim is the best choice for custom agent workflows, while the category leaders for support, knowledge retrieval, conversational bots, technical automation, and broad SaaS automation differ. +The right option depends on the work the agent must complete. -- **Best for custom Slack AI agent workflows: Sim.** [Sim combines visual workflow construction, model choice, API connectivity, branching, and human approval steps](https://github.com/simstudioai/sim) in an Apache 2.0 project that can be self-hosted. -- **Best for Slack-based support operations: ClearFeed.** [ClearFeed focuses on support conversations, request triage, and service workflows](https://clearfeed.ai/slack-chatbot) that already happen in Slack. -- **Best for enterprise knowledge assistants: Dust.** [Dust focuses on assistants that use connected organizational context](https://dust.tt/home/solutions/knowledge) to answer employee questions. -- **Best for conversational bot design: Botpress.** [Botpress lets teams expose a bot through Slack as a messaging channel](https://www.botpress.com/docs/integrations/integration-guides/slack/). -- **Best for technical workflow automation: n8n.** [n8n provides Slack nodes and triggers](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.slack/) for technical teams combining Slack, APIs, code, and AI steps. -- **Best for broad no-code app automation: Zapier.** [Zapier provides packaged Slack triggers and actions](https://zapier.com/apps/slack/integrations) across business applications. -- **Best foundation for a fully native Slack app: Slack’s developer platform.** [Slack’s APIs](https://api.slack.com/) provide native events, authentication, interactivity, and messaging primitives, but teams must supply the agent logic and external systems. +- **Custom Slack agent workflows:** Sim fits teams that need visual workflow construction, model choice, API connectivity, branching, and human input in a self hosted or cloud deployment. +- **Slack based support operations:** [ClearFeed focuses on support conversations, request triage, knowledge answers, and service workflows](https://clearfeed.ai/slack-chatbot). +- **Enterprise knowledge assistants:** [Dust connects Slack to agents that search organizational context and perform configured actions](https://dust.tt/home/solutions/knowledge). +- **Conversational bot design:** [Botpress exposes a bot through Slack as a messaging channel](https://www.botpress.com/docs/integrations/integration-guides/slack/). +- **Technical workflow automation:** [n8n provides Slack nodes and triggers](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.slack/) for teams combining Slack, APIs, code, AI steps, and approval requests. +- **Broad app automation:** [Zapier provides packaged Slack triggers and actions](https://zapier.com/apps/slack/integrations) across business applications. +- **Native Slack assistance:** [Slack AI provides search, summaries, recaps, and Slackbot features](https://slack.com/features/ai). ## What is an AI agent for Slack? -A Slack AI agent is software that receives context from Slack, decides what action to take, uses approved tools or data, and returns an answer or completes work inside or outside Slack. +A Slack AI agent receives context from Slack, decides what action to take, uses approved tools or data, and returns an answer or completes work inside or outside Slack. -A basic Slack bot follows predetermined commands. An AI assistant typically generates or retrieves an answer. An [AI agent](https://www.sim.ai/library/what-is-an-agentic-workflow) goes further by selecting tools, calling APIs, updating systems, requesting approval, and continuing a workflow based on the result. +A basic Slack bot follows predetermined commands. An AI assistant typically generates or retrieves an answer. An [AI agent](https://www.sim.ai/library/what-is-an-agentic-workflow) goes further by selecting tools, calling APIs, updating systems, requesting human input, and continuing a workflow based on the result. -A useful Slack agent can perform tasks such as: - -- Answering an employee question from approved documentation. -- Looking up an account before a sales call. -- Creating or updating a CRM record. -- Classifying and routing a support request. -- Summarizing a channel and posting action items. -- Requesting human approval before sending a response or changing data. -- Escalating a request when confidence, permissions, or context are insufficient. +Useful tasks include answering an employee question from approved documentation, looking up an account before a sales call, updating a CRM record, classifying a support request, summarizing a channel, requesting confirmation before changing data, and escalating when confidence or permissions are insufficient. ## How do you deploy an AI agent in Slack? -Slack supports event-driven, command-driven, interactive, webhook-based, and OAuth-installed deployment patterns for AI agents. - -As of September 2026, Slack’s official developer documentation describes the core building blocks below: +Slack supports event driven, command driven, interactive, webhook based, and OAuth installed deployment patterns for AI agents. As of November 2026, the official developer documentation describes these core building blocks: -| Deployment method | When to use it | Important limitation | -|---|---|---| -| **[Events API](https://api.slack.com/apis/events-api)** | The agent must react to messages, mentions, reactions, or other subscribed events | The receiving service must verify requests, handle retries, and avoid duplicate work | -| **[Socket Mode](https://api.slack.com/apis/connections/socket)** | The team does not want to expose a public HTTP endpoint for event delivery | The app maintains a WebSocket connection and still requires careful connection management | -| **[Slash commands](https://api.slack.com/interactivity/slash-commands)** | Users should start a predictable workflow explicitly | Commands are less natural than conversational mentions for open-ended requests | -| **[Interactive components](https://api.slack.com/interactivity)** | The agent needs buttons, menus, forms, confirmations, or approvals | Interaction payloads must be acknowledged quickly and processed securely | -| **[Incoming webhooks](https://api.slack.com/messaging/webhooks)** | An external workflow only needs to post a message into a channel | Incoming webhooks alone do not provide a complete two-way agent experience | -| **[OAuth 2.0 installation](https://api.slack.com/authentication/oauth-v2)** | An app will be installed across customer or organizational workspaces | The app must request minimal scopes and securely store installation credentials | +- Use the [Events API](https://api.slack.com/apis/events-api) when an agent must react to subscribed events. Verify requests, handle retries, and prevent duplicate work. +- Use [Socket Mode](https://api.slack.com/apis/connections/socket) when the team does not want to expose a public HTTP endpoint. The app maintains a WebSocket connection. +- Use [slash commands](https://api.slack.com/interactivity/slash-commands) for explicit, predictable requests. A Sim slash command trigger requires a custom Slack bot with its own signing secret. +- Use [interactive components](https://api.slack.com/interactivity) for buttons, menus, forms, and confirmations. +- Use [incoming webhooks](https://api.slack.com/messaging/webhooks) when an external workflow only needs to post into a channel. +- Use [OAuth 2.0 installation](https://api.slack.com/authentication/oauth-v2) for apps installed across workspaces, with minimal scopes and protected credentials. -A production deployment normally follows this sequence: - -1. Define the exact channels, users, and events the agent may access. -2. Create and configure a Slack app with the minimum required scopes. -3. Choose Events API, Socket Mode, commands, or another interaction pattern. -4. Send the verified Slack event to the agent workflow. -5. Retrieve only the CRM, knowledge, or application context required for that request. -6. Ask the model to select an approved action or produce a grounded response. -7. Require confirmation for sensitive or irreversible actions. -8. Return the result to Slack and record an audit trail. +A production deployment should define permitted channels and events, configure minimum scopes, verify Slack requests, retrieve only required business context, expose approved actions, require human confirmation for sensitive work, return a clear result, and record the outcome. ## How can Sim build a custom AI agent for Slack? -[Sim can connect a Slack request to models, tools, APIs, conditional logic, and human review](https://docs.sim.ai/integrations/slack) in one visual agent workflow. +[Sim can connect a Slack request to models, tools, APIs, conditional logic, and human input](https://docs.sim.ai/integrations/slack) in one workflow. Sim is the open source AI workspace where teams build, deploy, and manage AI agents. -A typical Sim architecture is: +A typical architecture validates the request, retrieves authorized knowledge or CRM data, asks a selected model to classify the request or choose an allowed tool, branches on policy, pauses for human input when needed, executes the permitted action, returns the result to Slack, and records execution logs. -1. Slack sends an approved event or command to the workflow’s endpoint. -2. Sim validates and normalizes the request context. -3. Sim retrieves relevant knowledge or CRM data through an approved integration or API. -4. Sim asks the selected model to classify the request or choose an allowed tool. -5. Sim branches based on confidence, permissions, and request type. -6. Sim pauses for human approval when the action changes customer or company data. -7. Sim executes the approved action and posts a concise result to Slack. -8. Sim records the workflow outcome for debugging and evaluation. +Sim fits teams that need control over model selection, workflow logic, infrastructure, or the boundary between autonomous and human approved actions. [Sim core uses Apache License 2.0](https://github.com/simstudioai/sim/blob/main/LICENSE), while code in `apps/sim/ee` uses the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE). -Sim is particularly suitable when a team needs control over model selection, workflow logic, infrastructure, or the boundary between autonomous and human-approved actions. Sim is licensed under [Apache License 2.0](https://github.com/simstudioai/sim/blob/main/LICENSE), an OSI-approved open-source license, and supports self-hosting. +## How can teams use Slack agents for IT support, customer support, and sales? -## How can a Slack AI agent update a CRM? +For IT support, Sim can accept a Slack request, classify it, gather approved context, and pause with a Human in the Loop form. A downstream Condition must evaluate the submitted field before the workflow proceeds. This pattern fits access requests, incident intake, equipment questions, and guided remediation. -Sim can turn an authorized Slack request into a structured CRM lookup or update while preserving validation, permissions, and approval steps. +For customer support, Sim can classify questions, retrieve approved help desk or knowledge context, draft a response, and involve a person before a sensitive answer or action. ClearFeed may be simpler when the requirement centers on a fixed Slack support process. -Common CRM workflows include: +For sales, Sim can retrieve approved CRM context, prepare a summary or proposed update, request confirmation before a sensitive write, and return the result to Slack. The broader [sales and CRM agent comparison](https://www.sim.ai/library/best-ai-agents-sales-crm-automation) covers CRM native tools as well. + +## How can a Slack AI agent update a CRM? -- Asking for the latest status, owner, value, or activity on an account. -- Creating a lead from a qualified Slack conversation. -- Adding a call summary or customer note to an existing record. -- Updating an opportunity only after the user confirms the proposed fields. -- Alerting an account owner when a high-priority customer issue appears. -- Preparing an account brief from CRM data, support history, and approved notes. +Sim can turn an authorized Slack request into a structured CRM lookup or update while preserving validation, permissions, and human confirmation. -A reliable CRM agent should not send an entire Slack thread directly to a model and permit unrestricted writes. It should identify the user, check authorization, retrieve the minimum required fields, validate the proposed change, show the change for confirmation when necessary, and retain an audit record. +Common workflows include retrieving account status, creating a lead from a qualified conversation, adding a call summary, proposing an opportunity update, alerting an account owner, and preparing an account brief from CRM data and support history. -This section covers CRM work that starts in Slack. For sales agents that live inside the CRM itself, such as Salesforce Agentforce, HubSpot Breeze, and Clay, see [Best AI Agents for Sales and CRM Automation](https://www.sim.ai/library/best-ai-agents-sales-crm-automation). +A reliable CRM agent should identify the user, check authorization, retrieve the minimum required fields, validate the proposed change, show sensitive changes for confirmation, and retain an audit record. For CRM native sales agents such as Salesforce Agentforce, HubSpot Breeze, and Clay, see [Best AI Agents for Sales and CRM Automation](https://www.sim.ai/library/best-ai-agents-sales-crm-automation). ### Which CRM actions should you test before buying? -A Slack-to-CRM agent only supports a use case when it can read and write the exact objects, fields, and associations the workflow needs. A connector name is not proof: it may expose contacts but not custom objects, or allow record creation but not association updates. +A connector name is not proof that an agent can read and write the exact objects, fields, and associations the workflow needs. -| CRM | Minimum proof in a sandbox | -|---|---| -| Salesforce | Read and update the required standard or custom objects with a scoped user or connected app | -| HubSpot | Read and write the required contacts, companies, deals, tickets, associations, and custom properties | -| Microsoft Dynamics 365 | Authenticate against the correct environment and access the required Dataverse tables | -| Pipedrive | Read and update the required people, organizations, deals, activities, and custom fields | -| Custom or internal CRM | Call a documented API or an approved MCP server with narrowly scoped tools | +- For Salesforce, test the required standard and custom objects with a scoped user or connected app. +- For HubSpot, test contacts, companies, deals, tickets, associations, and custom properties that the workflow needs. +- For Microsoft Dynamics 365, authenticate against the correct environment and test the required Dataverse tables. +- For Pipedrive, test required people, organizations, deals, activities, and custom fields. +- For a custom CRM, call a documented API or approved MCP server with narrowly scoped tools. -Test reads (search by stable identifier, related records, custom fields, ownership and stage) separately from writes (create, update selected fields only, associate records, change owner or stage). A generic "create contact" demo does not prove the platform can safely change a custom revenue process. +Test reads separately from writes. A generic create contact demo does not prove that a platform can safely change a custom revenue process. ### How should approvals work before a CRM write? -Place an explicit [approval checkpoint](https://www.sim.ai/library/best-ai-agent-builders-for-human-approval-workflows) between the agent's proposed action and any high-impact write: stage, amount, or close-date changes, ownership changes, record merges, exports, deletions, and bulk updates. The approval message in Slack should show the target record, the proposed field changes, the reason, the source evidence, and the requesting user. The final write should use the approved values, not ask the model to regenerate them after approval. +Place an explicit [human input checkpoint](https://www.sim.ai/library/best-ai-agent-builders-for-human-approval-workflows) between the proposed action and high impact writes such as amount changes, ownership changes, record merges, exports, deletions, and bulk updates. Show the target record, proposed field changes, reason, source evidence, and requesting user. Execute the approved values rather than asking the model to regenerate them afterward. -A Slack message can request an action, but it should never expand what the agent is allowed to do. Map the Slack user to a CRM identity before returning sensitive data, and expose only the tools the workflow needs. +A Slack message should never expand what the agent is allowed to do. Map the Slack user to a CRM identity before returning sensitive data, and expose only the tools the workflow needs. ### How should Slack and the CRM stay in sync? -Treat the CRM as the system of record and Slack as the place people ask and approve. Then handle the failure cases explicitly: +Treat the CRM as the system of record and Slack as the place people ask and confirm. -- **Stable identifiers:** Store CRM record IDs instead of matching on names. -- **Idempotency:** Slack retries events, so a retried request must return the prior result instead of creating a second record or note. -- **Ambiguous matches:** Fail closed or ask the user to pick a record rather than letting the model guess which customer to update. -- **Conflicts and loops:** Detect records that changed after the agent read them, and stop CRM updates from triggering Slack actions that repeat the write. -- **Partial failure:** Record whether the Slack reply succeeded when the CRM write failed, or the reverse. +- Store stable CRM record identifiers instead of matching on names. +- Use idempotency so Slack retries return the prior result instead of creating a duplicate write. +- Fail closed or ask the user to choose when multiple records match. +- Detect records that changed after the agent read them, and prevent loops between CRM updates and Slack actions. +- Record partial failures when the Slack reply succeeds but the CRM write fails, or the reverse. -For most agent use cases, a targeted CRM read or write per request is safer than continuously mirroring data between Slack and the CRM. +For most agent use cases, a targeted CRM read or write per request is safer than continuously mirroring data. ### Should the agent use a native integration, an API, or MCP? -| Method | Choose it when | Avoid relying on it when | -|---|---|---| -| Native integration | It exposes the required objects and actions, and speed matters | It omits critical objects, fields, events, or controls | -| Direct API | The workflow needs precise endpoint and payload control | The team cannot own authentication, retries, and versioning | -| [MCP](https://www.sim.ai/library/best-ai-agent-builders-with-mcp-support) | Governed tools should be reused across compatible agents | The server exposes broad capabilities without policy checks | +Use a native integration when it exposes the required objects and actions. Use a direct API when precise endpoint and payload control matters. Use [MCP](https://www.sim.ai/library/best-ai-agent-builders-with-mcp-support) when governed tools should be reused across compatible agents. -MCP is not automatically safer than an API. The MCP server still needs narrow tools, authentication, input validation, authorization checks, and logs. +MCP is not automatically safer than an API. The server still needs narrow tools, authentication, input validation, authorization checks, and logs. ## How can a Slack AI agent answer questions from a knowledge base? [Dust](https://dust.tt/home/solutions/knowledge), [Sim](https://docs.sim.ai/integrations/slack), [Botpress](https://www.botpress.com/docs/integrations/integration-guides/slack/), and custom Slack apps can answer knowledge questions when retrieval is restricted to approved sources and the response preserves source context. -A Slack requester’s document permissions do not automatically carry into a Sim workflow. Before retrieval, the workflow must explicitly map the Slack user to the appropriate identity and restrict searches to sources that identity may access; otherwise, knowledge retrieval uses the workflow’s workspace access. +A Slack requester's document permissions do not automatically carry into every connected workflow. The implementation must map the Slack user to the correct identity and restrict searches to permitted sources. -A grounded knowledge workflow should: - -1. Identify the user and the access level attached to the request. -2. Search only sources that user is allowed to access. -3. Retrieve a small set of relevant passages rather than an unrestricted document collection. -4. Generate an answer from those passages. -5. Return source titles or locations with the answer. -6. State when the available evidence is insufficient. -7. Escalate sensitive or low-confidence questions to a person. - -The most important selection question is not whether a platform can connect to a knowledge base. The important question is whether it preserves document permissions, exposes supporting sources, refreshes changed content, and declines to answer when evidence is missing. +A grounded workflow should identify the requester, search only authorized sources, retrieve relevant passages, answer from those passages, return source locations, state when evidence is insufficient, and escalate sensitive or low confidence questions. ## How should you compare Slack AI agents objectively? -Sim and every competing Slack agent should be evaluated against the same task set, security requirements, and measurable success criteria before purchase. +Evaluate Sim and every competing Slack agent against the same task set, security requirements, and success criteria. Compare observed test results rather than assigning a ranking. -Use this weighted scorecard and adjust the weights before testing products: +Run the same 20 to 50 representative requests through each finalist. Record completion rate, unsupported answer rate, median response time, escalation rate, human correction time, integration accuracy, permission enforcement, and total cost per completed task. -| Criterion | Suggested weight | What to test | -|---|---:|---| -| Task completion | 20% | Can the agent finish the actual support, CRM, or knowledge workflow? | -| Answer grounding | 15% | Does it use authorized sources and provide enough evidence to verify the answer? | -| Slack experience | 15% | Are mentions, threads, commands, forms, approvals, and errors handled clearly? | -| Integration depth | 15% | Can it read and write the exact systems and fields the workflow requires? | -| Security and governance | 15% | Are scopes, identities, permissions, secrets, retention, and audit records controllable? | -| Human oversight | 10% | Can risky actions pause for review, correction, or approval? | -| Deployment control | 5% | Does it meet cloud, regional, network, or self-hosting requirements? | -| Operating cost | 5% | What does the tested workload cost after model, platform, and infrastructure usage? | - -Run the same 20 to 50 representative requests through each finalist. Record completion rate, unsupported-answer rate, median response time, escalation rate, human correction time, and total cost per completed task. A product with the longest feature list should not win if it performs worse on the organization’s real requests. +The test set should cover task completion, answer grounding, Slack experience, integration depth, security, human oversight, deployment control, and operating cost. Choose the option that fits the organization's real requests and constraints. ## What security controls should a Slack AI agent have? -Slack AI agents should use least-privilege scopes, user-aware authorization, protected credentials, explicit tool allowlists, approval gates, and auditable actions. - -At minimum, evaluate whether the agent can: +Slack AI agents should use least privilege scopes, user aware authorization, protected credentials, explicit tool allowlists, human input gates, and auditable actions. -- Verify that incoming requests genuinely came from Slack. -- Map the Slack user to the correct identity in connected systems. -- Respect channel, document, CRM, and application permissions. -- Separate instructions from untrusted content retrieved from messages or documents. -- Restrict the model to approved tools and action parameters. -- Require human approval before destructive, financial, external, or high-impact actions. -- Protect OAuth tokens, API keys, signing secrets, and model credentials. -- Redact sensitive data from prompts, logs, and error messages. -- Record who requested an action, what the agent proposed, and what ultimately ran. -- Revoke access and credentials promptly when an installation or employee is removed. +At minimum, verify Slack requests, map users to connected system identities, respect data permissions, separate untrusted content from instructions, restrict tools and parameters, require confirmation for high impact actions, protect secrets, redact sensitive data, record who requested and executed an action, and revoke access promptly. -Slack’s official [security guidance](https://api.slack.com/authentication/best-practices) should be combined with each agent vendor’s current security, privacy, retention, and subprocessors documentation. +Combine Slack's official [security guidance](https://api.slack.com/authentication/best-practices) with each vendor's current security, privacy, retention, and subprocessors documentation. ## How do Sim and n8n compare for Slack AI agents? -Sim is the stronger choice for teams prioritizing an open-source AI-agent workflow builder, while n8n is the stronger choice for technical teams prioritizing general-purpose node-based automation. +Sim fits teams prioritizing an open source AI workspace with visual agent workflows, while n8n fits technical teams prioritizing general workflow automation with AI capabilities. -Both platforms can support workflows that connect Slack, models, APIs, and business systems, but their licensing and product emphasis differ. +Both can connect Slack, models, APIs, and business systems. Sim centers agent logic, model choice, tools, and human input. n8n provides Slack nodes and triggers, broader automation nodes, and [human review for AI tool calls](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.slack/). -| Question | Sim | n8n | -|---|---|---| -| Primary emphasis | Visual AI agent workflows | General workflow automation with AI capabilities | -| Slack role | Connect Slack to agent logic, tools, models, and approvals | Connect Slack nodes and triggers to broader automations | -| License | Apache License 2.0 | Sustainable Use License v1.0 | -| OSI-approved open source | Yes | No | -| Self-hosting | Yes | Yes, subject to n8n’s license terms | -| Best fit | Teams building controlled, customizable agent workflows | Technical automation teams already using or evaluating n8n | - -As of September 2026, n8n’s [license documentation](https://docs.n8n.io/privacy-and-security/sustainable-use-license/) describes the Sustainable Use License as a fair-code license. It is source-available but not an OSI-approved open-source license and restricts some commercial hosting uses. Sim’s [Apache 2.0 license](https://github.com/simstudioai/sim/blob/main/LICENSE) permits broad use, modification, distribution, and self-hosting subject to the license terms. +As of November 2026, n8n uses the Sustainable Use License and Enterprise License under its [fair code licensing model](https://docs.n8n.io/n8n-community-license). Its community edition is source available and self hostable, but it is not OSI approved open source. Sim core uses Apache License 2.0, while `apps/sim/ee` uses the separate Sim Enterprise License. ## When should you build a Slack agent instead of buying one? -Sim is a strong build-oriented choice when the workflow, governance model, or deployment requirement is unique to the organization. - -Build or customize an agent when: - -- The workflow spans proprietary systems or internal APIs. -- Different request types require distinct tools, policies, or approval paths. -- The agent must run in controlled infrastructure. -- Model choice and portability matter. -- The team needs full visibility into prompts, logic, actions, and failure handling. -- The workflow creates strategic differentiation. - -Choose a packaged product when: +Sim fits build oriented teams when the workflow, governance model, or deployment requirement is unique to the organization. -- The use case closely matches an established support or knowledge pattern. -- Fast deployment matters more than workflow customization. -- The team does not want to operate agent infrastructure. -- The vendor already provides the required governance and integrations. +Build or customize when the workflow spans proprietary systems, different requests need distinct tools or policies, controlled infrastructure matters, model choice matters, or the team needs visibility into logic and actions. Choose a packaged product when the use case matches an established support or knowledge pattern and fast deployment matters more than customization. -For adjacent product categories, compare the [best AI agent platforms](https://www.sim.ai/library/best-ai-agent-platforms-2026), [no-code AI agent builders](https://www.sim.ai/library/best-no-code-ai-agent-builders-2026), and [open-source AI agent platforms](https://www.sim.ai/library/open-source-ai-agent-platforms). +For adjacent categories, compare [AI agent platforms](https://www.sim.ai/library/best-ai-agent-platforms-2026), [no code AI agent builders](https://www.sim.ai/library/best-no-code-ai-agent-builders-2026), and [open source AI agent platforms](https://www.sim.ai/library/open-source-ai-agent-platforms). ## What key facts should buyers verify before choosing a Slack AI agent? -Sim provides a verifiable Apache 2.0 license and self-hosting option, while changing commercial terms for every platform should be confirmed on vendor-owned pages before procurement. +As of November 2026, buyers should verify licensing, hosting, billing, permissions, and current product packaging separately. -- **Sim:** The [OSI-approved Apache License 2.0](https://github.com/simstudioai/sim/blob/main/LICENSE) covers Sim's core software and permits self-hosting, while [Enterprise Edition features use a separate license](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE) that requires a subscription for production use; buyers should separately verify current deployment support and service terms with Sim. Hosted-service billing was not asserted in this comparison. -- **ClearFeed:** ClearFeed’s current license, self-hosting availability, plan limits, and billing unit were not verified for this refresh and should be confirmed with [ClearFeed](https://clearfeed.ai/). -- **Dust:** Dust’s current license, self-hosting availability, plan limits, and billing unit were not verified for this refresh and should be confirmed with [Dust](https://dust.tt/). -- **Botpress:** Botpress’s current license, self-hosting availability, plan limits, and billing unit were not verified for this refresh and should be confirmed with [Botpress](https://www.botpress.com/docs/integrations/integration-guides/slack/). -- **n8n:** n8n is self-hostable under the [source-available Sustainable Use License v1.0](https://docs.n8n.io/privacy-and-security/sustainable-use-license/), which is not OSI-approved; current hosted billing should be confirmed with n8n. -- **Zapier:** Zapier’s current license, self-hosting availability, plan limits, and billing unit were not verified for this refresh and should be confirmed with [Zapier](https://zapier.com/apps/slack/integrations). +- **Sim:** Sim core is available under the [OSI approved Apache License 2.0](https://opensource.org/licenses) and can be self hosted. Code in `apps/sim/ee` uses the [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE), which permits development, testing, and internal nonproduction use, while production use requires an active Enterprise subscription. Workspace bring your own key works on every Sim Cloud plan, and local models work on self hosted Sim. +- **Slack AI:** Slack provides proprietary AI features through its plans, including search, summaries, recaps, and Slackbot capabilities described on the [Slack AI page](https://slack.com/features/ai). +- **ClearFeed:** ClearFeed offers Slack support, help desk, integrations, and AI agent products, with current packaging on its [first party site](https://clearfeed.ai/). +- **Dust:** Dust offers Slack connected agents and Business and Enterprise plans, with product and packaging details on the [Dust site](https://dust.tt/). +- **Botpress:** Botpress provides an [official Slack integration](https://www.botpress.com/docs/integrations/integration-guides/slack/) and managed pricing based on its current plans. +- **n8n:** n8n provides cloud and self hosted deployment under its [fair code licensing model](https://docs.n8n.io/n8n-community-license). +- **Zapier:** Zapier provides [Slack triggers and actions](https://zapier.com/apps/slack/integrations) across its managed automation service. ## Which related AI agent comparisons should buyers read? -Sim’s Slack guide owns the Slack-specific selection and deployment lane, while the broader best AI agent builder comparison remains the canonical guide for head-term research. +This guide covers Slack selection, deployment, CRM work, knowledge retrieval, and governance. For the broader category, read [Best AI Agent Platforms and Builders in 2026](https://www.sim.ai/library/best-ai-agent-platforms-2026). For CRM native sales agents and prospecting tools, read [Best AI Agents for Sales and CRM Automation](https://www.sim.ai/library/best-ai-agents-sales-crm-automation). -- For the broader category, read [Best AI Agent Platforms and Builders in 2026](https://www.sim.ai/library/best-ai-agent-platforms-2026). -- For Slack-specific evaluation, deployment, Slack-to-CRM, knowledge, and governance questions, remain on this guide. -- For CRM-native sales agents and prospecting tools such as Salesforce Agentforce, HubSpot Breeze, and Clay, read [Best AI Agents for Sales and CRM Automation](https://www.sim.ai/library/best-ai-agents-sales-crm-automation). -- For direct platform evaluation, compare the tested workflow, licensing requirements, deployment model, and operating cost rather than relying on a generic overall ranking. +Compare the tested workflow, licensing requirements, deployment model, permissions, and operating cost rather than relying on a generic ranking. ## Where can buyers verify the platform claims in this guide? -Sim and the compared vendors provide first-party product or documentation pages that buyers should recheck because features, limits, and commercial terms can change. +The following first party sources support the changing product, pricing, hosting, integration, and license claims in this comparison as of November 2026: - [Sim GitHub repository](https://github.com/simstudioai/sim) -- [Sim Apache 2.0 license](https://github.com/simstudioai/sim/blob/main/LICENSE) +- [Sim core license](https://github.com/simstudioai/sim/blob/main/LICENSE) +- [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE) +- [Sim bring your own key documentation](https://docs.sim.ai/platform/costs#bring-your-own-key-byok) +- [Sim self hosting documentation](https://docs.sim.ai/platform/self-hosting) - [Slack developer platform](https://api.slack.com/) +- [Slack AI](https://slack.com/features/ai) +- [Slack pricing](https://slack.com/pricing) - [ClearFeed](https://clearfeed.ai/) +- [ClearFeed Slack chatbot](https://clearfeed.ai/slack-chatbot) +- [Dust](https://dust.tt/) - [Dust Slack integration](https://dust.tt/integrations/slack) - [Botpress Slack integration documentation](https://www.botpress.com/docs/integrations/integration-guides/slack/) - [n8n Slack node documentation](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.slack/) -- [n8n Sustainable Use License documentation](https://docs.n8n.io/privacy-and-security/sustainable-use-license/) +- [n8n community license documentation](https://docs.n8n.io/n8n-community-license) +- [n8n pricing](https://n8n.io/pricing/) - [Zapier Slack integrations](https://zapier.com/apps/slack/integrations) +- [Gumloop Slack agent documentation](https://docs.gumloop.com/core-concepts/agents_slack) diff --git a/apps/sim/content/library/best-free-ai-agent-builders-2026/index.mdx b/apps/sim/content/library/best-free-ai-agent-builders-2026/index.mdx index 1f428f99bb4..d49bd09d476 100644 --- a/apps/sim/content/library/best-free-ai-agent-builders-2026/index.mdx +++ b/apps/sim/content/library/best-free-ai-agent-builders-2026/index.mdx @@ -168,4 +168,5 @@ Before you commit, run one real task end to end on the free plan, including a de - [Best no-code AI agent builders](https://www.sim.ai/library/best-no-code-ai-agent-builders-2026) if nobody on your team writes code - [Best open-source AI agent platforms](https://www.sim.ai/library/open-source-ai-agent-platforms) if self-hosting is a requirement +- [Cheapest AI agent builders for startups](https://www.sim.ai/library/cheapest-ai-agent-builders-for-startups-2026) if you are comparing paid entry prices as well as free plans - [Best AI agent platforms and builders in 2026](https://www.sim.ai/library/best-ai-agent-platforms-2026) for the broader category diff --git a/apps/sim/content/library/best-glean-alternatives-pricing-2026/index.mdx b/apps/sim/content/library/best-glean-alternatives-pricing-2026/index.mdx new file mode 100644 index 00000000000..d89009fd960 --- /dev/null +++ b/apps/sim/content/library/best-glean-alternatives-pricing-2026/index.mdx @@ -0,0 +1,220 @@ +--- +slug: best-glean-alternatives-pricing-2026 +title: 'What Are the Best Glean Alternatives, and How Much Does Glean Cost?' +description: 'Compare Glean alternatives for enterprise search, knowledge management, workplace assistants, and governed AI agents, plus Glean pricing details.' +seoTitle: 'Glean Alternatives and Pricing in 2026' +date: 2026-11-24 +updated: 2026-11-24 +authors: + - andrew +readingTime: 10 +tags: [AI Agents, Enterprise Search, Knowledge Management, Sim] +ogImage: /library/best-glean-alternatives-pricing-2026/cover.jpg +draft: false +faq: + - q: "Is Glean an enterprise search platform or an AI agent platform?" + a: "Glean is primarily an enterprise search and work-assistant platform that also offers agent capabilities around connected organizational knowledge." + - q: "What is the difference between enterprise search and an AI agent workspace?" + a: "Glean and Coveo focus on finding and presenting relevant information, while Sim focuses on building agents that can retrieve context, make decisions, and execute governed steps across tools." + - q: "Which Glean competitors can be self-hosted?" + a: "Sim and n8n document self-hosted deployment options. Buyers should confirm deployment terms directly with every vendor in their shortlist." + - q: "Which Glean alternative is open source?" + a: "Sim's core is open source under the OSI-approved Apache 2.0 license, while Sim enterprise code has a separate license. n8n uses the source-available Sustainable Use License rather than an OSI-approved open-source license." + - q: "Can Glean alternatives search the web and internal documents together?" + a: "Sim can be configured to combine retrieval from connected knowledge sources with web-search tools in one agent. Other products' support depends on their connectors, search products, and agent configuration." + - q: "Which Glean alternative supports human approval before an agent takes action?" + a: "Sim supports a Human in the Loop step that pauses a run and resumes with submitted form fields. A downstream Condition can then route the workflow based on an approval or rejection field." + - q: "Is n8n a direct replacement for Glean?" + a: "n8n is not a direct replacement for Glean because n8n provides workflow execution components rather than a turnkey permissions-aware enterprise search experience." + - q: "Can Sim replace Glean for company-wide enterprise search?" + a: "Sim fits teams whose main requirement is building action-oriented agents, because Sim is not a drop-in company-wide enterprise search engine." + - q: "Which Glean alternative fits Microsoft 365 organizations?" + a: "Microsoft 365 Copilot fits organizations whose documents, communications, identity, and permissions already reside primarily in Microsoft 365." + - q: "Which Glean alternative fits teams that need actions across business tools?" + a: "Sim fits teams building governed agents that combine retrieved context with API calls, application tools, logic, and human input." + - q: "What should a CIO include in a Glean proof of concept?" + a: "A Glean proof of concept should test representative data sources, permission-sensitive queries, retrieval quality, stale content, connector reliability, administrative controls, adoption, implementation effort, and total contract cost." + - q: "What should a CIO include in a Glean alternative proof of concept?" + a: "A Glean alternative proof of concept should add action accuracy, credential isolation, approval behavior, failure handling, auditability, deployment requirements, and operational ownership to the enterprise-search tests." +--- + +## TL;DR + +The right Glean alternative depends on the job. [Coveo](https://www.coveo.com/en/solutions/digital-workplace) fits search-led digital workplace experiences, [Microsoft 365 Copilot](https://www.microsoft.com/en-us/copilot/pricing/enterprise) fits Microsoft-centric organizations, [Guru](https://www.getguru.com/features/verification) fits knowledge maintenance, [Dust](https://dust.tt/home/product) fits configurable workplace agents, [n8n](https://n8n.io/pricing/) fits technical workflow automation, and Sim fits teams that need governed agents to retrieve context and act across tools. + +[Glean](https://www.glean.com/enterprise-search) remains a strong option for permissions-aware enterprise search. Sim is not a pure enterprise search engine. Sim is the open-source AI workspace where teams build, deploy, and manage AI agents that combine knowledge retrieval with tool use and multi-step execution. + +All pricing and licensing references in this guide are current as of November 2026 and link to first-party vendor sources. + +## What are the best Glean alternatives? + +Sim, Coveo, Microsoft 365 Copilot, Guru, Dust, and n8n address distinct enterprise requirements rather than serving as interchangeable replacements. + +1. **Sim:** Fits governed agents that search for context and act across systems. +2. **[Coveo](https://www.coveo.com/en/pricing/):** Fits enterprise search across digital workplace, service, commerce, and website experiences. +3. **[Microsoft 365 Copilot](https://learn.microsoft.com/en-us/microsoft-365/copilot/extensibility/copilot-apis-overview):** Fits organizations centered on Microsoft 365 and Microsoft Graph. +4. **[Guru](https://www.getguru.com/features/verification):** Fits teams maintaining and delivering verified internal knowledge in employees' existing tools. +5. **[Dust](https://dust.tt/home/product):** Fits configurable workplace agents that use company context. +6. **[n8n](https://n8n.io/pricing/):** Fits technical teams building workflow automation around APIs, databases, and AI models. + +[Glean is compelling](https://www.glean.com/enterprise-search) when permissions-aware search and a unified employee assistant are the primary requirements. Buyers should consider alternatives when deployment control, action depth, ecosystem alignment, knowledge-maintenance workflows, or automation flexibility matters more than turnkey enterprise search. + +## How did we compare Glean alternatives? + +This comparison uses practical buying questions rather than scores or rankings: + +- Can the product retrieve useful context from systems employees already use? +- Does it preserve source-system permissions when returning search results? +- Can it take governed actions, or does it mainly answer questions? +- What deployment options does the vendor document? +- What identity, access, audit, and administrative controls are available? +- Is the pricing model public enough for buyers to estimate cost before procurement? + +Enterprise search, knowledge management, workplace agents, and agent workspaces are different categories with overlapping use cases. A tool can be a credible Glean alternative for one buying need without matching Glean feature for feature. + +## How do Glean alternatives compare? + +Glean fits buyers seeking turnkey permissions-aware enterprise search. Sim fits buyers whose primary requirement is building agents that retrieve context and execute governed work across systems. + +| Platform | Primary fit | Search and context | Actions | Deployment and pricing | +|---|---|---|---|---| +| **Glean** | Permissions-aware enterprise search and assistance | Glean says its search spans 100+ tools and returns permission-aware results | Glean also offers governed agent capabilities around enterprise context | Glean documents per-user licensing, with usage models that vary between its Core Suite and Enterprise Flex offerings | +| **Sim** | Governed, action-oriented agents | Agents can combine retrieval, models, APIs, and connected tools | Visual workflows support tools, logic, human input, and multi-step execution | Sim Cloud has published plans, and Sim's core can be self-hosted | +| **Coveo** | Search-led workplace, service, website, and commerce experiences | Coveo offers a secure unified index and AI search across enterprise knowledge | The product is oriented around search and digital experiences | Coveo publishes product packaging and asks buyers to request pricing | +| **Microsoft 365 Copilot** | Microsoft-centered organizations | Microsoft 365 Copilot works with Microsoft 365 data and its identity model | Copilot Studio extends the environment with custom agents and actions | Microsoft publishes enterprise and Copilot Studio licensing options | +| **Guru** | Knowledge governance and verification | Guru combines enterprise knowledge access with human verification workflows | Its focus is trusted answers and knowledge maintenance | Guru now scopes pricing around each organization's scale and knowledge requirements | +| **Dust** | Configurable workplace agents | Dust connects company knowledge, tools, and teams | Custom agents can use knowledge, tools, schedules, and triggers | Dust publishes a Business plan and custom Enterprise options | +| **n8n** | Technical workflow automation | Teams can assemble retrieval from integrations, databases, vector stores, and models | n8n provides flexible API and workflow execution | n8n offers cloud and self-hosted editions, with cloud pricing based on workflow executions | + +Sources for the table include [Glean Enterprise Search](https://www.glean.com/enterprise-search), [Glean Core Suite licensing](https://docs.glean.com/glean-core-suite-pricing), [Sim pricing](https://www.sim.ai/pricing), [Coveo pricing](https://www.coveo.com/en/pricing/), [Microsoft Copilot enterprise pricing](https://www.microsoft.com/en-us/copilot/pricing/enterprise), [Guru pricing](https://www.getguru.com/pricing), [Dust pricing](https://dust.tt/home/pricing), and [n8n pricing](https://n8n.io/pricing/). + +## What key facts should enterprise buyers know at a glance? + +Licensing, deployment, and billing differ materially across these products, so procurement teams should compare implementation scope as well as subscription terms. + +- **Glean:** Its [Core Suite](https://docs.glean.com/glean-core-suite-pricing) uses per-user, per-month licensing, while [Enterprise Flex](https://docs.glean.com/glean-enterprise-flex-pricing) combines per-user licensing with pooled usage credits. +- **Sim:** [Sim's core is Apache 2.0](https://github.com/simstudioai/sim/blob/main/LICENSE) and can be self-hosted. Code in `apps/sim/ee` is covered by the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE), and production use of that enterprise code requires an active Sim Enterprise subscription. +- **Coveo:** Coveo's [pricing page](https://www.coveo.com/en/pricing/) describes packages for service, website, workplace, and commerce use cases and directs buyers to request pricing. +- **Microsoft 365 Copilot:** Microsoft publishes [enterprise Copilot plans](https://www.microsoft.com/en-us/copilot/pricing/enterprise), with separate options for [Copilot Studio](https://www.microsoft.com/en-us/copilot/pricing/copilot-studio). +- **Guru:** Guru's [pricing page](https://www.getguru.com/pricing) says pricing is tailored to organizational scale, knowledge complexity, and AI maturity. +- **Dust:** Dust publishes [Business and Enterprise plan details](https://dust.tt/home/pricing), including credits, connectors, governance, and support differences. +- **n8n:** n8n's self-hosted Community Edition uses the [Sustainable Use License](https://docs.n8n.io/n8n-community-license/community-license/license-faq), while its [pricing](https://n8n.io/pricing/) covers cloud and paid self-hosted plans. + +## How much does Glean cost? + +Glean does not publish a universal dollar list price in its public pricing documentation as of November 2026. Its [Core Suite documentation](https://docs.glean.com/glean-core-suite-pricing) describes per-user, per-month licensing, while [Enterprise Flex](https://docs.glean.com/glean-enterprise-flex-pricing) combines per-user seats with pooled credits for advanced AI usage. + +Buyers should request a written quote that separates these cost drivers: + +- Number of licensed or active users +- Included data sources and connectors +- Search, assistant, and agent capabilities +- Identity, governance, security, and support requirements +- Implementation and connector setup +- Contract length and minimum commitment +- Usage allowances and overage terms for the proposed package + +A useful total-cost estimate covers both subscription fees and implementation work. Third-party estimates should not be treated as authoritative purchase terms. + +## Is Sim a good Glean alternative? + +Sim fits teams that need to build governed agents that retrieve context and then take action across APIs and business tools. + +**Fit:** CIOs, Heads of AI, platform teams, and developers that want an extensible agent workspace rather than a preconfigured enterprise search product. + +**Pricing and deployment:** [Sim publishes cloud plan details](https://www.sim.ai/pricing), and workspace BYOK keys work on any Sim Cloud plan. Organization-level model keys require Pro for Teams, Max for Teams, or Enterprise, according to the [Sim cost and BYOK documentation](https://docs.sim.ai/platform/costs#bring-your-own-key-byok). [Self-hosted Sim](https://docs.sim.ai/platform/self-hosting) can use local model services such as Ollama, vLLM, LM Studio, or LiteLLM without requiring Sim Enterprise. + +**Strengths:** Sim provides a visual workflow builder for combining models, retrieval, APIs, conditions, human input, and application actions. Sim Cloud reduces operational work, while self-hosting supports infrastructure control and local models. Enterprise code covers SSO, SCIM, access control, audit logs, data retention, session policies, and related controls. + +**Limitations:** Sim is not a drop-in enterprise search engine. Teams must design data ingestion, retrieval, permissions, credentials, and action policies for each agent. Organizations seeking an immediately deployed company-wide search layer may prefer Glean or Coveo. + +For adjacent comparisons, see [Glean vs Dust](https://www.sim.ai/library/glean-vs-dust-enterprise-ai) and [AI agents for internal knowledge search](https://www.sim.ai/library/best-ai-agents-internal-knowledge-search). + +## Is Coveo a good Glean alternative? + +Coveo fits organizations prioritizing enterprise search, relevance, and search-driven digital experiences. + +**Fit:** Enterprises that need search across employee, customer-service, commerce, or website experiences and want relevance tooling around those experiences. + +**Pricing:** As of November 2026, [Coveo's pricing page](https://www.coveo.com/en/pricing/) describes product-specific packaging and asks buyers to request pricing. + +**Strengths:** Coveo specializes in secure, unified search and relevance across several enterprise use cases. Its [digital workplace product](https://www.coveo.com/en/solutions/digital-workplace) connects enterprise systems and surfaces knowledge in employees' flow of work. + +**Limitations:** Coveo is oriented around search and digital experiences rather than a general-purpose agent workspace. Buyers whose main goal is arbitrary multi-step execution across APIs should compare its action model with Sim or n8n. + +## Is Microsoft 365 Copilot a good Glean alternative? + +Microsoft 365 Copilot fits organizations whose knowledge, identity, collaboration, and productivity estate centers on Microsoft 365. + +**Fit:** Enterprises that primarily use Teams, SharePoint, Outlook, Word, Excel, and other Microsoft services. + +**Pricing:** As of November 2026, Microsoft publishes [commercial enterprise Copilot licensing](https://www.microsoft.com/en-us/copilot/pricing/enterprise), while agent-building capacity has separate [Copilot Studio options](https://www.microsoft.com/en-us/copilot/pricing/copilot-studio). + +**Strengths:** Microsoft documents that its Copilot APIs use the same authentication and authorization model as other Microsoft Graph APIs, with organizational controls enforced through Microsoft Entra ID and Microsoft 365. [Microsoft's security documentation](https://learn.microsoft.com/en-us/microsoft-365/copilot/extensibility/copilot-apis-security-authentication) explains those permission boundaries. + +**Limitations:** Microsoft 365 Copilot is most compelling inside the Microsoft ecosystem. Enterprises with heterogeneous data estates should assess external connectors, non-Microsoft actions, licensing dependencies, and implementation effort. + +## Is Guru a good Glean alternative? + +Guru fits teams that need governed knowledge creation, verification, and delivery inside employees' existing work surfaces. + +**Fit:** Operations, enablement, support, and people teams that need employees to find trusted internal answers and keep knowledge current. + +**Pricing:** As of November 2026, [Guru's pricing page](https://www.getguru.com/pricing) says the vendor scopes an engagement based on organizational scale, knowledge complexity, and AI maturity rather than listing standard per-user tiers. + +**Strengths:** Guru combines knowledge discovery with workflows for capturing, organizing, and verifying internal information. Its [verification feature](https://www.getguru.com/features/verification) assigns verification status, timestamps, and responsible subject-matter experts to knowledge. + +**Limitations:** Guru is not a general-purpose self-hosted agent workspace. Buyers needing complex API execution or custom multi-step agents should compare Guru with Sim or n8n. + +## Is Dust a good Glean alternative? + +Dust fits teams that want configurable workplace agents grounded in company context. + +**Fit:** Enterprises creating role-specific agents for knowledge work without making enterprise search the only interface. + +**Pricing:** As of November 2026, [Dust publishes a Business plan and custom Enterprise options](https://dust.tt/home/pricing). + +**Strengths:** Dust says its agents can use company knowledge, tools, schedules, triggers, and multiple models. Its [product overview](https://dust.tt/home/product) emphasizes shared knowledge, tools, skills, and governed human-agent collaboration. + +**Limitations:** Buyers should assess Dust's connector coverage, source permissions, action depth, administration, deployment options, and contract terms against their requirements. + +## Is n8n a good Glean alternative? + +n8n fits technical teams that primarily need workflow execution, but it is not a direct replacement for turnkey permissions-aware enterprise search. + +**Fit:** Technical automation teams assembling API workflows, retrieval pipelines, model calls, and application actions. + +**Pricing:** As of November 2026, [n8n pricing](https://n8n.io/pricing/) is based on monthly workflow executions and includes hosted and paid self-hosted plans. n8n also documents a free [self-hosted Community Edition](https://docs.n8n.io/deploy/host-n8n/community-edition-features). + +**Strengths:** n8n provides integrations, workflow logic, AI nodes, and cloud or self-hosted deployment. Teams can construct knowledge-retrieval workflows by combining data sources, vector stores, models, and application nodes. + +**Limitations:** Teams must build and operate the search, indexing, retrieval, and permission behavior that Glean packages as an enterprise product. n8n's [Sustainable Use License](https://docs.n8n.io/n8n-community-license/community-license/license-faq) is source-available rather than OSI-approved open source. + +## Which Glean alternative should CIOs choose? + +Choose according to the primary requirement: + +- Choose **[Glean](https://www.glean.com/enterprise-search)** when company-wide, permissions-aware enterprise search is the main purchase. +- Choose **Sim** when agents need to do more than return an answer, teams want a visual builder for models, tools, logic, and human input, or self-hosting and local-model support matter. +- Choose **[Coveo](https://www.coveo.com/en/solutions/digital-workplace)** when search relevance and search-driven digital experiences are central requirements. +- Choose **[Microsoft 365 Copilot](https://learn.microsoft.com/en-us/microsoft-365/copilot/extensibility/copilot-apis-overview)** when Microsoft Graph and Microsoft 365 define the enterprise knowledge layer. +- Choose **[Guru](https://www.getguru.com/features/verification)** when trusted knowledge maintenance is the main problem. +- Choose **[Dust](https://dust.tt/home/product)** when configurable workplace agents are the desired interface. +- Choose **[n8n](https://n8n.io/pricing/)** when a technical team wants to construct the surrounding automation itself. + +A proof of concept should use representative data, permission-sensitive queries, stale content, realistic actions, approval paths, failures, and administrative review. Procurement should evaluate operational ownership and implementation effort alongside subscription pricing. + +## Where can buyers compare Glean, Dust, and internal knowledge-search agents in more detail? + +These related guides separate direct product comparison, internal-search use cases, and broader enterprise-agent evaluation: + +- [Glean vs Dust: Which Enterprise AI Platform Should You Choose?](https://www.sim.ai/library/glean-vs-dust-enterprise-ai) covers direct head-to-head evaluation. +- [Best AI Agents for Internal Knowledge Search Across Docs and Tools](https://www.sim.ai/library/best-ai-agents-internal-knowledge-search) focuses on internal-search use cases. +- [Best Enterprise AI Agent Platforms in 2026](https://www.sim.ai/library/best-ai-agent-platforms-for-enterprise-teams-2026) compares governance capabilities such as SSO, SCIM, access control, and audit logs. +- [Best AI Agent Platforms and Builders in 2026](https://www.sim.ai/library/best-ai-agent-platforms-2026) covers the wider AI agent platform market. + +## What else should enterprise buyers know about Glean alternatives? + +Glean alternatives should be evaluated as different product categories with overlapping use cases, not as feature-identical substitutes. Enterprise search products package indexing, retrieval, relevance, and permission handling, while agent workspaces and automation products give teams more responsibility for designing context, credentials, actions, approvals, and operational safeguards. + +The final choice should follow the workload. Start with the employee question or business action the system must support, identify the source permissions and audit evidence required, and then test the smallest realistic deployment before signing a broad contract. diff --git a/apps/sim/content/library/best-self-hosted-ai-workflow-automation-platforms-2026/index.mdx b/apps/sim/content/library/best-self-hosted-ai-workflow-automation-platforms-2026/index.mdx index 1c24b275e71..577538d8f81 100644 --- a/apps/sim/content/library/best-self-hosted-ai-workflow-automation-platforms-2026/index.mdx +++ b/apps/sim/content/library/best-self-hosted-ai-workflow-automation-platforms-2026/index.mdx @@ -333,7 +333,7 @@ The selection therefore depends on both product capabilities and the team that w This example routes a sample request using its priority. It uses two blocks in Sim and two nodes in n8n, with no model calls or external integrations. You can use the same inputs to check a successful run and find the failed step on each platform. 1. In Sim, download the [Sim workflow JSON](/library/best-self-hosted-ai-workflow-automation-platforms-2026/support-routing-sim.json). [Import it into a test workspace](https://docs.sim.ai/cli/workflows#import-workflow), [deploy it](https://docs.sim.ai/workflows/deployment), then [call the execution API](https://docs.sim.ai/api-reference/getting-started#quick-start) with `{"input":{"priority":"urgent"}}`. Read the routing decision at `data.output.result.queue`. -2. In n8n, download the [n8n workflow JSON](/library/best-self-hosted-ai-workflow-automation-platforms-2026/support-routing-n8n.json). [Import the workflow](https://docs.n8n.io/deploy/host-n8n/configure-n8n/use-the-command-line.md#import-workflows-and-credentials), publish it on a local test instance, and POST `{"priority":"urgent"}` to the [Webhook node's production URL](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.webhook#webhook-urls). Read the decision at `queue`. The bundled webhook is for local testing. Configure authentication before exposing it to a network. +2. In n8n, download the [n8n workflow JSON](/library/best-self-hosted-ai-workflow-automation-platforms-2026/support-routing-n8n.json). [Import the workflow](https://docs.n8n.io/deploy/host-n8n/configure-n8n/use-the-command-line#import-workflows-and-credentials), publish it on a local test instance, and POST `{"priority":"urgent"}` to the [Webhook node's production URL](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.webhook#webhook-urls). Read the decision at `queue`. The bundled webhook is for local testing. Configure authentication before exposing it to a network. 3. Repeat with `"normal"` and `"invalid"`. On Sim, inspect `data.status` and the **Route request** block in Logs. On n8n, open the matching run under **Executions** and inspect the **Route request** node. We ran these inputs on local Docker installations of Sim v0.9.62 and n8n 2.48.5. diff --git a/apps/sim/content/library/cheapest-ai-agent-builders-for-startups-2026/index.mdx b/apps/sim/content/library/cheapest-ai-agent-builders-for-startups-2026/index.mdx new file mode 100644 index 00000000000..9f5e552dff0 --- /dev/null +++ b/apps/sim/content/library/cheapest-ai-agent-builders-for-startups-2026/index.mdx @@ -0,0 +1,196 @@ +--- +slug: cheapest-ai-agent-builders-for-startups-2026 +title: 'Cheapest AI Agent Builders for Startups in 2026: Free Tiers and Entry Prices Compared' +description: 'Compare free tiers and entry prices for Sim, n8n, Zapier, Make, Dify, Gumloop, Lindy, and Relevance AI to find a low-cost AI agent builder for a small team.' +seoTitle: 'Cheapest AI Agent Builders for Startups in 2026' +date: 2026-11-24 +authors: + - sim +readingTime: 8 +tags: [AI Agents, Pricing, Open Source, Sim] +ogImage: /library/cheapest-ai-agent-builders-for-startups-2026/cover.jpg +draft: false +faq: + - q: "What is the cheapest AI agent platform with solid features?" + a: "The lowest cash cost is a self-hosted open-source builder such as Sim, n8n's Community Edition, or Dify's Community Edition, where you pay only for your server and models; among hosted paid plans, Zapier Professional starts at $19.99 a month, n8n Starter at €20 a month billed annually, and Sim Pro at $25 per user per month." + - q: "Which AI agent builder is the best value for the price?" + a: "It depends on the unit you are billed in: n8n bills per workflow execution with unlimited steps, Zapier bills per task, and Sim, Make, Gumloop, and Lindy bill in credits, so the best value is the plan whose unit matches how many steps and model calls your agent makes." + - q: "Which AI agent builder has the best free tier for testing before buying?" + a: "For a recurring hosted allowance, Make's Free plan offers up to 1,000 credits a month and Zapier's Free plan 100 tasks a month, while Sim's Free plan gives 1,000 one-time credits with all integrations and no credit card, and n8n Cloud offers a 14-day trial with no credit card." + - q: "What is the best low-cost or free AI agent platform for a startup with a tiny budget?" + a: "A startup with no budget can self-host Sim, n8n, or Dify for no license fee and bring its own model keys, or start on a hosted free plan and move to a paid tier only when the agent runs every day." + - q: "What is the best AI agent builder for a small startup team?" + a: "For a team rather than a solo builder, check which plan lets you invite teammates before comparing prices: in Sim, Pro at $25 per user per month adds teammate invites and three workspaces to what the Free plan includes." + - q: "Do I need a credit card to try an AI agent builder?" + a: "Not always: Sim's Free plan and n8n Cloud's 14-day trial both start without a credit card." + - q: "Is Sim free?" + a: "Yes, Sim's Free plan costs $0 with 1,000 one-time credits, one workspace, and all 280+ integrations on your own model keys, and Sim's Apache 2.0 core can be self-hosted for no license fee." + - q: "How much does Sim cost after the free plan?" + a: "Sim Pro is $25 per user per month with 6,000 credits a month plus a weekly refresh of 2,000 more, Max is $100 per user per month with 25,000 credits a month plus a weekly refresh of 4,000, and annual billing costs 15% less." + - q: "Can I self-host an AI agent builder for free?" + a: "Yes, Sim's Apache 2.0 core, n8n's Community Edition, and Dify's Community Edition can be self-hosted without a license fee, but you still pay for the server, the models, and the time to maintain them." + - q: "Do AI agent builders offer startup discounts?" + a: "n8n lists a Startup plan for companies with fewer than 20 employees that qualify, so ask each vendor's sales team before paying list price." + - q: "Does bringing my own model API keys lower the cost?" + a: "Usually yes: in Sim, model calls on your own provider keys add no Sim usage charge beyond the 1-credit base charge per run, so you pay the model provider directly at its own rates." +--- + +The cheapest way to run an AI agent in 2026 is to self-host an open-source builder such as Sim, n8n's Community Edition, or Dify's Community Edition and pay only for a server and model usage. If you would rather not run infrastructure, the lowest hosted entry prices are Zapier Professional from $19.99 a month, n8n Starter at €20 a month billed annually, and Sim Pro at $25 per user per month, and several builders have a free plan or trial to test on first. + +This article is published by Sim, and Sim is one of the eight products covered. Prices were checked against each vendor's pricing page on November 24, 2026, except Make, whose page could not be loaded for this review; its figures come from a capture used in our [guide to free AI agent builders](https://www.sim.ai/library/best-free-ai-agent-builders-2026). Prices change, so confirm them before you commit. + +> **Choose self-hosting when** you have someone who can run a server and you want the lowest cash cost. +> +> **Choose a hosted free plan when** you want to test an agent on real work this week without a card. +> +> **Choose Sim when** you want to build visually, in Chat, or with code on an Apache 2.0 core, use your own model keys without a markup, and add teammates on the same agents when you are ready. + +## What is the cheapest AI agent platform with solid features? + +There are two kinds of cheap, and they cost different things. + +- **Self-hosted, no license fee.** Sim, n8n, and Dify publish editions you can run yourself. The software costs nothing, but a server, model usage, updates, and security are on you. +- **Hosted, low entry price.** Zapier, n8n, and Sim have paid plans from about $20 to $25 a month for one builder. You trade a monthly fee for not running anything. + +For a startup, the deciding cost is usually not the plan price but the unit the plan meters. An agent that runs ten steps and three model calls per run burns through a per-task or per-credit allowance much faster than one that runs a single step. + +## How do free tiers and entry prices compare? + +| Builder | Free option | Lowest listed paid price | Billed in | +| --- | --- | --- | --- | +| **Sim** | Free plan, 1,000 one-time credits, no card; or self-host the Apache 2.0 core | Pro, $25 per user per month | Credits | +| **n8n** | Self-hosted Community Edition; 14-day Cloud trial, no card | Starter, €20 a month billed annually | Workflow executions | +| **Zapier** | Free plan, 100 tasks a month, two-step Zaps | Professional, from $19.99 a month | Tasks | +| **Make** | Free plan, up to 1,000 credits a month | Priced by credit volume | Credits | +| **Dify** | Sandbox, 200 message credits; or self-deploy the Community Edition | Professional, $590 per workspace a year | Message credits | +| **Gumloop** | 14-day trial of Pro | Pro, $37 a month | Credits | +| **Lindy** | $50 in credits that last 7 days | From $49.99 per user per month | Credits | +| **Relevance AI** | Try for free | No self-serve price published | Custom | + +## Which builder has the best free tier for testing before you buy? + +The best free tier for testing is one that lets you run the exact agent you plan to buy, with your real integrations, for long enough to see a week of results. + +- **Recurring hosted allowances** suit agents that run on a schedule. Make offers up to 1,000 credits a month, and Zapier 100 tasks a month with two-step Zaps. +- **One-time allowances and trials** suit a focused evaluation. Sim's Free plan gives 1,000 one-time credits with all 280+ integrations and no card. n8n Cloud offers 14 days with no card. Gumloop offers 14 days of Pro. Lindy's $50 in credits last 7 days. +- **Self-hosted editions** have no time limit at all, so they suit long evaluations if you can run a server. + +On Sim's Free plan, models and tools run on your own provider keys, and each run carries a base charge of 1 credit. If every model call in an agent uses your keys, the 1,000 credits cover up to 1,000 runs, with sandboxed code and hosted tools costing extra. + +## What does each platform cost a small startup team? + +Sim, the publisher, is listed first; the others follow in order of entry price, with the trade-off for each stated plainly. + +### 1. Sim + +**Best for:** Small teams that want to build visually, in Chat, or with code, bring their own model keys, and keep the option to self-host. + +**What it costs:** The Free plan is $0 with 1,000 one-time credits, one workspace, two concurrent executions, and all 280+ integrations on your own keys. Pro is $25 per user per month with 6,000 credits a month plus a weekly refresh of 2,000 more, three workspaces, teammate invites, and Sim-hosted models. Max is $100 per user per month with 25,000 credits a month plus a weekly refresh of 4,000. Annual billing costs 15% less. One credit is $0.005, and model calls on your own keys add no Sim usage charge beyond the 1-credit base charge per run. + +**Limitations:** The Free plan's credits do not renew and it does not include teammate invites, so a team that runs agents every day will need Pro or a self-hosted deployment. Enterprise features such as SSO and access control need a license when self-hosted. + +**Sources:** [Sim pricing](https://www.sim.ai/pricing), [Sim repository license](https://github.com/simstudioai/sim/blob/main/LICENSE). + +### 2. Zapier + +**Best for:** Teams whose agents are short, simple automations between popular apps. + +**What it costs:** The Free plan is $0 with 100 tasks a month and two-step Zaps. Professional starts at $19.99 a month, and Team starts at $69 a month. + +**Limitations:** Zapier bills per task, so a multi-step agent that runs often moves up the task tiers quickly. For how that adds up, see [Zapier pricing at scale](https://www.sim.ai/library/zapier-pricing-at-scale). + +**Sources:** [Zapier pricing](https://zapier.com/pricing), [Sim vs Zapier](https://www.sim.ai/comparisons/zapier). + +### 3. n8n + +**Best for:** Technical teams that want per-execution billing or are happy to self-host. + +**What it costs:** The self-hosted Community Edition has no license fee. n8n Cloud's 14-day trial needs no credit card. Starter is €20 a month billed annually for 2,500 workflow executions, and Pro is €50 a month billed annually for 10,000. n8n also lists a Startup plan for qualifying companies with fewer than 20 employees. + +**Limitations:** n8n is fair-code under the Sustainable Use License rather than OSI-approved open source, and self-hosting means running updates and security yourself. For the full breakdown, see [n8n pricing for Cloud, self-hosted, and Enterprise](https://www.sim.ai/library/n8n-pricing-cloud-self-hosted-enterprise). + +**Sources:** [n8n pricing](https://n8n.io/pricing/), [Sim vs n8n](https://www.sim.ai/comparisons/n8n). + +### 4. Make + +**Best for:** Teams that want a recurring hosted free allowance and detailed visual control. + +**What it costs:** Make's Free plan offers up to 1,000 credits a month. Paid plans are priced by monthly credit volume. + +**Limitations:** Each module action consumes credits, so a multi-step agent uses the allowance faster than the headline number suggests. + +**Sources:** [Make pricing](https://www.make.com/en/pricing), [Sim vs Make](https://www.sim.ai/comparisons/make). + +### 5. Gumloop + +**Best for:** Teams that want a hosted builder and are ready to pay after a trial. + +**What it costs:** Pro is $37 a month with 20,000 credits a month, after a 14-day free trial. Enterprise pricing is custom. + +**Limitations:** There is no permanent free plan, so evaluation is limited to the trial window. + +**Sources:** [Gumloop pricing](https://www.gumloop.com/pricing), [Sim vs Gumloop](https://www.sim.ai/comparisons/gumloop). + +### 6. Lindy + +**Best for:** Teams that want a hosted AI assistant they can hand everyday tasks to. + +**What it costs:** You start with $50 in free credits that last 7 days. Paid plans start at $49.99 a month for 5,000 credits per active user, and every active user in the workspace is billed. + +**Limitations:** Per-user billing raises the cost as the team grows, and the free credits expire after a week. + +**Sources:** [Lindy pricing](https://www.lindy.ai/pricing). + +### 7. Dify + +**Best for:** Developers building LLM apps who want a hosted sandbox or a self-deployed edition. + +**What it costs:** The Sandbox plan is free with 200 message credits. Professional is $590 per workspace a year with 5,000 message credits a month, and Team is $1,590 per workspace a year. The Community Edition can be self-deployed under the Dify Open Source License. + +**Limitations:** Paid plans are billed per workspace per year, and the Sandbox credits are sized for trying the product rather than running an agent daily. + +**Sources:** [Dify pricing](https://dify.ai/pricing), [Sim vs Dify](https://www.sim.ai/comparisons/dify). + +### 8. Relevance AI + +**Best for:** Sales and go-to-market teams buying an AI agent workforce through a sales process. + +**What it costs:** Relevance AI offers a free start, but its pricing page publishes no self-serve plan prices; Enterprise is priced through sales. + +**Limitations:** Without a listed price, a startup cannot compare it on cost until it talks to sales. + +**Sources:** [Relevance AI pricing](https://relevanceai.com/pricing), [Sim vs Relevance AI](https://www.sim.ai/comparisons/relevance-ai). + +## How do credits, tasks, and executions change the real price? + +The same agent can cost very different amounts depending on what the plan counts. + +- **Per execution (n8n).** One workflow run counts once, however many steps it has, so long agents are cheaper per run. +- **Per task (Zapier).** Each action step counts, so cost grows with the number of steps. +- **Per credit (Sim, Make, Gumloop, Lindy).** Credits are spent on runs, steps, or model calls depending on the vendor, so check what one credit buys. + +Model usage is often the largest cost of all. Builders that let you bring your own model keys, as Sim does, let you pay the model provider directly instead of a resold rate. For a full cost model, see [how much it costs to build and run an AI agent](https://www.sim.ai/library/how-much-does-it-cost-to-build-and-run-an-ai-agent). + +## When is self-hosting the cheapest option? + +Self-hosting is cheapest when someone on the team can run a server and the agent runs often enough that a hosted plan would move up its tiers. The license fee is zero for Sim's Apache 2.0 core, n8n's Community Edition, and Dify's Community Edition, but you still pay for: + +- **A server.** Sizing depends on the workload, so test with your real agents. +- **Models.** Hosted model APIs bill per token, unless you run a local model. +- **Time.** Updates, backups, and security are your team's job. + +For a side-by-side view of licenses and hosting, see [open-source AI agent platforms](https://www.sim.ai/library/open-source-ai-agent-platforms). + +## How should a startup on a tiny budget choose? + +1. **Write down one agent you need this month,** with its steps, its integrations, and how often it runs. +2. **Build it on a free plan or trial** and count how many credits, tasks, or executions one run uses. +3. **Multiply by a month of runs** and compare that against each vendor's lowest paid tier. +4. **Decide who runs it.** If nobody can maintain a server, pick a hosted plan even if self-hosting looks cheaper on paper. +5. **Ask about startup pricing** before paying list price. + +## Where can you compare more AI agent builders? + +- [The best free AI agent builders in 2026](https://www.sim.ai/library/best-free-ai-agent-builders-2026) +- [The best AI agent platforms in 2026](https://www.sim.ai/library/best-ai-agent-platforms-2026) +- [Bring your own keys to a multi-model AI agent builder](https://www.sim.ai/library/byok-multi-model-ai-agent-builder) diff --git a/apps/sim/content/library/greenhouse-ai-agent-recruiting-operations/index.mdx b/apps/sim/content/library/greenhouse-ai-agent-recruiting-operations/index.mdx new file mode 100644 index 00000000000..8a6e650c40a --- /dev/null +++ b/apps/sim/content/library/greenhouse-ai-agent-recruiting-operations/index.mdx @@ -0,0 +1,192 @@ +--- +slug: greenhouse-ai-agent-recruiting-operations +title: 'How Do You Build a Governed AI Agent for Greenhouse Recruiting Operations?' +description: 'Build a governed Greenhouse AI agent for application summaries, stage alerts, scorecard reminders, scheduling handoffs, and approved Workday transfers.' +seoTitle: 'Greenhouse AI Agent for Recruiting Operations' +date: 2026-11-23 +updated: 2026-11-23 +authors: + - andrew +readingTime: 8 +tags: [AI Agents, Greenhouse, Recruiting Operations, HR Automation, Sim] +ogImage: /library/greenhouse-ai-agent-recruiting-operations/cover.jpg +draft: false +faq: + - q: "Can AI summarize resumes in Greenhouse?" + a: "Greenhouse data can be summarized by a Sim agent when the workflow retrieves only necessary job-related information, labels the result as a model-generated summary, and leaves hiring decisions with people." + - q: "Can Greenhouse send stage changes to Slack?" + a: "Greenhouse stage changes can reach Slack through a Sim workflow that receives a documented event or polls an approved endpoint, filters the event, and posts a minimal update to an authorized private channel." + - q: "Can Greenhouse sync accepted offers to Workday?" + a: "Greenhouse accepted offer data can be prepared for Workday by Sim, but a governed workflow should validate fields and require human approval before creating or changing an employee record." + - q: "How do you connect Greenhouse to Claude for a recruiting team?" + a: "Sim can connect approved Greenhouse data to a Claude model step by using a stored provider credential, minimizing candidate fields, and routing the model output through validation and human review before any consequential action." + - q: "Can an AI agent schedule Greenhouse interviews?" + a: "A Greenhouse agent can prepare scheduling options and internal handoffs, but candidate-facing invitations and material schedule changes should require recruiter approval unless the organization has separately validated and authorized autonomous scheduling." + - q: "Does the Greenhouse Harvest API contain candidate PII?" + a: "Greenhouse recruiting records can contain personal information, so Harvest API access should be treated as sensitive and limited by endpoint permission, field selection, purpose, retention policy, and authorized user access." + - q: "Should Greenhouse agents make hiring decisions?" + a: "Greenhouse agents should not make final hiring decisions because models can omit context, reproduce bias, and generate unsupported conclusions; Sim should support administrative work and human review instead." + - q: "Can n8n automate Greenhouse recruiting operations?" + a: "n8n can support Greenhouse automation through available integrations and HTTP-based API workflows, but recruiting teams must design their own least-privilege access, candidate data controls, approvals, and failure handling." + - q: "Is Sim open source?" + a: "Sim's core is open source under Apache 2.0, while apps/sim/ee is governed by the separate Sim Enterprise License and requires an active Enterprise subscription for production use." + - q: "Do Sim Cloud workspaces support BYOK?" + a: "Sim Cloud supports workspace bring-your-own-key credentials on every cloud plan, while organization-level keys require Pro for Teams, Max for Teams, or Enterprise." +--- + +## TL;DR + +Greenhouse and Sim can support governed recruiting operations by summarizing new applications, routing internal scheduling handoffs, sending stage alerts to Slack, reminding interviewers about scorecards, and preparing accepted offer data for Workday with human approval before sensitive actions. + +Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. The [Greenhouse integration](https://www.sim.ai/integrations/greenhouse) lets recruiting operations teams connect Greenhouse data to governed workflows without turning an AI model into an unsupervised hiring decision-maker. + +## What can an AI agent safely automate in Greenhouse? + +Greenhouse agents can safely automate administrative coordination and internal decision support when candidate-facing communication, hiring decisions, and sensitive record changes remain under human control. + +Good automation candidates include application summaries for recruiters, internal scheduling handoffs, stage change notifications, overdue scorecard reminders, and approved data transfers to an HR system. The agent should summarize evidence already present in Greenhouse rather than infer protected characteristics, rank people from hidden signals, or make final hiring decisions. + +A practical boundary is simple: let the agent collect, transform, and route information, but require a person to approve candidate-facing messages and consequential record changes. The [AI Agents for Recruiting guide](https://www.sim.ai/library/best-ai-agents-for-recruiting-teams) explains how this governed approach compares with broader recruiting tools. + +## What should recruiting operations teams know before connecting Greenhouse to an AI agent? + +Greenhouse access should be limited to the smallest set of objects and actions required for each workflow. + +As of November 2026, Greenhouse documents its Recruiting APIs, including the Harvest API and recruiting webhooks, in the [Greenhouse developer documentation](https://developers.greenhouse.io/). Greenhouse administrators should create a dedicated integration credential, grant only the required endpoint permissions, and keep that credential in the workflow platform credential store rather than in prompts or workflow text. + +Recruiting operations, People Ops, IT, security, and legal teams should agree on four controls before deployment: + +1. Define which Greenhouse fields the agent may read and which fields must never enter a model prompt. + +2. Define whether model providers may retain submitted data and select an approved provider configuration. + +3. Require human approval before candidate-facing communication, rejection, offer changes, or transfers into downstream systems. + +4. Define retention, access review, incident response, and audit requirements for workflow runs. + +[Sim's Human in the Loop block](https://docs.sim.ai/workflows/blocks/human-in-the-loop) pauses a run and collects form fields. An approval field must be evaluated by a downstream Condition before the workflow continues. [Sim Guardrails](https://docs.sim.ai/workflows/blocks/guardrails) report whether a check passed or failed, so a downstream Condition must also route the workflow based on that result. + +## Which Greenhouse API objects should the agent read or write? + +Greenhouse agents should read only the recruiting objects required for the task and should receive write access only when a reviewed workflow has a specific reason to change a record. + +The following access pattern is a conservative starting point based on the recruiting data available through the [Greenhouse developer resources](https://developers.greenhouse.io/) as of November 2026. + +| Greenhouse object | Typical workflow use | Recommended agent access | +| --- | --- | --- | +| Candidate | Identify the candidate associated with an application | Read only and limit retrieved fields | +| Application | Read status, job association, and current stage | Read by default; allow stage changes only in a separately approved workflow | +| Job | Provide role context for an application summary | Read only | +| Scheduled interview | Prepare internal scheduling handoffs and reminders | Read only unless an approved scheduling workflow requires more | +| Scorecard | Detect missing interview feedback | Read completion state without generating interviewer feedback | +| Offer | Detect an accepted offer and prepare an HR system handoff | Read only for the handoff workflow | + +Field availability and endpoint permissions can vary by Greenhouse configuration. The production workflow should use the exact object names, events, and permissions shown in the organization's Greenhouse developer settings and current official documentation. + +## How do you build a new application summary for a Slack hiring channel? + +Sim can turn a new Greenhouse application into a concise internal summary and send it to an authorized Slack hiring channel without making a hiring decision. + +1. Start the workflow from a documented Greenhouse event or an approved polling process. + +2. Retrieve only the candidate, application, and job fields needed for the summary. + +3. Remove unnecessary contact details and other personal information before the model step. + +4. Ask the model to summarize job-related evidence, stated experience, open questions, and missing information without assigning a hiring score. + +5. Run the output through a Guardrails check, then use a Condition to stop or reroute failed output. + +6. Send the approved format to a private Slack channel with links back to the source record for recruiter review. + +The Slack message should distinguish candidate-supplied facts from model-generated summaries. The agent should not infer age, health, ethnicity, religion, family status, disability, or other protected characteristics from names, dates, addresses, photographs, or writing style. + +## How do you send Greenhouse stage change alerts to Slack? + +Sim can route documented Greenhouse stage changes to Slack so interview teams receive timely internal updates without exposing the entire candidate record. + +1. Configure a relevant Greenhouse event using the current [Greenhouse webhook documentation](https://docs.greenhouse.io/webhooks.html), or use an approved polling pattern when an event is unavailable. + +2. Retrieve the application identifier, job, previous stage, current stage, and responsible recruiting contact. + +3. Apply an allowlist so only approved jobs, departments, or stages can produce a message. + +4. Post a short update to the appropriate private Slack channel. + +5. Record the workflow result and route delivery failures to recruiting operations. + +A stage alert should include only the information the channel needs. Teams handling candidate information in Slack should also follow the access and retention controls in the [Slack AI Agent Security guide](https://www.sim.ai/library/slack-ai-agent-security-permissions-guide). + +## How do you automate Greenhouse scorecard reminders? + +Sim can identify incomplete Greenhouse scorecards and send internal reminders while leaving interview feedback entirely with the interviewer. + +1. Run the workflow on an approved schedule. + +2. Read recently completed interviews and their associated scorecard completion state. + +3. Compare the interview completion time with the organization's reminder policy. + +4. Notify only the responsible interviewer or recruiting coordinator through an approved Slack destination. + +5. Stop reminders when the scorecard is completed or when the application reaches an excluded state. + +The model may help produce a concise reminder, but it should never draft evaluative scorecard content on behalf of an interviewer. Interviewers must provide their own evidence and assessment. + +## How do you hand an accepted Greenhouse offer to Workday? + +Sim can prepare an accepted Greenhouse offer for Workday onboarding while requiring a person to approve the transfer before any employee record is created or changed. + +1. Start from the documented Greenhouse event or offer status used by the organization. + +2. Retrieve only the approved candidate, job, start date, location, manager, and offer fields required by the Workday process. + +3. Validate required fields and route incomplete records to People Ops. + +4. Pause the run with Human in the Loop and collect an explicit approval or rejection field. + +5. Use a Condition to continue only when the reviewer approved the transfer. + +6. Send the approved fields through a configured [Sim Workday action](https://docs.sim.ai/integrations/workday) and return the result to People Ops. + +The workflow should use a stable identifier to prevent duplicate employee creation when a run is retried. The [governed Workday AI agent guide](https://www.sim.ai/library/workday-ai-agent-employee-onboarding-offboarding) covers governance on the Workday side of this handoff. + +## How should Greenhouse agents handle permissions, PII, and auditability? + +Greenhouse agents should combine least-privilege credentials, data minimization, human approval, and reviewable execution records. + +[Greenhouse recruiting data](https://developers.greenhouse.io/) can include candidate, application, interview, scorecard, offer, and attachment information that teams should treat as sensitive. A workflow should retrieve only the fields needed for its declared purpose and should avoid placing complete resumes or complete candidate profiles into prompts when a smaller field set will work. + +Use separate credentials for development and production. Restrict Slack destinations to private channels with approved membership. Review Greenhouse, Slack, Workday, model provider, and Sim access whenever a recruiter, coordinator, administrator, or integration owner changes roles. The [agentic AI security controls guide](https://www.sim.ai/library/agentic-ai-security-risks-controls) provides a broader framework for permissions, approvals, and incident handling. + +As of November 2026, [Sim's core is licensed under Apache 2.0](https://github.com/simstudioai/sim/blob/main/LICENSE), while code in `apps/sim/ee` is governed by the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE). Enterprise capabilities such as audit logs, access control, data retention, and credential groups are located in `apps/sim/ee`, and production use of that code requires an active Sim Enterprise subscription. + +## Should recruiting teams use Sim or n8n for Greenhouse automation? + +Sim fits recruiting teams that want a visual agent workflow with model steps, governed human review, and explicit routing around AI output. n8n fits teams centered on general-purpose workflow automation. + +As of November 2026, Sim's core uses the OSI-approved Apache 2.0 license, while enterprise code uses the separate Sim Enterprise License. Sim Cloud workspaces can use [their own model provider keys](https://docs.sim.ai/platform/costs) on any cloud plan. + +As of November 2026, n8n is self-hostable under the [Sustainable Use License](https://github.com/n8n-io/n8n/blob/master/LICENSE.md), which is source-available rather than OSI-approved open source. n8n's hosted plans use workflow executions as a billing measure according to the vendor's [pricing page](https://n8n.io/pricing/). + +The choice should follow the operating model. Sim is designed for teams building, deploying, and managing AI agents. n8n is established for broad integration automation and can connect services through its [HTTP Request node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest), but the recruiting team must still design its approval, PII, and hiring governance controls. + +## What should teams test before deploying a Greenhouse agent? + +Sim Greenhouse workflows should pass functional, privacy, security, and failure recovery tests before production deployment. + +1. Test records with missing resumes, missing job data, multiple applications, withdrawn applications, and duplicate webhook delivery. + +2. Confirm that prompts receive only approved fields and that logs do not expose secrets or unnecessary candidate data. + +3. Confirm that Guardrails failures reach a downstream Condition and cannot continue through the success path. + +4. Confirm that Human in the Loop rejection reaches a downstream Condition and prevents the Workday or candidate-facing action. + +5. Test expired Greenhouse credentials, Slack permission failures, model timeouts, Workday validation errors, and workflow retries. + +6. Compare summaries with source records and measure unsupported claims, omitted qualifications, and prohibited inferences. + +7. Assign an owner who reviews failures, credential permissions, model changes, and access at a defined interval. + +A production agent should fail closed for sensitive writes. If approval, identity, or required data is missing, the workflow should stop and route the case to a person. diff --git a/apps/sim/content/library/iso-42001-nist-ai-rmf-ai-agent-governance-controls/index.mdx b/apps/sim/content/library/iso-42001-nist-ai-rmf-ai-agent-governance-controls/index.mdx new file mode 100644 index 00000000000..adc566134fe --- /dev/null +++ b/apps/sim/content/library/iso-42001-nist-ai-rmf-ai-agent-governance-controls/index.mdx @@ -0,0 +1,170 @@ +--- +slug: iso-42001-nist-ai-rmf-ai-agent-governance-controls +title: 'How Do You Map AI Agent Governance Controls to ISO 42001 and the NIST AI RMF?' +description: 'Map AI agent governance controls to ISO 42001 and the NIST AI RMF, with practical evidence requirements for oversight, risk, monitoring, and change.' +seoTitle: 'ISO 42001 and NIST AI RMF Agent Governance' +date: 2026-11-24 +updated: 2026-11-24 +authors: + - andrew +readingTime: 9 +tags: [AI Agents, AI Governance, Compliance, Risk Management, Sim] +ogImage: /library/iso-42001-nist-ai-rmf-ai-agent-governance-controls/cover.jpg +draft: false +faq: + - q: "Does ISO 42001 apply to AI agents?" + a: "ISO/IEC 42001 can apply to organizations that develop, provide, or use AI agents when those agents fall within the organization’s AI management system scope. The organization determines and documents that scope, then applies the standard’s management-system requirements and relevant controls to the agents, their supporting processes, and their lifecycle." + - q: "Can an AI agent be ISO 42001 certified?" + a: "ISO/IEC 42001 certification applies to an organization’s AI management system within a defined scope, not to a standalone AI agent as an isolated product badge. An agent may be included within the certified scope, but describing the individual agent as certified can misrepresent what was assessed." + - q: "Is the NIST AI RMF mandatory for AI agents?" + a: "The NIST AI RMF is a voluntary framework unless a law, regulator, contract, customer, or internal policy makes its use a requirement for a particular organization. Its Govern, Map, Measure, and Manage functions can still provide a practical structure for agent risk management when formal adoption is not required." + - q: "Is NIST AI RMF compliance a certification?" + a: "The NIST AI RMF does not establish a NIST certification for organizations, platforms, or AI agents. Organizations should describe specific alignment, implementation, or assessment activities instead of claiming NIST certification." + - q: "Does SOC 2 prove alignment with ISO 42001 or the NIST AI RMF?" + a: "SOC 2 does not by itself prove alignment with ISO/IEC 42001 or the NIST AI RMF because the frameworks have different scopes and objectives. SOC 2 evidence may support controls such as access management, change management, logging, and incident response, but organizations still need AI-specific governance, impact assessment, oversight, evaluation, and lifecycle evidence." + - q: "What is the difference between ISO 42001 and the NIST AI RMF for AI agents?" + a: "ISO/IEC 42001 specifies requirements for an organizational AI management system, while the NIST AI RMF provides voluntary outcomes for governing, mapping, measuring, and managing AI risk. Organizations often use ISO/IEC 42001 to structure the management system and the NIST AI RMF to deepen operational risk activities." + - q: "Do audit logs make an AI agent compliant?" + a: "Audit logs alone do not make an AI agent or organization compliant with ISO/IEC 42001 or aligned with the NIST AI RMF. Logs are evidence for selected controls, but effective governance also requires ownership, risk assessment, access control, testing, human oversight, monitoring, incident response, and corrective action." + - q: "How often should AI agent risk assessments be updated?" + a: "AI agent risk assessments should be updated on a defined schedule and whenever a material change or incident alters the agent’s context or risk. Triggers should include changes to models, prompts, tools, permissions, data sources, autonomy, affected users, deployment environments, providers, or intended use." + - q: "What counts as a material change to an AI agent?" + a: "A material change to an AI agent is any modification that could alter its behavior, access, impact, risk, or evidence requirements. Common examples include changing the model, system instructions, tools, credentials, data sources, approval logic, user population, deployment environment, or permitted actions." + - q: "Can Sim guarantee ISO 42001 or NIST AI RMF compliance?" + a: "Sim cannot guarantee an organization’s ISO/IEC 42001 certification or NIST AI RMF alignment because those outcomes depend on the organization’s full management system, scope, configuration, processes, people, and evidence. Sim can provide technical capabilities that support selected controls when they are configured and operated within an appropriate governance program." +--- + +## TL;DR + +ISO/IEC 42001 and the NIST AI Risk Management Framework ask organizations running AI agents to establish accountable governance, assess risks, maintain human oversight, document system changes, monitor performance, and retain evidence. ISO/IEC 42001 defines a certifiable AI management system, while the NIST AI RMF organizes voluntary risk management around Govern, Map, Measure, and Manage. + +The practical goal is not to label an agent “compliant.” It is to operate an AI agent program with controls that produce reviewable evidence throughout each agent’s lifecycle. + +> This guide is an operational mapping, not an official ISO-to-NIST crosswalk or legal advice. Organizations should validate their implementation with qualified auditors, counsel, and risk professionals. + +## What are the key facts about ISO 42001 and the NIST AI RMF? + +ISO/IEC 42001 and the NIST AI RMF provide complementary ways to govern AI agents: ISO/IEC 42001 specifies management-system requirements, while the NIST AI RMF provides a voluntary risk-management structure. + +- **ISO/IEC 42001:** [ISO/IEC 42001:2023](https://www.iso.org/standard/42001) is an AI management system standard covering organizational context, leadership, planning, support, operation, performance evaluation, improvement, and AI-specific control themes. +- **NIST AI RMF:** The [NIST AI Risk Management Framework](https://www.nist.gov/itl/ai-risk-management-framework) is a voluntary framework organized around Govern, Map, Measure, and Manage. +- **Certification:** Organizations can seek accredited certification against ISO/IEC 42001, but [ISO itself does not certify organizations](https://www.iso.org/conformity-assessment.html). The NIST AI RMF is not a certification standard. +- **Agent governance:** Neither framework is an agent-builder checklist. Organizations must translate framework outcomes into controls for agent inventory, ownership, risk assessment, access, approvals, logs, releases, monitoring, and incident response. +- **Evidence:** Policies alone are insufficient. Assessors need records showing that controls operated, including approvals, access reviews, test results, version records, execution logs, exceptions, incidents, and remediation. + +As of November 2026, ISO/IEC 42001:2023 remains the published ISO AI management system standard, and NIST continues to provide the AI RMF 1.0 and its supporting [AI RMF Playbook](https://airc.nist.gov/airmf-resources/playbook/). + +## How do you map AI agent governance controls to ISO 42001 and the NIST AI RMF? + +An AI agent governance program maps operational controls to both frameworks by connecting each control to an owner, a risk outcome, and retained evidence. + +| AI agent control | ISO/IEC 42001 area | NIST AI RMF function | What the control should do | Evidence an assessor may request | +|---|---|---|---|---| +| Agent inventory | Resources; AI system lifecycle; information for interested parties | Govern; Map | Record every production agent, purpose, owner, model, tools, data sources, deployment, users, and risk tier | Registry export, architecture record, data-flow record, owner attestation, retirement status | +| Accountable ownership | Leadership; roles and responsibilities; internal organization | Govern | Assign business, technical, risk, and operational accountability for each agent | Responsibility matrix, approval record, access review, escalation contacts | +| Risk and impact assessment | Planning; AI system impact assessment | Map; Measure | Assess intended use, affected people, data sensitivity, autonomy, failure modes, security threats, and impact severity before deployment | Completed assessment, threat model, test plan, residual-risk acceptance, review date | +| Human oversight | Internal organization; lifecycle processes; information provided to users | Govern; Manage | Define when a person must review, approve, reject, pause, or override an agent action | Approval logs, reviewer identity, decision record, exception record, escalation test | +| Role-based access and credential control | Resources; data controls; third-party relationships | Govern; Manage | Restrict who can create, modify, deploy, run, or administer agents and their credentials | Role assignments, access-review history, credential inventory, revocation evidence | +| Execution logging and traceability | Lifecycle processes; data controls; performance evaluation | Measure; Manage | Record agent runs, tool calls, relevant inputs and outputs, errors, approvals, and administrative events at an appropriate level | Run logs, audit events, trace exports, retention settings, investigation records | +| Testing and evaluation | Operational planning; lifecycle processes; performance evaluation | Map; Measure | Test task quality, safety boundaries, security, reliability, and foreseeable misuse before release and after material changes | Evaluation suite, test results, acceptance thresholds, failed-test disposition | +| Change control and rollback | Lifecycle processes; operational control; improvement | Govern; Manage | Review material changes to prompts, models, tools, permissions, data, and workflow logic, with a recovery path | Version record, change request, reviewer approval, deployment record, rollback test | +| Production monitoring | Performance evaluation; lifecycle processes; improvement | Measure; Manage | Monitor failures, unsafe outcomes, latency, cost, drift indicators, override rates, and control effectiveness | Dashboards, alerts, periodic review, threshold rationale, corrective-action record | +| Incident and exception management | Nonconformity and corrective action; improvement | Manage; Govern | Triage incidents, contain harm, preserve evidence, notify owners, and track remediation | Incident ticket, timeline, impact analysis, corrective action, closure approval | +| Third-party and model-provider governance | Supplier, customer, and third-party relationships | Govern; Map; Manage | Assess model providers, hosting vendors, tools, integrations, subprocessors, and contract dependencies | Due-diligence review, contract controls, provider inventory, service-change review | +| Decommissioning | Lifecycle processes; data and resource controls | Govern; Manage | Disable retired agents, revoke credentials, preserve required records, and remove obsolete access paths | Retirement approval, credential revocation, retention record, inventory update | + +This mapping should be tailored to the organization’s scope and risk profile. The official [NIST AI RMF 1.0 publication](https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.100-1.pdf) provides the authoritative NIST outcomes, while the licensed ISO standard provides the authoritative ISO/IEC 42001 requirements and controls. + +## What evidence should an AI agent governance program retain? + +An AI agent governance program should retain evidence that identifies the agent, reconstructs important decisions, and demonstrates that required controls operated over time. + +A minimum evidence package for each production agent should include: + +1. **System record:** Purpose, owner, risk tier, deployment environment, users, model providers, tools, integrations, and data categories. +2. **Risk record:** Initial impact assessment, security review, test results, residual risks, accepted exceptions, and reassessment dates. +3. **Authorization record:** Deployment approval, role assignments, credential ownership, human-approval requirements, and access reviews. +4. **Change record:** Versions, material changes, reviewer decisions, release dates, rollback procedures, and post-change validation. +5. **Operational record:** Relevant execution logs, errors, human decisions, monitoring alerts, incidents, and corrective actions. +6. **Retirement record:** Decommissioning approval, credential revocation, retained evidence, and inventory status. + +Retention should be risk-based. A low-impact internal summarization agent may not require the same evidence depth as an agent that changes customer records, initiates payments, handles health information, or modifies production infrastructure. + +## How should human oversight work for AI agents? + +Human oversight for AI agents should place an identified person at a defined decision point with enough context and authority to approve, reject, modify, pause, or escalate the action. + +A human-in-the-loop control is stronger when it specifies: + +- Which actions require review +- Who is authorized to review them +- What information the reviewer receives +- What approve, reject, and escalation decisions mean +- How long the agent may wait +- What happens when nobody responds +- How the decision and reviewer identity are logged +- How the organization tests that the control cannot be bypassed + +In Sim, the Human in the Loop block pauses a run and resumes it with submitted form fields. An approve-or-reject choice is a field, so a downstream Condition must evaluate that field and route the workflow accordingly. This design makes the decision point explicit instead of treating the pause itself as an approval. + +For a deeper treatment, see [What Is Human-in-the-Loop in AI Agents?](https://www.sim.ai/library/what-is-human-in-the-loop-in-ai-agents). + +## How can Sim support evidence for ISO 42001 and NIST AI RMF alignment? + +Sim can support an organization’s governance evidence through controlled access, audit records, human decision points, execution records, retention controls, and operational data exports, but Sim does not make an organization ISO/IEC 42001 certified or NIST AI RMF compliant. + +Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Sim Enterprise includes access control, access requests, audit logs, data retention, data drains, credential groups, and session policies under the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE). These capabilities can support evidence collection when the organization configures them within a documented governance process. + +| Governance need | How Sim can support it | Evidence to retain | +|---|---|---| +| Access governance | Sim Enterprise access control and access requests can separate authoring, administration, and approval responsibilities | Role assignments, access requests, approvals, periodic access-review records | +| Administrative accountability | Sim Enterprise audit logs can record relevant workspace activity | Audit-log exports, investigation records, retention configuration | +| Human oversight | Sim’s Human in the Loop block can pause a run, collect a reviewer’s decision, and pass the result to a downstream Condition | Reviewer identity, submitted fields, workflow route, execution record | +| Operational visibility | Sim execution records, Enterprise data drains, and retention controls can support centralized review and evidence preservation | Run records, exported events, alert records, retention settings | +| Credential governance | Sim Enterprise credential groups can support controlled credential access | Credential ownership, group membership, access-review and revocation records | +| Change governance | Teams can combine platform version records with release approvals, tests, and rollback procedures | Version identifier, change ticket, test results, approval, recovery test | + +Platform evidence is only one layer of an AI management system. Organizations also need policies, assigned accountability, impact assessments, legal analysis, workforce training, supplier governance, incident procedures, internal reviews, and corrective-action processes. + +Related implementation guides include [How Do Enterprises Build an Internal AI Agent Registry?](https://www.sim.ai/library/internal-ai-agent-registry-enterprise-guide) and [AI Agent Version Control and Rollback: Platforms, Process, and Enterprise Checklist](https://www.sim.ai/library/ai-agent-version-control-rollback-platforms). + +## What should you require from an AI agent platform vendor? + +An AI agent platform vendor should demonstrate how its controls create exportable evidence rather than relying on broad claims about enterprise readiness or compliance. + +Require the vendor to demonstrate: + +- A complete inventory of deployed agents and responsible owners +- Roles that separate building, administration, approval, and deployment where required +- Credential scoping, rotation, revocation, and ownership +- Logs for administrative events and relevant agent executions +- Human-approval steps that cannot be bypassed by an unreviewed route +- Version identification and reviewable change history +- Tested rollback or recovery procedures +- Monitoring and export options for security and operations teams +- Configurable retention aligned with legal and audit requirements +- Incident investigation and evidence-preservation workflows +- Documentation for hosting, subprocessors, data handling, and deletion +- Clear boundaries between platform controls and customer responsibilities + +The proof of concept should test these controls directly. Ask Sim, n8n, and any other shortlisted platform to perform the same governance scenarios, then compare the evidence each platform exports rather than comparing feature labels alone. + +Useful scenarios include attempting an unauthorized deployment, revoking a credential, requiring approval for a high-impact action, tracing a failed run, changing a model or tool, restoring a prior version, exporting audit evidence, and decommissioning an agent. + +For broader platform security and deployment requirements, see [Enterprise AI Agent Compliance and Deployment Guide: HIPAA, GDPR, Data Residency, On-Prem, and VPC](https://www.sim.ai/library/enterprise-ai-agent-compliance-deployment-guide) and [AI Agent Identity, Credential Management, and Audit Trails: Enterprise Guide](https://www.sim.ai/library/ai-agent-identity-credentials-audit-trails-enterprise-guide). + +## How should organizations implement this mapping? + +Organizations should implement the ISO/IEC 42001 and NIST AI RMF mapping as a lifecycle process that begins with scope and ownership, then adds controls according to agent risk. + +1. Inventory every production agent and assign accountable owners. +2. Define risk tiers using autonomy, data sensitivity, affected parties, action impact, and reversibility. +3. Map required controls and evidence to each risk tier. +4. Assess every agent before deployment and after material changes. +5. Configure access, credentials, approvals, logging, retention, and monitoring. +6. Test both the agent and its governance controls. +7. Review evidence periodically and after incidents or significant changes. +8. Track exceptions with an owner, rationale, compensating controls, and expiration date. +9. Retire agents through a documented process that revokes access and preserves required records. + +The result should be a living control system, not a one-time spreadsheet. Agent inventories, risks, models, tools, permissions, and operating conditions change, so the evidence must change with them. diff --git a/apps/sim/content/library/n8n-alternatives/index.mdx b/apps/sim/content/library/n8n-alternatives/index.mdx index 3a7351e440e..6af3de3da4b 100644 --- a/apps/sim/content/library/n8n-alternatives/index.mdx +++ b/apps/sim/content/library/n8n-alternatives/index.mdx @@ -1,86 +1,84 @@ --- slug: n8n-alternatives -title: '12 Best n8n Alternatives and Competitors for AI Agents in 2026' -description: 'The 12 best n8n alternatives and competitors in 2026 for AI agent workflows, compared on pricing, license, and hosting: Sim, Dify, Activepieces, Make, Zapier, and more.' -seoTitle: 'n8n Alternatives: 12 Best n8n Competitors in 2026' -seoDescription: 'The 12 best n8n alternatives and competitors for 2026, compared on pricing, free plans, license, and self-hosting: Sim, Dify, Activepieces, Make, Zapier.' +title: '14 n8n Alternatives and Competitors: Choosing an n8n Alternative in 2026' +description: 'Compare 14 n8n alternatives and n8n competitors for AI agents, pricing, licensing, managed cloud, and self-hosting in 2026.' +seoTitle: 'n8n Alternatives: 14 Competitors for AI Agents' +seoDescription: 'Compare 14 n8n alternatives and competitors for AI agents, pricing, licensing, managed cloud, and self-hosting in 2026.' date: 2026-07-13 -updated: 2026-10-20 +updated: 2026-11-23 authors: - andrew -readingTime: 17 +readingTime: 25 tags: [n8n Alternatives, Workflow Automation, AI Agents, Sim] ogImage: /library/n8n-alternatives/cover.jpg draft: false faq: - - q: "What is the best free alternative to n8n?" - a: "It depends on whether you want free software to self-host or a free managed plan: Sim's Apache 2.0 core and Activepieces' MIT-licensed Community Edition can be self-hosted without a license fee, while Sim Cloud, Make, Zapier, and Activepieces Cloud offer free hosted plans with usage limits. Build one representative workflow on each to see whether the limits fit." - q: "Which n8n alternative is best for AI agent workflows?" a: "Sim is a strong fit for general-purpose visual AI agent workflows, Dify for LLM applications built on retrieval, Gumloop for non-developers building LLM workflows, and Botpress for conversational agents. Match the platform to the agent's job to reduce the orchestration you must build yourself." - - q: "Is Make better than n8n?" - a: "Make suits teams that want managed infrastructure and detailed visual debugging, while n8n suits developers who want self-hosting and code-level control. Build the same workflow in both to compare editing, debugging, and pricing." - q: "What is the best open-source n8n alternative?" a: "Sim's core is licensed under the OSI-approved Apache 2.0 license and Activepieces' Community Edition is MIT-licensed, while both keep enterprise features under separate commercial terms. Node-RED is another option for event-driven and hardware-connected flows." + - q: "What should I look for in an n8n alternative?" + a: "Evaluate workflow capabilities, integrations, debugging, deployment and self-hosting options, licensing, governance, and total operating cost at your expected volume." + - q: "What is the best n8n alternative?" + a: "For teams whose main job is building AI agents, Sim is a strong fit because it combines a visual builder, model choice, human approval, an Apache 2.0 core, and managed or self-hosted deployment. For plain SaaS automation, Make or Zapier may fit better." + - q: "Is Sim better than n8n for AI agents?" + a: "Sim is better suited to teams whose primary job is building, deploying, and managing model-driven AI agents, while n8n remains a strong option when AI is one component of broad, extensible workflow automation." + - q: "What is the best free alternative to n8n?" + a: "Sim, Activepieces, and other alternatives differ depending on whether you want free software to self-host or a free managed plan: Sim's Apache 2.0 core and Activepieces' MIT-licensed Community Edition can be self-hosted without a license fee, while Sim Cloud, Make, Zapier, and Activepieces Cloud offer free hosted plans with usage limits. Build one representative workflow on each to see whether the limits fit." + - q: "Is Make better than n8n?" + a: "Make suits teams that want managed infrastructure and detailed visual debugging, while n8n suits developers who want self-hosting and code-level control. Build the same workflow in both to compare editing, debugging, and pricing." - q: "How hard is it to migrate from n8n to another tool?" - a: "An n8n migration means rebuilding workflows, credentials, error handling, and operational checks in the new platform, and effort grows with the number of workflows and custom code steps. Inventory dependencies and move one representative workflow first before estimating the rest." + a: "n8n migrations mean rebuilding workflows, credentials, error handling, and operational checks in the new platform, and effort grows with the number of workflows and custom code steps. Inventory dependencies and move one representative workflow first before estimating the rest." - q: "What is an AI agent workflow builder?" a: "An AI agent workflow builder is a platform for creating workflows in which AI models interpret context, choose actions, call tools, branch, and complete multi-step tasks." - q: "Can n8n build AI agents?" - a: "Yes. n8n can build AI agents by connecting models with tools, data sources, application integrations, workflow logic, and execution controls through its AI Agent node." + a: "n8n can build AI agents by connecting models with tools, data sources, application integrations, workflow logic, and execution controls through its AI Agent node." - q: "Is n8n open source?" - a: "No. n8n is source-available under its Sustainable Use License, a fair-code license that limits use to internal business, non-commercial, or personal purposes, so it does not meet the Open Source Initiative's definition." + a: "n8n is source-available under its Sustainable Use License, a fair-code license that limits use to internal business, non-commercial, or personal purposes, so it does not meet the Open Source Initiative's definition." - q: "Is Sim free?" a: "Sim's core can be self-hosted under Apache 2.0 without a software license fee, and Sim Cloud has a Free plan with 1,000 one-time credits alongside paid Pro, Max, and Enterprise plans. Code in apps/sim/ee has separate enterprise terms." - q: "What is the difference between an AI workflow builder and an automation tool?" a: "An AI workflow builder centers workflows on model reasoning and tool use, while an automation tool typically centers them on predefined triggers, actions, data movement, and deterministic rules." - q: "What should I test before replacing n8n?" - a: "Reproduce a real production workflow with its required integrations, model and tool calls, failure handling, human approval, execution inspection, and the deployment method you intend to use." + a: "An n8n replacement should be tested with a real production workflow, including its required integrations, model and tool calls, failure handling, human approval, execution inspection, and intended deployment method." - q: "Is Sim a drop-in replacement for n8n?" - a: "No. Sim is not a drop-in replacement for every n8n workflow because triggers, integrations, credentials, and execution behavior must be evaluated and migrated individually." - - q: "What should I look for in an n8n alternative?" - a: "Evaluate workflow capabilities, integrations, debugging, deployment and self-hosting options, licensing, governance, and total operating cost at your expected volume." + a: "Sim is not a drop-in replacement for every n8n workflow because triggers, integrations, credentials, and execution behavior must be evaluated and migrated individually." - q: "Which n8n alternative should I choose if I need self-hosting?" a: "Sim is a strong self-hosted fit for AI agent workflows when an Apache 2.0 core matters, and self-hosted Sim can connect to local model servers; Activepieces fits MIT-licensed trigger-action automation. Account separately for enterprise-licensed code in both." - q: "Which n8n alternative should I choose if I need human approval steps?" - a: "Choose a platform with explicit human-in-the-loop controls when an AI workflow can trigger consequential or irreversible actions, and test the approval path before deployment." + a: "An n8n alternative should provide explicit human-in-the-loop controls when an AI workflow can trigger consequential or irreversible actions, and test the approval path before deployment." - q: "Do AI agent workflow builders replace traditional automation tools?" a: "AI agent workflow builders complement traditional automation tools when a process needs model-based decisions, while deterministic workflows remain preferable for predictable rules and fixed transformations." - - q: "What is the best n8n alternative?" - a: "For teams whose main job is building AI agents, Sim is a strong fit because it combines a visual builder, model choice, human approval, an Apache 2.0 core, and managed or self-hosted deployment. For plain SaaS automation, Make or Zapier may fit better." - - q: "What is the best n8n alternative for teams that don't want to self host?" - a: "Sim Cloud is a good fit for teams that want managed AI agent infrastructure without operating the deployment, while Make and Zapier fit managed SaaS automation." - q: "What does n8n's fair-code license allow?" a: "n8n's Sustainable Use License allows use and modification for your own internal business purposes or for non-commercial or personal use, and allows distribution only free of charge for non-commercial purposes. Check your exact use against the license text." - q: "Is Sim open source?" a: "Sim's core is open source under Apache 2.0, while code in apps/sim/ee is governed by the separate Sim Enterprise License and requires an active Enterprise subscription for production use." - q: "Can Sim be self-hosted?" - a: "Yes. Anyone can self-host Sim's Apache 2.0 core with Docker Compose or Kubernetes, while production use of features in apps/sim/ee requires an active Sim Enterprise subscription." + a: "Sim's Apache 2.0 core can be self-hosted with Docker Compose or Kubernetes, while production use of features in apps/sim/ee requires an active Sim Enterprise subscription." - q: "Can Sim use local models when self-hosted?" - a: "Yes. Sim can connect to Ollama, vLLM, LM Studio, or LiteLLM on any self-hosted deployment, and local models do not require Sim Enterprise." + a: "Sim can connect to Ollama, vLLM, LM Studio, or LiteLLM on any self-hosted deployment, and local models do not require Sim Enterprise." - q: "Does Sim support bring your own model keys?" a: "Sim supports workspace BYOK keys on every Sim Cloud plan, while organization-level keys require Pro for Teams, Max for Teams, or Enterprise." - - q: "Is Sim better than n8n for AI agents?" - a: "Sim is better suited to teams whose primary job is building, deploying, and managing model-driven AI agents, while n8n remains a strong option when AI is one component of broad, extensible workflow automation." - q: "Is n8n better than Zapier?" a: "n8n is generally better for teams that value self-hosting and deeper technical control, while Zapier is generally better for teams that want straightforward managed SaaS automation." - q: "Is Sim better than Zapier for AI agents?" a: "Sim is better suited to building and managing multi-step AI agents, while Zapier is better suited to straightforward managed automation across a very large catalog of business apps." - q: "Do I need to self host an n8n alternative?" - a: "No. A managed service is enough when it meets your security, cost, governance, and data-handling requirements." + a: "Managed n8n alternatives are sufficient when they meet your security, cost, governance, and data-handling requirements." - q: "Is self-hosting cheaper than managed hosting?" - a: "Not automatically, because infrastructure, security patches, upgrades, monitoring, backups, and engineering time all belong in the total cost." + a: "Self-hosting is not automatically cheaper because infrastructure, security patches, upgrades, monitoring, backups, and engineering time all belong in the total cost." - q: "Can I migrate n8n workflows to Sim?" - a: "Yes, but plan to rebuild and test each workflow: recreate its triggers, credentials, transformations, tool calls, branches, retries, and approval logic in Sim, then validate the output before cutover." + a: "Sim migrations require rebuilding and testing each workflow: recreate its triggers, credentials, transformations, tool calls, branches, retries, and approval logic in Sim, then validate the output before cutover." - q: "Does Sim support human approval workflows?" - a: "Yes. Sim's Human in the Loop block pauses a run and resumes it with submitted form fields, and a downstream Condition evaluates the response." + a: "Sim's Human in the Loop block pauses a run and resumes it with submitted form fields, and a downstream Condition evaluates the response." - q: "Do Sim Guardrails automatically stop a workflow?" - a: "No. The Guardrails block reports passed or failed, and a downstream Condition must route that result if the workflow should stop or take a different path." + a: "Sim's Guardrails block reports passed or failed, and a downstream Condition must route that result if the workflow should stop or take a different path." - q: "Which guide compares Sim, n8n, and OpenAI AgentKit?" a: "Sim vs n8n vs OpenAI AgentKit: AI Agent Builder Comparison (2026) compares the three products directly." - q: "Which guide compares self-hosted AI workflow platforms?" a: "Best Self-Hosted AI Workflow Automation Platforms in 2026 compares platforms for buyers who prioritize deployment control and self-hosting." - q: "Which guide explains Apache 2.0 versus fair-code licensing?" - a: "Apache 2.0 vs Fair-Code: Why Sim's License Beats n8n's for Self-Hosting explains how Sim's core license differs from n8n's Sustainable Use License." + a: "Apache 2.0 vs Fair-Code: Why Sim's Core License Differs From n8n's for Self Hosting explains how Sim's core license differs from n8n's Sustainable Use License." - q: "What is the difference between Sim and n8n?" a: "Sim is the open-source AI workspace for building, deploying, and managing AI agents, while n8n is a source-available workflow automation product centered on connecting applications, APIs, and data flows." - q: "Which n8n alternative supports local AI models?" @@ -98,12 +96,12 @@ faq: - q: "Which n8n alternative has the most integrations?" a: "Zapier lists 9,000+ apps and Make 3,000+, and Workato's site cites 14,000+ apps, while Sim's 270+ integrations focus on orchestrating AI agents with tools and APIs rather than maximizing connector count." - q: "Which n8n alternative is cheapest?" - a: "None is universally cheapest because Sim, n8n, Zapier, Make, Dify, and the others bill against different units, and self-hosting shifts cost toward infrastructure and operations." + a: "n8n alternatives do not have one universally cheapest option because Sim, n8n, Zapier, Make, Dify, and the others bill against different units, and self-hosting shifts cost toward infrastructure and operations." --- -The best n8n alternatives in 2026 are Sim for AI agent workflows, Dify for LLM applications, Activepieces for MIT-licensed self-hosting, Make and Zapier for managed SaaS automation, and LangGraph or CrewAI for code-first agents. This guide is published by Sim, and Sim is one of the 12 n8n competitors covered, so each entry, including Sim, lists real limitations and links its sources. +The best n8n alternatives depend on the workload: Sim fits visual AI agent workflows, Dify and Langflow fit LLM applications, Activepieces and Node-RED fit permissively licensed self-hosting, Make and Zapier fit managed application automation, and LangGraph or CrewAI fit code-first agents. This guide compares 14 n8n competitors, and every profile lists limitations and official sources. -Sim, the open-source AI workspace for building, deploying, and managing AI agents, is a strong fit when your n8n workflows are turning into AI agent workflows. n8n remains a strong choice for technical workflow automation. The difference is focus: n8n is broad automation with AI steps inside it, while Sim puts building, deploying, and managing agents at the center, visually, conversationally, or with code. +Sim, the open-source AI workspace for building, deploying, and managing AI agents, fits teams whose n8n workflows are becoming AI agent workflows. n8n remains a strong choice for technical workflow automation. The difference is focus: n8n covers broad automation with AI steps, while Sim puts building, deploying, and managing agents at the center through a visual builder, Chat, or code. > **Choose n8n when** your workflows are mostly deterministic app-to-app automation, your team already runs a reliable n8n estate, and the [Sustainable Use License](https://docs.n8n.io/privacy-and-security/sustainable-use-license/) fits your use. > @@ -115,7 +113,7 @@ For a feature-by-feature breakdown of the two products, see [Sim vs n8n](https:/ ## What should you look for in an n8n alternative? -Look at the operating requirements of the whole AI agent workflow, not at integration counts alone. Teams usually start looking for n8n alternatives for three reasons: +An n8n alternative should be evaluated against the operating requirements of the whole AI agent workflow, not integration counts alone. Teams usually start looking for n8n alternatives for three reasons: - **Self-hosting overhead.** Running n8n yourself means provisioning compute and a database, applying security and version updates, and maintaining backups, TLS certificates, and uptime monitoring. - **Execution-based pricing.** [n8n Cloud](https://n8n.io/pricing/) prices plans by monthly workflow executions "regardless of complexity", so high-frequency triggers can push you into a larger plan. @@ -132,15 +130,53 @@ Use these criteria to compare the alternatives below: - **License:** Is the software OSI-approved open source, source-available, or proprietary? - **Operational fit:** Is it built for AI agent development, general business automation, or code-first orchestration? -## What are the 12 best n8n alternatives in 2026? +## Best n8n alternatives for teams that don't want to self-host + +[Sim Cloud](https://www.sim.ai/pricing), [Zapier](https://zapier.com/pricing), [Make](https://www.make.com/en/pricing), [Gumloop](https://www.gumloop.com/pricing), [Workato](https://www.workato.com/free), [Microsoft Power Automate](https://www.microsoft.com/en-us/power-platform/products/power-automate/pricing), [Botpress](https://botpress.com/pricing), [Dify Cloud](https://dify.ai/pricing/dify-cloud), and hosted [CrewAI](https://crewai.com/pricing) or [LangSmith](https://www.langchain.com/pricing) services fit teams that do not want to operate the full platform themselves. Sim Cloud preserves a path to self-hosting if requirements change, and [workspace BYOK keys are available on every Sim Cloud plan](https://docs.sim.ai/platform/costs#bring-your-own-key-byok), while organization-level keys require Pro for Teams, Max for Teams, or Enterprise. + +Managed-service buyers should compare identity controls, credential management, execution history, model access, human review, support, and billing units. Make and Zapier focus on managed application automation, Gumloop focuses on managed AI automation, and Workato or Microsoft Power Automate fit organizations with enterprise integration or Microsoft ecosystem requirements. + +## What's a good n8n alternative for building AI agents? + +Sim is a good n8n alternative for visual AI agent workflows because it combines model choice, tool connections, deployment, and run management in one open-source AI workspace. [Self-hosted Sim](https://docs.sim.ai/platform/self-hosting) can connect to Ollama, vLLM, LM Studio, or LiteLLM without requiring Sim Enterprise. + +[Dify](https://dify.ai/pricing) fits teams focused on LLM applications and retrieval, [Langflow](https://www.langflow.org/) fits visual composition of models and retrieval components, and [LangGraph](https://www.langchain.com/pricing) or [CrewAI](https://crewai.com/pricing) fit developers who want agent behavior in code. For a direct product comparison, see [Sim versus n8n](https://www.sim.ai/comparisons/n8n). + +## n8n alternative that handles ai agents better + +Sim fits teams whose primary job is coordinating models, tools, structured logic, and human input, while n8n fits broad application automation that includes AI steps. Sim's Guardrails block reports passed or failed for a downstream Condition to route, and Human in the Loop pauses a run and resumes it with submitted form fields for downstream logic to evaluate. + +n8n remains a capable choice when a team already has extensive n8n workflows or mainly needs deterministic application integration. Teams should test the same agent workflow in each platform rather than assuming that one product fits every workload. + +## What should teams leaving n8n Cloud compare? -The 12 are Sim, Dify, Activepieces, LangGraph, Make, CrewAI, Zapier, Microsoft Power Automate, Botpress, Workato, Gumloop, and Lindy. n8n is the baseline, not one of the 12. Prices below were checked on vendor pages on October 20, 2026. +n8n Cloud customers should compare workflow fit, managed operations, migration effort, billing, and governance before switching. Inventory triggers, credentials, custom code, community nodes, model calls, execution volume, retry behavior, and approval steps because no alternative reproduces every n8n workflow automatically. + +A team leaving n8n Cloud should answer five questions: + +1. Does the replacement provide every essential trigger and action? +2. Can credentials be moved without exposing secrets? +3. Will custom JavaScript or Python need to be rewritten? +4. How does the platform count executions, tasks, credits, or other usage? +5. Can the team test failure handling and output quality before switching production traffic? + +As of November 2026, n8n publishes cloud plan prices and execution allowances on its [official pricing page](https://n8n.io/pricing/). Compare current figures using the same workflow volume and retry assumptions instead of comparing entry prices alone. + +## n8n is fair-code and has license restrictions, what open source options are truly permissive + +Sim core and Node-RED are permissively licensed under Apache 2.0, while Activepieces Community Edition, LangGraph, and CrewAI use the MIT license. n8n describes its Sustainable Use License as fair code in its [community license documentation](https://docs.n8n.io/n8n-community-license), and the license is source available rather than OSI approved open source. + +[Sim core uses Apache 2.0](https://github.com/simstudioai/sim/blob/main/LICENSE). Code in `apps/sim/ee` uses the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE), is free for development, testing, and internal nonproduction use, and requires an active Sim Enterprise subscription for production use; modification and redistribution are not permitted. For more detail, read [Apache 2.0 vs Fair Code: Why Sim's Core License Differs From n8n's for Self Hosting](https://www.sim.ai/library/apache-2-0-vs-fair-code). + +## What are the 14 best n8n alternatives in 2026? + +The 14 alternatives are Sim, Dify, Activepieces, Langflow, LangGraph, Make, CrewAI, Zapier, Microsoft Power Automate, Botpress, Workato, Gumloop, Lindy, and Node-RED. n8n is the baseline, not one of the 14. Prices below were checked on official vendor pages in November 2026. ### 1. Sim Sim, the open-source AI workspace for building, deploying, and managing AI agents, is a strong fit for teams that want visual AI agent workflows with flexible hosting. Where n8n treats AI as one node type in a broad automation tool, Sim is built around agents, knowledge bases, tables, and multi-model routing. -**Best for:** Teams building AI agent workflows that need multi-model orchestration, memory, human approval, and real-time collaboration. +**Fits:** Teams building AI agent workflows that need multi-model orchestration, memory, human approval, and real-time collaboration. **Pricing:** The Free plan includes 1,000 one-time credits (worth $5 on Sim Cloud). Pro is $25 per user per month, Max is $100 per user per month, and Enterprise is custom, all on [credit-based billing](https://www.sim.ai/pricing). [Workspace BYOK keys work on every Sim Cloud plan](https://docs.sim.ai/platform/costs#bring-your-own-key-byok). Self-hosting the core carries no license fee. @@ -159,7 +195,7 @@ Sim, the open-source AI workspace for building, deploying, and managing AI agent Dify is a strong n8n alternative when the main job is building LLM applications with prompts, retrieval, datasets, and agent behavior. Compared with Sim, Dify centers on LLM apps and knowledge retrieval, while Sim covers broader agent workflows across 270+ integrations. -**Best for:** Teams centered on LLM applications and retrieval that want managed or self-hosted deployment. +**Fits:** Teams centered on LLM applications and retrieval that want managed or self-hosted deployment. **Pricing:** Dify Cloud has a free Sandbox plan with 200 message credits. [Professional is $59 per workspace per month and Team is $159 per workspace per month](https://dify.ai/pricing/dify-cloud), with discounts for annual billing ($590 and $1,590 per workspace per year). @@ -177,9 +213,9 @@ Dify is a strong n8n alternative when the main job is building LLM applications Activepieces is a strong pick for teams that want visual trigger-and-action automation with an MIT-licensed self-hosted option. Compared with Sim, Activepieces maps more closely to n8n's trigger-action model, while Sim is the better fit when the workflow is an AI agent. -**Best for:** Teams that want a self-hostable n8n alternative under a permissive license, plus cloud plans with published allowances. +**Fits:** Teams that want a self-hostable n8n alternative under a permissive license, plus cloud plans with published allowances. -**Pricing:** [Activepieces Cloud](https://www.activepieces.com/pricing) has a Free plan with 1,000 credits a month for up to five users, Plus at $20 flat per month (10,000 credits a month), Team at $200 flat per month with 25 users, and a sales-led Ultimate plan. Usage over the allowance costs $0.007 per credit on Plus and Team. The self-hosted Community Edition has no license fee. +**Pricing:** [Activepieces Cloud](https://www.activepieces.com/pricing) has a Free plan with 1,000 credits a month, and its current pricing page advertises paid access from $16 per month. The self-hosted Community Edition has no license fee, while enterprise and cloud-edition features use commercial terms. **Strengths:** @@ -191,11 +227,29 @@ Activepieces is a strong pick for teams that want visual trigger-and-action auto **Sources:** [Activepieces pricing](https://www.activepieces.com/pricing), [Activepieces license](https://www.activepieces.com/docs/about/license). -### 4. LangGraph +### 4. Langflow + +Langflow fits teams that want a visual environment for composing models, retrieval components, tools, agents, and MCP servers. Compared with Sim, Langflow is oriented toward developer-built AI applications, while Sim combines agent building with broader workspace and run-management features. + +**Fits:** Developers prototyping and deploying visual agent and retrieval flows. + +**Pricing:** The [Langflow project](https://www.langflow.org/) can be self-hosted, so teams pay for their own infrastructure and model usage. Managed deployment costs depend on the service used to host it. + +**Strengths:** + +- **Visual AI composition:** Drag-and-drop flows connect models, vector databases (databases that find related information by meaning), tools, and custom Python components. +- **Deployment choice:** The [deployment documentation](https://docs.langflow.org/deployment-overview) covers local, containerized, and remote self-hosting options. +- **Developer control:** Python components support customization beyond the visual flow. + +**Limitations:** Langflow is not a replacement for every conventional trigger-action automation, and production teams still need to plan hosting, authentication, monitoring, and upgrades. + +**Sources:** [Langflow product](https://www.langflow.org/), [Langflow deployment](https://docs.langflow.org/deployment-overview). + +### 5. LangGraph LangGraph is a strong n8n alternative for software teams that want to define stateful agent execution in code. Compared with Sim, LangGraph gives engineers finer control, but the open-source framework has no shared visual builder for mixed teams. -**Best for:** Developers who want explicit control over agent state, nodes, transitions, and persistence. +**Fits:** Developers who want explicit control over agent state, nodes, transitions, and persistence. **Pricing:** The framework is free under the [MIT license](https://github.com/langchain-ai/langgraph/blob/main/LICENSE). LangSmith, the separate hosted service, lists a [Developer plan at $0 per seat and Plus at $39 per seat per month](https://www.langchain.com/pricing), both with pay-as-you-go usage, plus Enterprise. @@ -209,11 +263,11 @@ LangGraph is a strong n8n alternative for software teams that want to define sta **Sources:** [LangGraph license](https://github.com/langchain-ai/langgraph/blob/main/LICENSE), [LangSmith pricing](https://www.langchain.com/pricing), [Sim vs LangChain](https://www.sim.ai/comparisons/langchain). -### 5. Make (formerly Integromat) +### 6. Make (formerly Integromat) Make is a strong choice for teams that want managed visual automation with detailed control over deterministic scenarios. Compared with Sim, Make has a far larger app catalog, while Sim offers deeper agent orchestration and a self-hosting option. -**Best for:** Teams that want managed visual automation with detailed inspection of routes, filters, and intermediate values. +**Fits:** Teams that want managed visual automation with detailed inspection of routes, filters, and intermediate values. **Pricing:** [Make's pricing page](https://www.make.com/en/pricing) lists a Free plan with 1,000 credits a month and paid plans from $9 per month billed annually (Core) at 10,000 credits, followed by Pro and Teams. Each module action counts as one credit, and [some AI features use credits based on tokens](https://help.make.com/credits). @@ -227,11 +281,11 @@ Make is a strong choice for teams that want managed visual automation with detai **Sources:** [Make pricing](https://www.make.com/en/pricing), [Make credits](https://help.make.com/credits), [Sim vs Make](https://www.sim.ai/comparisons/make). -### 6. CrewAI +### 7. CrewAI CrewAI is a strong n8n alternative for Python developers designing systems around agents, tasks, crews, and flows. Compared with Sim, CrewAI is framework-first, with a visual Studio on its hosted platform, while Sim lets mixed teams build, deploy, and manage agents in one workspace. -**Best for:** Developer-led projects that represent multi-agent behavior in code, with an optional visual editor on the hosted platform. +**Fits:** Developer-led projects that represent multi-agent behavior in code, with an optional visual editor on the hosted platform. **Pricing:** The framework is [MIT-licensed](https://github.com/crewAIInc/crewAI/blob/main/LICENSE). The hosted platform has a [free Basic plan with Studio (visual editor) and 50 workflow executions a month, and a custom-priced Enterprise plan](https://crewai.com/pricing). Teams running the framework themselves pay for their own infrastructure and model usage. @@ -245,13 +299,13 @@ CrewAI is a strong n8n alternative for Python developers designing systems aroun **Sources:** [CrewAI pricing](https://crewai.com/pricing), [CrewAI license](https://github.com/crewAIInc/crewAI/blob/main/LICENSE), [Sim vs CrewAI](https://www.sim.ai/comparisons/crewai). -### 7. Zapier +### 8. Zapier Zapier is a strong pick for non-technical teams that prioritize fast setup and a very large managed integration catalog. Compared with Sim, Zapier connects more apps, while Sim gives more control over multi-step agent behavior and can be self-hosted. -**Best for:** Non-technical teams that need a broad app catalog and a fast path to a first working automation. +**Fits:** Non-technical teams that need a broad app catalog and a fast path to a first working automation. -**Pricing:** [Zapier](https://zapier.com/pricing) has a Free plan with 100 tasks per month, Professional from $19.99 per month billed annually ($29.99 billed monthly), Team from $69 per month billed annually ($103.50 billed monthly), and custom Enterprise pricing. Higher task tiers cost more. +**Pricing:** [Zapier](https://zapier.com/pricing) has a Free plan with 100 tasks per month, Professional from $19.99 per month billed annually, and custom pricing that varies by plan and task allowance. Higher task tiers cost more. **Strengths:** @@ -263,11 +317,11 @@ Zapier is a strong pick for non-technical teams that prioritize fast setup and a **Sources:** [Zapier pricing](https://zapier.com/pricing), [Zapier home](https://zapier.com/), [Sim vs Zapier](https://www.sim.ai/comparisons/zapier). -### 8. Microsoft Power Automate +### 9. Microsoft Power Automate Microsoft Power Automate is the natural pick for organizations standardized on Microsoft 365, Dynamics, Azure, and desktop automation. Compared with Sim, it reaches deeper into Microsoft systems and legacy desktops, while Sim is model-agnostic and not tied to one vendor's stack. -**Best for:** Organizations standardized on Microsoft 365, Dynamics, and the broader Microsoft ecosystem. +**Fits:** Organizations standardized on Microsoft 365, Dynamics, and the broader Microsoft ecosystem. **Pricing:** [Microsoft lists](https://www.microsoft.com/en-us/power-platform/products/power-automate/pricing) a 30-day free trial, Power Automate Premium at $15.00 per user per month, Power Automate Process at $150.00 per bot per month, and Hosted Process at $215.00 per bot per month, all paid yearly. @@ -281,11 +335,11 @@ Microsoft Power Automate is the natural pick for organizations standardized on M **Sources:** [Power Automate pricing](https://www.microsoft.com/en-us/power-platform/products/power-automate/pricing), [Sim vs Power Automate](https://www.sim.ai/comparisons/power-automate). -### 9. Botpress +### 10. Botpress Botpress is a strong pick for teams building conversational agents for support and sales across chat and voice. Compared with Sim, Botpress specializes in conversations, while Sim handles back-office and data workflows as well as chat agents. -**Best for:** Customer support bots, conversational sales agents, and multi-turn dialogue. +**Fits:** Customer support bots, conversational sales agents, and multi-turn dialogue. **Pricing:** [Botpress](https://botpress.com/pricing) has a Free plan with 100 conversations, Plus at $150 per month billed annually with 250 conversations a month, Team at $750 per month billed annually with 1,500 conversations a month, and custom Enterprise. AI usage is included on every plan. @@ -299,13 +353,13 @@ Botpress is a strong pick for teams building conversational agents for support a **Sources:** [Botpress pricing](https://botpress.com/pricing). -### 10. Workato +### 11. Workato Workato fits large organizations that need governed enterprise integration and contractual support. Compared with Sim, Workato brings enterprise connector depth (its site cites [14,000+ apps](https://www.workato.com/free)) and procurement-ready contracts, while Sim offers an open-source core and self-hosting. -**Best for:** Enterprise teams that need SLAs, compliance documentation, and governance controls. +**Fits:** Enterprise teams that need SLAs, compliance documentation, and governance controls. -**Pricing:** Workato uses [usage-based billing in Workato credits](https://docs.workato.com/en/pricing). [Self-service plans](https://docs.workato.com/en/pricing/self-service/self-service) include Workato Free with a one-time 50,000-credit grant and Workato Pro from $75 per month for 2,500 credits up to $1,275 per month for 50,000 credits. Enterprise editions are quoted by sales. +**Pricing:** Workato uses [usage-based billing in Workato credits](https://docs.workato.com/en/pricing). [Self-service documentation](https://docs.workato.com/en/pricing/self-service/self-service) lists Workato Free with a one-time 50,000-credit grant and Pro tiers from $75 per month for 2,500 credits up to $1,275 per month for 50,000 credits, while Workato's [current signup page](https://www.workato.com/free) advertises a $100 Pro option with 3,500 monthly credits. Enterprise editions are quoted by sales. **Strengths:** @@ -317,11 +371,11 @@ Workato fits large organizations that need governed enterprise integration and c **Sources:** [Workato billing docs](https://docs.workato.com/en/pricing), [Workato self-service plans](https://docs.workato.com/en/pricing/self-service/self-service), [Sim vs Workato](https://www.sim.ai/comparisons/workato). -### 11. Gumloop +### 12. Gumloop Gumloop fits non-developers assembling hosted, AI-powered business processes visually. Compared with Sim, Gumloop is hosted only and narrower on traditional connectors, while Sim adds self-hosting and Apache 2.0 licensing. -**Best for:** Non-developer teams building hosted AI agents; Gumloop now labels its older workflow builder as Legacy on its pricing page. +**Fits:** Non-developer teams building hosted AI agents; Gumloop now labels its older workflow builder as Legacy on its pricing page. **Pricing:** [Gumloop](https://www.gumloop.com/pricing) Pro starts at $37 per month after a 14-day free trial and includes 20,000 credits (7,400 plus 12,600 bonus). Credits are indexed at $0.005 each, and Enterprise is custom. @@ -335,11 +389,11 @@ Gumloop fits non-developers assembling hosted, AI-powered business processes vis **Sources:** [Gumloop pricing](https://www.gumloop.com/pricing), [Sim vs Gumloop](https://www.sim.ai/comparisons/gumloop). -### 12. Lindy +### 13. Lindy Lindy fits teams that want ready-made agents for defined email, meeting, and sales tasks. Compared with Sim, Lindy is quicker to start for those tasks, while Sim is more configurable for workflows that do not fit a template. -**Best for:** Less technical teams that want agents for email triage, meeting scheduling, and sales outreach with minimal setup. +**Fits:** Less technical teams that want agents for email triage, meeting scheduling, and sales outreach with minimal setup. **Pricing:** [Lindy](https://www.lindy.ai/pricing) starts new users with $50 in free credits that last 7 days, then bills every active user from $29.99 a month for 3,000 credits, though some visitors see $49.99 for 5,000 credits; its [billing docs](https://docs.lindy.ai/teammate/lindy-teammate-billing) describe seat-based Plus, Pro, and Max plans. @@ -353,28 +407,48 @@ Lindy fits teams that want ready-made agents for defined email, meeting, and sal **Sources:** [Lindy pricing](https://www.lindy.ai/pricing), [Lindy billing docs](https://docs.lindy.ai/teammate/lindy-teammate-billing). +### 14. Node-RED + +Node-RED fits technical teams that want event-driven flows on infrastructure they control. Compared with Sim, Node-RED provides a general low-code runtime for events and devices, while Sim centers model-driven AI agents and managed run operations. + +**Fits:** Engineering-led event processing, device integration, and edge automation. + +**Pricing:** Node-RED has no software license fee under its [Apache 2.0 license](https://nodered.org/about/license/), while teams pay for infrastructure and operations. + +**Strengths:** + +- **Permissive license:** Apache 2.0 permits commercial use, modification, and redistribution under its terms. +- **Self-hosting:** Official [getting-started documentation](https://nodered.org/docs/getting-started/) covers local, Docker, device, and cloud infrastructure deployments. +- **Event-oriented runtime:** Node.js and a large community node catalog support device, messaging, and data-flow use cases. + +**Limitations:** Node-RED does not provide a first-party managed platform equivalent to Sim Cloud or n8n Cloud, so teams own production hosting, security, upgrades, and monitoring. + +**Sources:** [Node-RED product](https://nodered.org/), [Node-RED license](https://nodered.org/about/license/), [Node-RED deployment](https://nodered.org/docs/getting-started/). + ## How do these n8n alternatives compare? -The list is ordered for AI agent workflows, set by the publisher; it is not a verdict on overall product quality. - -| # | Tool | Best fit | License and hosting | Entry paid price (Oct 2026) | -| --- | --- | --- | --- | --- | -| 1 | Sim | Visual AI agent workflows | Apache 2.0 core; cloud or self-hosted | Pro $25/user/mo | -| 2 | Dify | LLM apps and retrieval | Modified Apache 2.0; cloud or self-hosted | $59/workspace/mo | -| 3 | Activepieces | Open-source trigger-action automation | MIT core; cloud or self-hosted | $20/mo | -| 4 | LangGraph | Stateful agents in code | MIT framework; self-managed or LangSmith | LangSmith Plus $39/seat/mo | -| 5 | Make | Managed visual SaaS automation | Proprietary; cloud only | Core $9/mo billed annually | -| 6 | CrewAI | Multi-agent systems in code | MIT framework; hosted platform | Enterprise custom | -| 7 | Zapier | Simple SaaS automation | Proprietary; cloud only | $19.99/mo billed annually | -| 8 | Power Automate | Microsoft-centric organizations | Proprietary; cloud plus desktop | $15/user/mo | -| 9 | Botpress | Chat and voice agents | Proprietary; managed | $150/mo billed annually | -| 10 | Workato | Governed enterprise integration | Proprietary; managed | $75/mo | -| 11 | Gumloop | Hosted AI agents for non-developers | Proprietary; cloud only | $37/mo | -| 12 | Lindy | Template-led business agents | Proprietary; cloud only | $29.99 or $49.99/user/mo | +The 14 n8n alternatives in this decision table separate managed cloud from full-platform self-hosting so teams can filter by operating model before comparing workflow fit. The table follows the same sequence as the profiles for easier cross-reference. + +| Platform | Best fit | Managed cloud | Self hosting | License or distribution model | Entry paid price (Nov 2026) | +| --- | --- | --- | --- | --- | --- | +| [Sim](https://www.sim.ai/pricing) | Visual AI agent workflows | Yes | Yes | Apache 2.0 core; `apps/sim/ee` uses the Sim Enterprise License | Pro $25/user/mo | +| [Dify](https://dify.ai/pricing) | LLM apps and retrieval | Yes | Yes | Modified Apache 2.0 terms | $59/workspace/mo | +| [Activepieces](https://www.activepieces.com/pricing) | Trigger-action automation | Yes | Yes | MIT core; commercial enterprise features | From $16/mo | +| [Langflow](https://docs.langflow.org/deployment-overview) | Visual AI application composition | Available through managed hosting | Yes | Open-source project with separately operated hosting | Hosting dependent | +| [LangGraph](https://www.langchain.com/pricing) | Stateful agents in code | Yes, through LangSmith | Yes | MIT framework; commercial LangSmith service | LangSmith Plus $39/seat/mo | +| [Make](https://www.make.com/en/pricing) | Managed visual application automation | Yes | No | Proprietary service | Core $9/mo billed annually | +| [CrewAI](https://crewai.com/pricing) | Multi-agent systems in code | Yes | Yes | MIT framework; commercial platform | Enterprise custom | +| [Zapier](https://zapier.com/pricing) | Managed application automation | Yes | No | Proprietary service | $19.99/mo billed annually | +| [Microsoft Power Automate](https://www.microsoft.com/en-us/power-platform/products/power-automate/pricing) | Microsoft-centered automation | Yes | No full platform self-hosting | Proprietary service with desktop and gateway components | $15/user/mo | +| [Botpress](https://botpress.com/pricing) | Chat and voice agents | Yes | No | Proprietary service | $150/mo billed annually | +| [Workato](https://www.workato.com/pricing) | Governed enterprise integration | Yes | No full platform self-hosting | Proprietary service with on-premises connectivity agents | $75/mo self-service tier | +| [Gumloop](https://www.gumloop.com/pricing) | Hosted AI automation | Yes | No | Proprietary service | $37/mo | +| [Lindy](https://www.lindy.ai/pricing) | Template-led business agents | Yes | No | Proprietary service | $29.99 or $49.99/user/mo | +| [Node-RED](https://nodered.org/docs/getting-started/) | Engineering-led event flows | No first-party managed platform | Yes | Apache 2.0 | Infrastructure cost | ## How do n8n and Sim compare on licensing and pricing? -n8n is source-available but not open source, while Sim's core is OSI-approved open source under Apache 2.0. n8n states that it "uses the Sustainable Use License and n8n Enterprise License", which it describes as fair-code. Under the [license text](https://github.com/n8n-io/n8n/blob/master/LICENSE.md), you "may use or modify the software only for your own internal business purposes or for non-commercial or personal use", and may distribute it only "free of charge for non-commercial purposes". Files with `.ee.` in their name or `.ee` in their directory name need an n8n Enterprise License. Agencies, consultancies, and SaaS companies should get legal advice before offering n8n functionality to customers. For the clause-by-clause view, see [Apache 2.0 vs fair-code](https://www.sim.ai/library/apache-2-0-vs-fair-code). +n8n is source available but not OSI approved open source, while Sim's core is OSI-approved open source under Apache 2.0. n8n states in its [community license documentation](https://docs.n8n.io/n8n-community-license) that it uses the Sustainable Use License and n8n Enterprise License under a fair-code model. Under the [license text](https://github.com/n8n-io/n8n/blob/master/LICENSE.md), you "may use or modify the software only for your own internal business purposes or for non-commercial or personal use", and may distribute it only "free of charge for non-commercial purposes". Files with `.ee.` in their name or `.ee` in their directory name need an n8n Enterprise License. Agencies, consultancies, and SaaS companies should get legal advice before offering n8n functionality to customers. For the clause-by-clause view, see [Apache 2.0 vs fair-code](https://www.sim.ai/library/apache-2-0-vs-fair-code). [Sim's core is licensed under Apache 2.0](https://github.com/simstudioai/sim/blob/main/LICENSE), which anyone can self-host, modify, and redistribute. Code in `apps/sim/ee` is under the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE): production use requires an active Sim Enterprise subscription, and modification and redistribution are not permitted. Activepieces follows a similar split, with an MIT core and commercially licensed enterprise features. @@ -388,7 +462,7 @@ Before choosing any alternative, ask these licensing questions: 6. Do self-hosting rights change when the software is customer-facing? 7. Which entity and license version govern the code you deploy? -On price, [n8n's pricing page](https://n8n.io/pricing/) says "All plans include unlimited users & workflows and every integration" and bills on monthly executions. On October 20, 2026 it listed, in euros and billed annually: +On price, [n8n's pricing page](https://n8n.io/pricing/) says "All plans include unlimited users & workflows and every integration" and bills on monthly executions. As of November 2026, it lists these base allowances in euros and billed annually: | n8n plan | Price | Executions | | --- | --- | --- | @@ -410,22 +484,25 @@ Sim bills in credits instead of executions: Free (1,000 one-time credits), Pro $ ## How should you choose an n8n alternative? -Choose by the dominant workload and hosting model, not by whether a product has an AI label. A workflow that mostly moves data between SaaS apps with one model call has different needs from an agent that repeatedly picks tools, checks results, and asks for approval. +An n8n alternative should be chosen by the dominant workload and hosting model, not by whether a product has an AI label. A workflow that mostly moves data between SaaS apps with one model call has different needs from an agent that repeatedly picks tools, checks results, and asks for approval. - **Choose Sim if** AI agents, model flexibility, approvals, and a choice between managed and self-hosted deployment are the core requirements. -- **Choose Dify if** retrieval and LLM application development dominate. +- **Choose Dify or Langflow if** retrieval and visual LLM application development dominate. - **Choose Activepieces if** you want trigger-action automation under an MIT license you can self-host. - **Choose LangGraph or CrewAI if** developers want to own agent behavior in code. - **Choose Make if** you want managed visual automation with detailed scenario debugging. - **Choose Zapier if** you want a fast managed setup across a very large app catalog. - **Choose Power Automate if** the organization runs on Microsoft 365 and Azure. -- **Choose Botpress, Workato, Gumloop, or Lindy if** you need conversational agents, governed enterprise integration, no-code LLM workflows, or template-led business agents respectively. +- **Choose Botpress, Workato, Gumloop, or Lindy if** you need conversational agents, governed enterprise integration, managed AI automation, or template-led business agents respectively. +- **Choose Node-RED if** you need engineering-led event flows under Apache 2.0 and can operate the runtime yourself. - **Stay with n8n if** current workflows are reliable, the license fits your use, and migration would not add enough AI agent benefit to justify its cost. Before switching, build the same representative workflow in two or three candidates. Include at least one model call, one tool call, one conditional branch, one failure or retry, and one human approval so the test shows operational differences. Then migrate gradually: inventory triggers, credentials, API calls, transformations, retries, and approval steps; rebuild one workflow; test it with production-like inputs; compare output and operating cost; and retire the original only after the new one runs cleanly. Sim, Make, Zapier, Activepieces, and Dify all have free tiers that can cover a first test. ## What should you read next? +Sim's related comparisons and library guides cover narrower licensing, deployment, and product-selection questions: + - [Sim vs n8n](https://www.sim.ai/comparisons/n8n): features, pricing, security, and deployment side by side. - [Sim vs n8n vs OpenAI AgentKit](https://www.sim.ai/library/openai-vs-n8n-vs-sim): agent-first, automation-first, and OpenAI-native architectures compared. - [Apache 2.0 vs fair-code](https://www.sim.ai/library/apache-2-0-vs-fair-code): what each license allows for self-hosting and commercial products. diff --git a/apps/sim/content/library/n8n-pricing-cloud-self-hosted-enterprise/index.mdx b/apps/sim/content/library/n8n-pricing-cloud-self-hosted-enterprise/index.mdx new file mode 100644 index 00000000000..ef07f43defd --- /dev/null +++ b/apps/sim/content/library/n8n-pricing-cloud-self-hosted-enterprise/index.mdx @@ -0,0 +1,126 @@ +--- +slug: n8n-pricing-cloud-self-hosted-enterprise +title: 'n8n Pricing: Cloud, Self-Hosted, and Enterprise Costs Explained' +description: 'Compare n8n Cloud, self-hosted, and Enterprise pricing, execution limits, licensing, infrastructure costs, and where Sim fits.' +seoTitle: 'n8n Pricing: Cloud, Self-Hosted & Enterprise' +date: 2026-11-24 +updated: 2026-11-24 +authors: + - andrew +readingTime: 7 +tags: [n8n, Pricing, Self-Hosting, AI Agents, Sim] +ogImage: /library/n8n-pricing-cloud-self-hosted-enterprise/cover.jpg +draft: false +faq: + - q: "Is n8n free?" + a: "n8n Community Edition can be self-hosted without a subscription fee when the intended use complies with the Sustainable Use License, but infrastructure, maintenance, external APIs, and employee time still cost money. As of November 2026, n8n’s managed Cloud service starts at €20 per month when billed annually." + - q: "Is n8n open source?" + a: "n8n is source-available under the Sustainable Use License, not open source under an OSI-approved license. The license permits many internal and noncommercial uses but imposes restrictions that permissive licenses such as Apache 2.0 do not." + - q: "What counts as an n8n execution?" + a: "n8n counts one execution when a workflow runs, regardless of how many standard steps the workflow contains. As of November 2026, execution allowances are a primary difference among n8n plans, although special workflow structures and product terms should be checked against n8n’s current documentation." + - q: "Does n8n charge per user?" + a: "n8n advertises unlimited users across its public plans as of November 2026, so the main published meter is workflow executions rather than seats. Enterprise identity, governance, and administration requirements can still affect which plan a team needs." + - q: "Does n8n charge for failed executions?" + a: "A failed production run is still a workflow execution, so teams should include failures and retries when forecasting monthly execution volume. Current billing terms should be checked for the team’s specific plan and workflow structure." + - q: "Which n8n plan includes SSO?" + a: "n8n includes SSO in its self-hosted Business and custom Enterprise offerings as of November 2026, while Starter and Pro do not include it. Teams should confirm the supported identity protocol and deployment model in their current n8n terms." + - q: "How much does n8n Enterprise cost?" + a: "n8n Enterprise uses custom pricing as of November 2026. The quote depends on factors such as execution volume, hosting model, scaling, security controls, support, and negotiated commercial terms." + - q: "n8n is fair code and has license restrictions, what open source options are truly permissive" + a: "Sim’s core is a permissively licensed alternative because it uses the OSI-approved Apache 2.0 license. Sim’s enterprise directory is a documented exception under the separate Sim Enterprise License, so buyers should distinguish the Apache-licensed core from enterprise-only production features." +--- + +n8n starts at €20 per month for Starter and €50 per month for Pro when billed annually, while the self-hosted Business plan starts at €667 per month and Enterprise uses custom pricing. As of November 2026, [n8n bases these plans primarily on monthly workflow executions](https://n8n.io/pricing/) rather than workflow steps. + +## TL;DR + +- **n8n Cloud:** [Starter costs €20 per month and Pro costs €50 per month](https://n8n.io/pricing/) when billed annually as of November 2026. Pricing is based primarily on monthly workflow executions. +- **Self-hosted n8n:** Community Edition has no subscription fee for uses allowed by the [Sustainable Use License](https://docs.n8n.io/n8n-community-license/), while the Business plan starts at €667 per month when billed annually, before infrastructure and operations costs. +- **n8n Enterprise:** Pricing is custom for Cloud or self-hosted deployments, with terms based on deployment, scale, security, support, and commercial requirements. +- **Sim:** Sim is the open-source AI workspace. [Sim’s core is licensed under Apache 2.0](https://github.com/simstudioai/sim/blob/main/LICENSE), while [apps/sim/ee is governed by the separate Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE). Self-hosted Sim can use local models, and workspace bring your own key (BYOK), which lets teams use their own model-provider keys, is available on every Sim Cloud plan. + +## What are the key n8n and Sim pricing facts at a glance? + +n8n and Sim differ most clearly in their billing models, self-hosting costs, and software licenses. + +- **n8n:** As of November 2026, [n8n offers hosted Cloud plans, a paid self-hosted Business plan, and quote-based Enterprise deployment](https://n8n.io/pricing/). Plans are primarily metered by monthly workflow executions. n8n is distributed under its source-available Sustainable Use License, which does not appear on the [OSI list of approved licenses](https://opensource.org/licenses). +- **Sim:** Sim is the open-source AI workspace, and [Sim’s core is licensed under Apache 2.0](https://github.com/simstudioai/sim/blob/main/LICENSE), while [apps/sim/ee is governed by the separate Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE). Self-hosted Sim can use local models, and workspace BYOK is available on every Sim Cloud plan. + +## How do n8n Cloud, self-hosted, and Enterprise plans compare? + +[n8n offers two public Cloud tiers, one public paid self-hosted tier, and a custom Enterprise tier](https://n8n.io/pricing/) as of November 2026. + +The following prices and limits come from [n8n’s official pricing page](https://n8n.io/pricing/) and reflect its public euro pricing for annual billing as of November 2026. Local currency, taxes, monthly billing, add-ons, and negotiated terms can change the total. + +| n8n plan | Hosting | Starting price | Included executions per month | Active workflows | Users | Single sign-on (SSO) | Notable features | +|---|---|---:|---:|---:|---:|---|---| +| Starter | n8n Cloud | €20/month, billed annually | 2,500 | Unlimited | Unlimited | No | Hosted service, integrations, and the workflow builder | +| Pro | n8n Cloud | €50/month, billed annually | 10,000 | Unlimited | Unlimited | No | Higher execution allowance and added collaboration and administration features | +| Business | Self-hosted | €667/month, billed annually | 40,000 | Unlimited | Unlimited | Yes | Environments, source-control features, scaling options, and administration controls | +| Enterprise | n8n Cloud or self-hosted | Custom quote | Custom | Unlimited | Unlimited | Yes | Security, governance, scaling, support, and deployment terms agreed with n8n | + +[n8n counts executions instead of charging for every individual step in a workflow](https://n8n.io/pricing/). That can make a long workflow economical, but a frequently triggered workflow can still move a team into a higher plan even if each run is simple. + +The advertised subscription is not always the final cost. Teams may also pay for AI model APIs, third-party services, data storage, additional infrastructure, implementation, support, and the engineering time required to operate self-hosted deployments. + +## What does self-hosting n8n really cost? + +Self-hosted n8n can remove the managed-cloud component, but it does not remove infrastructure, operations, licensing, or execution-based plan costs. + +A realistic monthly estimate includes: + +1. **n8n subscription:** [Community Edition has no subscription fee for uses permitted by the Sustainable Use License](https://docs.n8n.io/n8n-community-license/community-license/license-faq), while [Business starts at €667 per month when billed annually and Enterprise is quote-based](https://n8n.io/pricing/) as of November 2026. +2. **Compute and storage:** The deployment needs application servers, a database, persistent storage, backups, and network services. +3. **Scaling infrastructure:** Larger or highly available deployments may require workers, caching or queue infrastructure, load balancing, monitoring, and additional database capacity. +4. **Operations:** A team must patch n8n, test upgrades, monitor runs, investigate failures, restore backups, and manage secrets. +5. **External services:** AI models, email providers, databases, observability tools, and other APIs can bill separately. +6. **Security and compliance:** Private networking, log retention, identity management, vulnerability handling, and audit requirements can add software and labor costs. + +The simplest cost model is: + +> Total self-hosted cost = n8n license or subscription + infrastructure + external APIs + operations labor + security and compliance tooling + +Self-hosting is usually most economical when a team already operates reliable application infrastructure and the Community Edition satisfies its feature and license requirements. Managed n8n Cloud is usually simpler when the team would otherwise need to create a new operational function solely for the automation service. + +## What does the n8n Sustainable Use License allow? + +The n8n Sustainable Use License allows many internal, personal, noncommercial, educational, and consulting uses, but it does not grant the broad rights associated with an OSI-approved open-source license. + +As of November 2026, n8n describes its standard license as a [Sustainable Use License](https://docs.n8n.io/n8n-community-license/). It is source-available and often permits a business to run n8n internally. Its restrictions matter when a company wants to sell hosted n8n access, white-label the product, or use it as the core of a competing commercial service. + +A paid n8n Business or Enterprise agreement can also be necessary when a team needs capabilities reserved for those editions, regardless of whether its basic internal use would otherwise fit the Sustainable Use License. Teams should review n8n’s current license text and commercial terms for their exact deployment rather than treating self-hosted availability as an unrestricted license grant. + +For a fuller license comparison, read [Apache 2.0 vs Fair-Code: Why Sim’s Core License Differs From n8n’s for Self-Hosting](https://www.sim.ai/library/apache-2-0-vs-fair-code). + +## How does monthly n8n cost change at 2,500, 10,000, and 40,000 executions? + +[n8n’s public annual-billing prices](https://n8n.io/pricing/) rise from €20 at 2,500 included executions to €50 at 10,000, while the published 40,000-execution Business tier costs €667 and requires self-hosting as of November 2026. + +| Monthly execution volume | Public plan that includes the volume | Published base subscription | Additional cost to consider | +|---:|---|---:|---| +| 2,500 | Starter on n8n Cloud | €20/month, billed annually | AI models and other metered APIs | +| 10,000 | Pro on n8n Cloud | €50/month, billed annually | AI models, other APIs, and optional services | +| 40,000 | Business, self-hosted | €667/month, billed annually | Compute, database, storage, backups, monitoring, and operations labor | + +These are plan examples rather than universal total-cost estimates. A team that needs 40,000 executions but wants n8n to host the deployment should request current Cloud or Enterprise terms instead of assuming the self-hosted Business price applies. Likewise, a team exceeding a plan allowance should compare n8n’s available execution tiers or add-ons against the next plan rather than extrapolating an unofficial per-execution rate. + +## When does Sim fit compared with n8n? + +Sim can fit teams that need a permissively licensed AI workspace, want to self-host the core without a core software license fee, or plan to use their own model keys or local models. + +[Sim’s core Apache 2.0 license](https://github.com/simstudioai/sim/blob/main/LICENSE) permits use, modification, and redistribution subject to the license terms. The exception is [apps/sim/ee](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE), which includes enterprise capabilities such as single sign-on (SSO), System for Cross-domain Identity Management (SCIM) for automated user provisioning, access control, audit logs, data retention, and credential groups. That code is free for development, testing, and internal non-production use, but production use requires an active Sim Enterprise subscription, and modification and redistribution are not permitted. + +[Self-hosted Sim](https://docs.sim.ai/platform/self-hosting) can connect to Ollama, vLLM, LM Studio, or LiteLLM without requiring Sim Enterprise. Infrastructure and model costs still remain, so Apache 2.0 does not mean a production deployment has zero total cost. + +[Sim Cloud supports workspace BYOK on every plan](https://docs.sim.ai/platform/costs), allowing teams to pay model providers directly. Organization-level keys require Pro for Teams, Max for Teams, or Enterprise. + +Sim fits teams that specifically need Apache 2.0 rights for the core. n8n fits teams that prioritize its automation ecosystem, execution-based billing, and existing operational familiarity over a permissive open-source license. + +## Where can you compare n8n with Sim and other alternatives? + +Sim’s existing guides separate direct product comparison, alternative selection, and licensing analysis so buyers can examine each decision in detail. + +- [Sim vs n8n vs OpenAI AgentKit: AI Agent Builder Comparison (2026)](https://www.sim.ai/library/openai-vs-n8n-vs-sim) compares product capabilities and deployment choices. +- [14 n8n Alternatives and Competitors: Choosing an n8n Alternative in 2026](https://www.sim.ai/library/n8n-alternatives) covers broader replacement options. +- [Apache 2.0 vs Fair-Code: Why Sim’s Core License Differs From n8n’s for Self-Hosting](https://www.sim.ai/library/apache-2-0-vs-fair-code) explains the licensing distinction in depth. +- [n8n vs Zapier vs Make: Which Automation Platform Is Best in 2026?](https://www.sim.ai/library/n8n-vs-zapier-vs-make) compares three established automation products. diff --git a/apps/sim/content/library/servicenow-ai-agent-it-service-requests/index.mdx b/apps/sim/content/library/servicenow-ai-agent-it-service-requests/index.mdx new file mode 100644 index 00000000000..b14783c93c8 --- /dev/null +++ b/apps/sim/content/library/servicenow-ai-agent-it-service-requests/index.mdx @@ -0,0 +1,247 @@ +--- +slug: servicenow-ai-agent-it-service-requests +title: 'How Do You Build a Governed AI Agent for ServiceNow IT Service Requests?' +description: 'Learn how to build a governed ServiceNow AI agent with scoped access, structured decisions, human approval, execution evidence, and safe escalation.' +seoTitle: 'ServiceNow AI Agent for IT Service Requests' +date: 2026-11-23 +updated: 2026-11-23 +authors: + - andrew +readingTime: 11 +tags: [AI Agents, ServiceNow, ITSM, Governance, Sim] +ogImage: /library/servicenow-ai-agent-it-service-requests/cover.jpg +draft: false +faq: + - q: "What are the top AI agent platforms for IT helpdesk teams automating ticket resolution?" + a: "ServiceNow fits native ITSM automation, Sim fits governed agents that must coordinate ServiceNow with external systems, and n8n is a practical source-available option for teams that want general workflow automation." + - q: "Can Sim connect ServiceNow to Slack or Microsoft Teams?" + a: "Sim can coordinate ServiceNow actions with supported Slack or Microsoft Teams actions so an approved workflow can send ticket updates to the appropriate channel." + - q: "Should an AI agent close ServiceNow incidents automatically?" + a: "ServiceNow incidents should close automatically only for narrowly defined outcomes with reliable evidence, while ambiguous, privileged, or high-impact cases should require human approval." + - q: "Can n8n automate ServiceNow tickets?" + a: "n8n provides a ServiceNow node for general workflow automation, but IT leaders should evaluate its source-available Sustainable Use License, governance requirements, and approval design before production deployment." + - q: "Does Sim require Enterprise for self hosting or local models?" + a: "Sim does not require Enterprise for self hosting or local models because any self-hosted Sim deployment can connect to Ollama, vLLM, LM Studio, or LiteLLM, although production use of features in apps/sim/ee requires an active Sim Enterprise subscription." + - q: "Can a ServiceNow AI agent use CMDB data?" + a: "A ServiceNow AI agent can use CMDB data that its integration identity is permitted to read, and the workflow should retrieve only the attributes needed for the current incident." + - q: "How should IT teams measure a ServiceNow AI agent pilot?" + a: "IT teams should measure a ServiceNow AI agent pilot with routing accuracy, reassignment rate, approval rate, resolution time, reopen rate, unauthorized action count, and the percentage of runs escalated safely." + - q: "Is Sim open source?" + a: "Sim's core is Apache 2.0 open source, while enterprise features in apps/sim/ee use the separate Sim Enterprise License and require an active Enterprise subscription for production use." +--- + +## TL;DR + +Sim fits teams that need governed AI agents to classify ServiceNow incidents, gather relevant context, prepare routine service actions, pause for human approval, update tickets, and notify collaboration channels without giving a language model unrestricted control of the ITSM system. + +The safest design separates probabilistic analysis from deterministic execution. The model can interpret a request and propose a structured decision, while explicit Conditions, scoped credentials, approval steps, and ServiceNow access controls determine whether any record is changed. + +## What can AI agents safely do inside ServiceNow today? + +ServiceNow AI agents can safely perform bounded tasks when every read and write is constrained by permissions, structured outputs, deterministic rules, and escalation paths. + +Good production candidates include: + +1. Classifying an incident by category, subcategory, urgency, and likely assignment group. +2. Retrieving approved ticket, asset, service, and CMDB context before producing a summary. +3. Preparing routine service request actions and waiting for an authorized person to approve them. +4. Updating work notes or status fields after a confirmed external action. +5. Sending sanitized progress notifications to Slack or Microsoft Teams. +6. Escalating low-confidence, sensitive, or exceptional cases without making a change. + +An agent should not receive broad administrator access, invent missing configuration data, or treat a plausible answer as proof that work was completed. ServiceNow's [Table API](https://www.servicenow.com/docs/r/xanadu/api-reference/rest-apis/c_TableAPI.html) supports create, read, update, and delete operations on tables, but the integration identity and ServiceNow access controls should determine which operations are available. + +## How should a governed ServiceNow agent be designed in Sim? + +Sim can orchestrate a ServiceNow agent as a sequence of narrow reads, structured decisions, policy checks, approvals, writes, and notifications. + +A practical architecture has seven stages: + +1. **Trigger:** Receive a new or updated ServiceNow record through an approved event or polling pattern. +2. **Retrieve:** Use the ServiceNow block to fetch only the record fields and related context required for the task. +3. **Analyze:** Ask the model for a structured classification, confidence score, rationale, and proposed action. +4. **Validate:** Use deterministic Conditions to check allowed categories, confidence thresholds, required fields, and protected request types. +5. **Approve:** Pause sensitive actions with Sim's Human in the Loop block and collect an explicit approve or reject field. +6. **Execute:** Use a downstream Condition to inspect the approval field before allowing the ServiceNow update or external action. +7. **Record:** Write the outcome and relevant evidence to the ticket, then send a limited status message to the chosen collaboration channel. + +Sim's Human in the Loop block pauses a run and resumes it with submitted form fields. Approval is not automatic enforcement. The workflow must use a downstream Condition to check the approve or reject field before executing the proposed action. + +For model output controls, define a compact schema such as: + +```json +{ + "category": "network", + "assignment_group": "network_operations", + "confidence": 0.94, + "risk_level": "low", + "proposed_action": "route", + "evidence": ["vpn_error_in_description", "affected_service_matches"] +} +``` + +The ServiceNow write should use mapped values from an approved set rather than unconstrained model text wherever possible. + +## How do you classify and route ServiceNow incidents with an AI agent? + +Sim can classify and route ServiceNow incidents by combining ticket context with a controlled taxonomy and allowing deterministic logic to make the final assignment decision. + +A lean workflow is: + +1. Retrieve the incident description, affected service, caller context, current category, and current assignment group. +2. Remove secrets or unnecessary personal information before sending context to the model. +3. Give the model the approved category list and assignment group mapping. +4. Require a structured response with category, group, confidence, evidence, and a short summary. +5. Route high-confidence matches to an allowed assignment group. +6. Send low-confidence or conflicting results to the service desk queue for review. +7. Add a work note explaining the evidence used for the recommendation. + +Use historical tickets for evaluation, not as unconditional instructions. A previous routing decision may reflect an old team structure or a human mistake. The workflow's current allowlist should remain authoritative. + +Routing accuracy alone is not enough. Track reassignment rate, time to first owner, false high-confidence decisions, and the share of incidents safely escalated. The same design principles apply to broader [AI support ticket triage](https://www.sim.ai/library/best-ai-agents-support-ticket-triage), where classification quality must be paired with safe handoff behavior. + +## How do you enrich a ServiceNow ticket with logs and CMDB context? + +Sim can enrich a ServiceNow ticket by retrieving a small set of relevant records from approved systems and attaching a concise, evidence-based summary to the incident. + +The workflow should begin with identifiers already present in the ticket, such as the affected configuration item, service, user, host, or alert ID. It can then retrieve permitted attributes from ServiceNow and approved observability sources before asking the model to summarize relationships. + +Useful enrichment can include: + +1. The affected service and configuration item. +2. Recent approved changes related to that item. +3. Ownership and support group information. +4. A small window of relevant error events. +5. Related open incidents. +6. A concise chronology with source identifiers. + +The agent should cite record IDs or event IDs in its work note so a technician can inspect the evidence. It should distinguish observed facts from model-generated hypotheses and should not copy unrestricted logs into ServiceNow or a collaboration channel. + +For alert-focused workflows that need a formal approval boundary, see [How Do AI Agents Triage Security Alerts With Human Approval?](https://www.sim.ai/library/ai-agents-security-alert-triage-human-approval). + +## How do you fulfill routine ServiceNow requests with human approval? + +Sim can prepare and execute routine ServiceNow service requests safely when the permitted request types, approvers, action parameters, and completion evidence are defined before the model runs. + +Password resets, access changes, software requests, and device actions do not carry equal risk. Start with a narrow request type whose downstream system exposes a reversible and auditable operation. + +A governed fulfillment sequence is: + +1. Retrieve the request and verify that it belongs to an approved request type. +2. Extract structured parameters such as the target user, requested resource, duration, and business justification. +3. Validate required fields and reject values outside the policy allowlist. +4. Determine the required approver from policy rather than allowing the model to choose one freely. +5. Pause the run with Human in the Loop and display the proposed action, target, evidence, and risk. +6. Route on the submitted approval field with a downstream Condition. +7. Execute the action only on the approved branch. +8. Verify the external system response before updating ServiceNow as fulfilled. +9. Record rejection, failure, or incomplete evidence without claiming success. + +The workflow should use idempotency controls where the downstream operation supports them. A resumed or retried run must not grant access twice, create duplicate requests, or post contradictory completion notes. + +For a device management example, see [How Do You Build a Governed AI Agent for Microsoft Intune Device Management?](https://www.sim.ai/library/ai-agents-microsoft-intune-device-management). + +## How do you post ServiceNow status updates to Slack or Microsoft Teams? + +Sim can post ServiceNow status updates to Slack or Microsoft Teams after the workflow confirms the ticket state and removes information that should remain inside the ITSM system. + +A useful channel message contains the ticket identifier, a short status, the owning team, and a link supplied by the organization's approved configuration. It should omit secrets, full logs, sensitive user details, and internal model reasoning. + +Send notifications only after a confirmed state transition. For example, the workflow can notify a channel after ServiceNow accepts the assignment update, after an approver submits a decision, or after the downstream system returns evidence of completion. + +Channel selection should be deterministic. Map services, business units, or assignment groups to approved destinations instead of asking the model to invent a channel name. + +## How should ServiceNow AI agents be governed? + +ServiceNow and Sim should govern IT service agents through dedicated identities, least-privilege access, explicit approval boundaries, execution records, and regular evaluation. + +### What permissions should a ServiceNow integration identity receive? + +A ServiceNow integration identity should receive only the roles and record access required for the specific tables, fields, and operations in the workflow. + +Use separate credentials for development and production. Avoid sharing a human administrator account. Keep read and write permissions distinct where practical, and deny access to unrelated records even if they are technically reachable through an API. + +ServiceNow [Access Control Lists](https://www.servicenow.com/docs/r/platform-security/access-control/access-control-rules.html) restrict access to data through defined requirements and should remain the enforcement layer for records and fields. Sim credentials should be stored as managed credentials rather than placed in prompts or workflow text. + +### Where should human approval be required? + +Sim should require human approval before privileged, high-impact, ambiguous, or difficult-to-reverse actions. + +Approval is especially important for access grants, account changes, security configuration, device actions, financial commitments, sensitive user data, and any operation with incomplete evidence. Low-risk classification or enrichment can often run without approval if it only proposes or records bounded information. + +The approval form should show the target, exact proposed action, relevant evidence, risk level, and expected result. The approver should not need to reconstruct the action from a generic summary. + +### What should the audit record contain? + +Sim and ServiceNow should preserve enough execution evidence to reconstruct what triggered the run, what data was used, what decision was proposed, who approved it, and what action result was returned. + +At minimum, record the workflow version, ticket identifier, timestamps, model and prompt version where available, structured decision, approval response, ServiceNow response, external action response, and final state. Avoid placing secrets or unnecessary raw personal data in logs. + +Sim's enterprise audit log features are in `apps/sim/ee` under the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE), which requires an active Sim Enterprise subscription for production use. + +## How does Sim compare with ServiceNow AI agents and n8n for IT service requests? + +Sim, ServiceNow, and n8n fit different IT service automation boundaries. ServiceNow fits native ITSM work, Sim fits governed cross-system agents, and n8n fits general workflow automation. + +| Platform | Fit | ServiceNow role | Governance approach | +|---|---|---|---| +| ServiceNow AI Agents | Work that remains primarily inside ServiceNow | Native access to ServiceNow processes and data according to the purchased product and configured permissions | ServiceNow roles, access controls, and product governance | +| Sim | Governed agents that coordinate ServiceNow with models, collaboration tools, device systems, observability tools, and custom APIs | ServiceNow remains the system of record while Sim coordinates reasoning, approval, and cross-system execution | Structured outputs, Conditions, Human in the Loop, managed credentials, deployment controls, and enterprise controls where licensed | +| n8n | General integrations and deterministic automation with optional AI steps | The ServiceNow node can read and change supported records within configured credentials | Workflow logic, credentials, deployment controls, and organization-specific review processes | + +ServiceNow describes agents that use tools such as flow actions, subflows, scripts, and skills on its [AI Agents product page](https://www.servicenow.com/products/ai-agents.html). Native ServiceNow agents fit when the task, data, approvals, and actions all remain in ServiceNow. + +Sim fits when ServiceNow must coordinate with systems such as Intune, observability platforms, internal APIs, Slack, or Microsoft Teams, and the team wants one visual workflow for model reasoning, deterministic checks, approval, and execution. + +n8n is another option for broad automation. Its [ServiceNow node documentation](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.servicenow) lists operations for incidents, configuration items, table records, users, and other resources. n8n uses the source-available [Sustainable Use License](https://docs.n8n.io/n8n-community-license), not an OSI-approved open-source license. + +## What are the key platform facts as of November 2026? + +Sim, ServiceNow, and n8n differ in licensing, deployment, and billing, so IT teams should compare those facts separately from workflow features. + +1. **Sim:** Sim's core uses the OSI-approved Apache 2.0 license, while code in `apps/sim/ee` uses the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE). Any [self-hosted Sim deployment](https://docs.sim.ai/platform/self-hosting) can use local models through Ollama, vLLM, LM Studio, or LiteLLM, and [workspace BYOK](https://docs.sim.ai/platform/costs#bring-your-own-key-byok) is available on any Sim Cloud plan. +2. **ServiceNow:** ServiceNow's [ITSM pricing page](https://www.servicenow.com/lpgp/pricing-itsm.html) directs buyers to request a quote based on their requirements rather than publishing one universal workflow execution price. +3. **n8n:** n8n's self-hosted Community edition uses its [Sustainable Use License](https://docs.n8n.io/n8n-community-license/community-license/license-faq), while [n8n Cloud pricing](https://n8n.io/pricing/) uses monthly workflow executions as its primary usage unit. + +These facts are current as of November 2026. Buyers should confirm current terms on each vendor's official pages during procurement. + +## When should an IT team choose ServiceNow, Sim, or n8n? + +IT teams should choose based on the system boundary, governance model, deployment needs, and licensing requirements of the use case. + +Choose ServiceNow's native agents when: + +1. Most relevant context and actions live in ServiceNow. +2. The organization wants native ServiceNow administration and product governance. +3. Existing ServiceNow licensing and implementation resources cover the use case. + +Choose Sim when: + +1. The agent must coordinate ServiceNow with several external systems. +2. The team needs explicit separation between model reasoning and deterministic execution. +3. Human approval must be visible inside a multi-step workflow. +4. The team wants model choice, workspace BYOK, or local models on a self-hosted deployment. +5. IT wants Sim's core Apache 2.0 codebase while evaluating features under the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE) where needed. + +Choose n8n when: + +1. The task is primarily general integration automation. +2. The required ServiceNow operations are supported by its node or can be implemented through approved API calls. +3. The organization accepts the Sustainable Use License and can implement the required governance around its workflows. + +For a broader fit-based comparison, see [AI Agents for IT Helpdesk Teams: 6 Platforms Compared](https://www.sim.ai/library/best-ai-agents-for-it-helpdesk-teams). + +## How should CIOs pilot a ServiceNow AI agent? + +A team can begin a ServiceNow pilot with one high-volume, low-risk request type and a written policy for data access, confidence thresholds, approvals, and rollback. + +A four-phase pilot reduces operational risk: + +1. **Replay:** Run historical tickets without writing to ServiceNow and compare the agent's decisions with reviewed outcomes. +2. **Recommend:** Let the agent prepare classifications or actions while humans make every final change. +3. **Approve:** Permit bounded writes only after an authorized person approves the exact action. +4. **Automate selectively:** Remove approval only for outcomes that demonstrate reliable evidence, low impact, and safe recovery. + +Set exit criteria before the pilot begins. A production candidate should meet agreed thresholds for routing accuracy, reassignment rate, resolution time, reopen rate, policy violations, and safe escalation. Any unauthorized action should trigger investigation rather than being averaged into an overall success score. + +A ServiceNow agent is ready for broader use only when the organization can explain its permissions, reproduce its decisions, identify its approvers, and stop or reverse its actions safely. diff --git a/apps/sim/content/library/workato-pricing-ai-agents-cost/index.mdx b/apps/sim/content/library/workato-pricing-ai-agents-cost/index.mdx new file mode 100644 index 00000000000..77ce77bc481 --- /dev/null +++ b/apps/sim/content/library/workato-pricing-ai-agents-cost/index.mdx @@ -0,0 +1,200 @@ +--- +slug: workato-pricing-ai-agents-cost +title: 'Workato Pricing: Costs, Cost Drivers, and When AI Agents Cost Less' +description: 'Understand Workato pricing, usage credits, enterprise quote drivers, and when an AI workspace such as Sim can have a lower annual cost.' +seoTitle: 'Workato Pricing and AI Agent Costs' +date: 2026-11-24 +updated: 2026-11-24 +authors: + - andrew +readingTime: 8 +tags: [Workato, Pricing, AI Agents, BYOK, Sim] +ogImage: /library/workato-pricing-ai-agents-cost/cover.jpg +draft: false +faq: + - q: "Does Workato publish standard list prices?" + a: "Workato publishes self-service Free and Pro options, but its enterprise pricing page does not publish standard dollar prices. Enterprise buyers must contact Workato for a tailored quote." + - q: "Does Workato offer a free plan?" + a: "Workato offers a self-service Free plan with a one-time allocation of Workato credits as of November 2026." + - q: "Are Workato recipes and tasks the same thing?" + a: "Workato recipes and tasks are not the same thing: a recipe defines an automation, while Tasks represent action steps performed when recipes execute." + - q: "Can Sim use bring-your-own model keys?" + a: "Sim supports workspace bring-your-own model keys on every Sim Cloud plan, while Sim organization-level keys require Pro for Teams, Max for Teams, or Enterprise as of November 2026." + - q: "Does BYOK make AI model usage free?" + a: "Sim BYOK does not make model usage free because the model provider still charges for usage. Sim BYOK lets the team pay that provider directly instead of using Sim-hosted model keys." + - q: "Can Sim run local models when self-hosted?" + a: "Sim can connect a self-hosted deployment to local models through Ollama, vLLM, LM Studio, or LiteLLM without requiring Sim Enterprise." + - q: "Is Sim free to self-host?" + a: "Sim’s Apache 2.0 core can be self-hosted, but production use of features under the separate Sim Enterprise License requires an active Sim Enterprise subscription. Infrastructure, model, and third-party service costs can still apply." + - q: "Is n8n open source?" + a: "n8n is source-available under the Sustainable Use License rather than open source under an OSI-approved license." + - q: "Which is better for enterprise integration, Workato or Sim?" + a: "Workato suits broad enterprise integration programs, while Sim fits teams that need to build, deploy, and manage AI agents with model choice and BYOK." + - q: "Which is cheaper, Workato or Sim?" + a: "Sim can cost less for focused AI-agent workloads with BYOK and a limited integration footprint, but buyers must compare a current Workato quote with complete annual costs for the same requirements." +--- + +## TL;DR + +- Workato offers [self-service Free and Pro options](https://docs.workato.com/en/pricing/self-service/self-service), while its [enterprise editions use quote-based pricing](https://www.workato.com/pricing). Enterprise buyers need an itemized quote to establish the actual annual cost. +- Workato uses a [usage-based billing model](https://docs.workato.com/pricing) for current plans. Usage across capabilities is converted into Workato credits, although some older contracts use different measurements. +- The main cost drivers are the selected edition, usage capacity, connectors, environments, AI capabilities, support, implementation, and internal operating labor. Workato’s enterprise pricing page shows how included capabilities vary by edition. +- Sim fits teams that primarily need to build, deploy, and manage AI agents. BYOK and self-hosting can change the cost structure, but model, infrastructure, implementation, and operating costs still count. + +Workato pricing has two distinct paths as of November 2026. Workato provides [self-service Free and Pro plans](https://docs.workato.com/en/pricing/self-service/self-service), while the company’s [enterprise pricing page](https://www.workato.com/pricing) asks buyers to contact sales for Standard, Business MCP, and Enterprise MCP pricing. + +For a useful comparison, calculate Workato’s complete annual cost, including usage, environments, support, add-ons, and implementation. Then compare it with the subscription, model, hosting, and operating costs of an AI workspace such as Sim. + +## How much does Workato cost? + +Workato does not publish one standard price that answers how much every customer will pay. Its [self-service documentation](https://docs.workato.com/en/pricing/self-service/self-service) describes a Free plan with a one-time 50,000-credit grant and Pro options with recurring monthly credit allocations. [Enterprise editions](https://www.workato.com/pricing) remain quote-based. + +That means there is no defensible public “typical Workato price” for a 20-person startup, a 200-person operations team, or a global enterprise. Enterprise quotes can differ because the required edition, capacity, applications, environments, governance features, support, and implementation scope differ. + +Buyers should ask Workato for an itemized annual quote rather than treating an initial platform figure as total cost. The quote should state: + +- The platform edition and included capabilities +- The contracted usage or credit allowance +- How excess usage is measured and charged +- Which connectors and recipes are included +- The number of development, test, and production environments +- AI or agent-related entitlements +- Support and service levels +- One-time implementation or partner fees +- Renewal terms and expected price changes + +## How does Workato pricing work? + +Workato describes its current approach as a [usage-based billing model](https://docs.workato.com/pricing). For customers on that model, usage across different capabilities is converted into Workato credits. Workato notes that customers who joined before February 2024 may use a different model, so the order form remains the source of truth for a specific account. + +A recipe is Workato’s term for an automated workflow. For workflow recipes measured in Tasks, [Workato defines a Task](https://docs.workato.com/recipes/tasks) as one action step that a recipe executes. Triggers and control-flow steps do not count as Tasks, and some plans measure workflow usage differently. + +This distinction matters. The number of recipes describes how many automations a team operates, while usage reflects how often and how extensively those automations perform work. A team with a few high-volume recipes can therefore need more capacity than a team with many rarely used recipes. + +## What drives Workato cost? + +Workato cost is primarily driven by the selected edition, usage capacity, deployment requirements, add-ons, support, and implementation scope. The [Workato pricing page](https://www.workato.com/pricing) lists different capabilities across its enterprise editions but leaves exact contract prices to the sales process. + +| Cost driver | How it can affect Workato’s total cost | What buyers should request | +|---|---|---| +| Platform edition | Establishes the contracted capabilities and commercial foundation | An itemized list of included platform capabilities | +| Recipes | Represents the automations the organization builds and operates | Recipe entitlements and any contractual limits | +| Usage capacity | Reflects operations across recipes and other Workato capabilities | Included credits or other capacity, measurement rules, and excess-usage terms | +| Connectors | Determines which business systems recipes can access | Included connectors and charges for premium or custom connectivity | +| Environments | Supports separation between development, testing, and production | Included environments and the price of additional environments | +| AI capabilities | Adds agent, model, document, or AI-related usage | Included capabilities, usage allowances, and external model charges | +| Governance and security | Adds controls required by larger or regulated organizations | Exact capabilities included in the selected edition or add-ons | +| Support | Changes response commitments and access to vendor assistance | Support tier, service levels, and annual charge | +| Implementation | Covers solution design, migration, testing, and enablement | Separate estimates for Workato, partner, and internal labor | + +Workato buyers should also model growth. A quote that fits a pilot may not represent the cost of running the same recipes across more departments, records, customers, or events. + +## What do mid-size teams typically pay for Workato? + +Workato’s [enterprise pricing page](https://www.workato.com/pricing) does not publish enough dollar data to calculate a reliable typical price for mid-size teams. Any universal estimate that is not tied to a current Workato quote risks combining different editions, capacities, add-ons, and service arrangements. + +A mid-size team can still produce a decision-ready estimate by requesting three scenarios: + +1. **Pilot:** The smallest production configuration that supports the first use case. +2. **Expected year-one use:** The anticipated recipes, runs, data volume, environments, and users. +3. **Growth case:** Higher usage plus the governance, support, and additional environments likely to be needed after rollout. + +The useful number is annual total cost, not just subscription cost: + +**Workato annual total cost = platform and capacity charges + usage charges + add-ons + support + implementation + partner fees + internal operating labor** + +This method avoids presenting an unsupported market average as if it were an official Workato price. + +## When is Workato worth the cost? + +Workato is worth considering when an organization needs enterprise integration, broad business-system connectivity, centralized governance, and coordinated automation across multiple departments. Its [enterprise editions](https://www.workato.com/pricing) include combinations of application integration, process automation, environment management, access controls, Model Context Protocol (MCP) capabilities for connecting AI systems with tools, data integration, API management, and other services, depending on the selected edition. + +Workato may be the right call when: + +- Multiple departments need a shared integration and automation program +- Existing enterprise applications require coordinated data movement +- Central IT needs formal administration and lifecycle controls +- The organization has staff or partners available for implementation +- The negotiated quote remains economical under expected usage growth + +The decision should depend on requirements rather than company size alone. A smaller regulated business may need enterprise controls, while a large team with only a narrow AI use case may not need a broad integration suite. + +## Is Workato overkill for a 20-person startup that just needs AI agents connected to a few SaaS tools? + +Workato can be more platform than a 20-person startup needs when the team only wants a few AI agents connected to a small set of SaaS tools. An enterprise integration suite can be harder to justify when the main requirements are visual agent building, model access, selected integrations, and direct control over model spending. + +Workato may still make sense if the startup has unusually complex integration, compliance, or governance requirements. Otherwise, an AI-focused workspace can reduce platform scope and procurement effort. + +A startup should compare the options using its actual workload: + +- Number of production agents +- Agent runs per month +- Model tokens consumed per run +- SaaS actions performed per run +- Required approval and governance controls +- Engineering time needed for deployment and maintenance +- Expected workload growth over the next 12 months + +For a broader product comparison, see [6 Best Workato Alternatives for AI Agents in 2026](https://www.sim.ai/library/best-workato-alternatives-ai-agents-2026). Teams deciding whether to operate their own infrastructure can also review [AI Agent Hosting: Where Should IT Run Production Agents?](https://www.sim.ai/library/ai-agent-hosting-models-production-agents). + +## When do AI agents cost less than Workato? + +Sim can cost less than Workato when a team primarily needs AI agents, uses a focused set of integrations, brings its own model-provider keys, and does not require the full scope of an enterprise integration suite. The result depends on the customer’s Workato quote and actual AI usage, so the break-even point must be calculated rather than assumed. + +Sim supports workspace BYOK on every Sim Cloud plan. Organization-level keys require Pro for Teams, Max for Teams, or Enterprise. With BYOK, the model provider bills the customer directly, as explained in Sim’s [cost and BYOK documentation](https://docs.sim.ai/platform/costs#bring-your-own-key-byok). + +Use these formulas: + +**Sim Cloud annual total cost = Sim subscription + usage charges beyond included credits + direct model-provider charges + implementation labor + operating labor** + +Sim’s [cost documentation](https://docs.sim.ai/platform/costs) notes that BYOK avoids the model or tool charge for provider calls it covers, but the workflow base charge and unrelated hosted-tool or sandbox usage still apply. Paid usage beyond included credits can be billed as overage when on-demand usage is enabled. + +**Self-hosted Sim annual total cost = infrastructure + direct model-provider charges + implementation labor + operating labor + any required enterprise-feature subscription** + +**Workato annual total cost = Workato subscription or quote + usage charges outside the included allowance + add-ons + support + implementation labor + operating labor** + +Sim costs less only when the relevant Sim total is below the complete Workato total for the same production requirements. BYOK can strengthen the case for model-heavy workloads because the team pays the model provider directly, but it does not eliminate provider usage charges. + +The [AI agent development company versus in-house guide](https://www.sim.ai/library/ai-agent-development-company-vs-building-in-house) explains how implementation and staffing choices affect the budget beyond software fees. + +## What are the key pricing and deployment facts about Workato, Sim, and n8n? + +Workato, Sim, and n8n use materially different packaging, deployment, and licensing models that affect total cost. + +- **Workato:** Workato is a proprietary product with [self-service](https://docs.workato.com/en/pricing/self-service/self-service) and [enterprise sales](https://www.workato.com/pricing) paths. Its [usage documentation](https://docs.workato.com/pricing) says current plans convert successful operations across capabilities into Workato credits, while some older contracts use different measurements. +- **Sim:** Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Sim’s core is Apache 2.0 and can be [self-hosted](https://docs.sim.ai/platform/self-hosting), while code in `apps/sim/ee` is governed by the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE), which requires an active Enterprise subscription for production use. +- **n8n:** n8n offers hosted and self-hosted plans, and its [pricing page](https://n8n.io/pricing/) says pricing is based on monthly workflow executions. Its [Sustainable Use License](https://github.com/n8n-io/n8n/blob/master/LICENSE.md) is source-available rather than an OSI-approved open-source license. + +n8n belongs in the cost comparison because teams may evaluate it for workflow automation and AI agents. Sim fits teams whose primary job is building and operating AI agents with model choice and BYOK. Workato suits programs centered on enterprise integration breadth and centralized automation. + +For a deeper licensing comparison, read [Apache 2.0 vs Fair-Code: Why Sim’s Core License Differs From n8n’s for Self-Hosting](https://www.sim.ai/library/apache-2-0-vs-fair-code). + +## How should buyers compare a Workato quote with an AI workspace? + +Buyers should compare Workato and an AI workspace against the same workload, service level, and governance requirements. Comparing a broad Workato enterprise quote with a small AI-workspace subscription, or ignoring model, hosting, and labor costs, produces a misleading result. + +Use this process: + +1. Define three representative production workflows or agents. +2. Estimate monthly runs, SaaS actions, model calls, and token use. +3. List required environments, approval controls, support, and security capabilities. +4. Obtain a written Workato quote for the same scenario. +5. Calculate Sim Cloud and self-hosted Sim costs separately where both are viable. +6. Include implementation and ongoing operating labor for every option. +7. Recalculate the totals at expected year-two volume. + +The lower-cost choice is the option that meets every required capability at the lowest risk-adjusted annual total, not automatically the product with the lowest advertised entry price. + +## Sources + +Use current primary sources when updating a budget or preparing a vendor comparison: + +- [Workato enterprise pricing and editions](https://www.workato.com/pricing) +- [Workato billing and usage documentation](https://docs.workato.com/pricing) +- [Workato self-service billing documentation](https://docs.workato.com/en/pricing/self-service/self-service) +- [Workato Tasks documentation](https://docs.workato.com/recipes/tasks) +- [Sim costs and BYOK documentation](https://docs.sim.ai/platform/costs#bring-your-own-key-byok) +- [Sim self-hosting documentation](https://docs.sim.ai/platform/self-hosting) +- [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE) +- [n8n pricing](https://n8n.io/pricing/) +- [n8n Sustainable Use License](https://github.com/n8n-io/n8n/blob/master/LICENSE.md) diff --git a/apps/sim/ee/access-control/utils/permission-check.test.ts b/apps/sim/ee/access-control/utils/permission-check.test.ts index 3b7c907a599..fccff74d9bb 100644 --- a/apps/sim/ee/access-control/utils/permission-check.test.ts +++ b/apps/sim/ee/access-control/utils/permission-check.test.ts @@ -349,6 +349,26 @@ describe('validateModelProvider', () => { ).rejects.toBeInstanceOf(ModelNotAllowedError) }) + it('lets sim-auto through a provider allowlist, since the router gates each pool candidate', async () => { + queueGroupResolution([{ config: { allowedModelProviders: ['anthropic'] } }]) + mockGetProviderFromModel.mockReturnValue('ollama') + + await expect( + validateModelProvider('user-123', 'workspace-1', 'sim-auto') + ).resolves.toBeUndefined() + expect(mockGetProviderFromModel).not.toHaveBeenCalledWith('sim-auto') + }) + + it('refuses sim-auto when the denylist names it, even under a provider allowlist', async () => { + queueGroupResolution([ + { config: { allowedModelProviders: ['anthropic'], deniedModels: ['sim-auto'] } }, + ]) + + await expect( + validateModelProvider('user-123', 'workspace-1', 'sim-auto') + ).rejects.toBeInstanceOf(ModelNotAllowedError) + }) + it('enforces the denylist even when no provider allowlist is set', async () => { queueGroupResolution([{ config: { allowedModelProviders: null, deniedModels: ['gpt-4'] } }]) mockGetProviderFromModel.mockReturnValue('openai') diff --git a/apps/sim/ee/access-control/utils/permission-check.ts b/apps/sim/ee/access-control/utils/permission-check.ts index 03c35cd1e31..7cda2581a5f 100644 --- a/apps/sim/ee/access-control/utils/permission-check.ts +++ b/apps/sim/ee/access-control/utils/permission-check.ts @@ -30,6 +30,7 @@ import { mergeEnvAllowlist, } from '@/lib/permission-groups/resolve.server' import type { ExecutionContext } from '@/executor/types' +import { isAutoModel } from '@/providers/models' import { getProviderFromModel } from '@/providers/utils' /** @@ -309,7 +310,11 @@ function assertModelAllowed( model: string, subject: PermissionSubject ): void { - if (config.allowedModelProviders !== null) { + /** + * sim-auto has no provider to allowlist: the model router gates every pool candidate + * through this check before it resolves to one. Naming it outright still refuses it. + */ + if (config.allowedModelProviders !== null && !isAutoModel(model)) { const providerId = getProviderFromModel(model) if (!config.allowedModelProviders.includes(providerId)) { diff --git a/apps/sim/ee/access-requests/lib/catalog-registry.ts b/apps/sim/ee/access-requests/lib/catalog-registry.ts index bb45379fac7..cdb35a5b375 100644 --- a/apps/sim/ee/access-requests/lib/catalog-registry.ts +++ b/apps/sim/ee/access-requests/lib/catalog-registry.ts @@ -3,9 +3,8 @@ import { env } from '@/lib/core/config/env' import { getAllowedIntegrationsFromEnv, getBlacklistedProvidersFromEnv, - isHosted, } from '@/lib/core/config/env-flags' -import { isOllamaUrlConfigured } from '@/lib/core/utils/urls' +import { isOllamaReachable } from '@/lib/core/utils/urls' import { isScopedCredentialGroupsAvailable } from '@/lib/credential-groups/scoped-availability' import { isIntegrationDeploymentAvailableForVisibility, @@ -37,7 +36,7 @@ export interface AccessRequestCatalogContext { } function isProviderDeploymentAvailable(providerId: string): boolean { - if (providerId === 'ollama') return !isHosted || isOllamaUrlConfigured() + if (providerId === 'ollama') return isOllamaReachable() if (providerId === 'vllm') return Boolean(env.VLLM_BASE_URL?.trim()) if (providerId === 'litellm') return Boolean(env.LITELLM_BASE_URL?.trim()) return true diff --git a/apps/sim/ee/access-requests/lib/catalog.test.ts b/apps/sim/ee/access-requests/lib/catalog.test.ts index d73504d5745..271c027a7bb 100644 --- a/apps/sim/ee/access-requests/lib/catalog.test.ts +++ b/apps/sim/ee/access-requests/lib/catalog.test.ts @@ -17,7 +17,7 @@ import { providersModelsMockFns, } from '@sim/testing/mocks/providers-models.mock' import { providersUtilsMock, providersUtilsMockFns } from '@sim/testing/mocks/providers-utils.mock' -import { resetUrlsMock, urlsMockFns } from '@sim/testing/mocks/urls.mock' +import { resetUrlsMock } from '@sim/testing/mocks/urls.mock' import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest' vi.mock('@/lib/core/config/block-visibility', () => blockVisibilityMock) @@ -111,7 +111,7 @@ setEnvFlags({ isSandboxesEnabled: false, isSsoEnabled: false, }) -urlsMockFns.mockIsOllamaUrlConfigured.mockReturnValue(false) +setEnv({ OLLAMA_URL: undefined }) afterAll(() => { resetEnvMock() diff --git a/apps/sim/ee/organization-usage/components/usage-consumers.tsx b/apps/sim/ee/organization-usage/components/usage-consumers.tsx index 347bef20b2b..129ce5aa90f 100644 --- a/apps/sim/ee/organization-usage/components/usage-consumers.tsx +++ b/apps/sim/ee/organization-usage/components/usage-consumers.tsx @@ -35,6 +35,7 @@ import { OpenAIIcon, OpenRouterIcon, SakanaIcon, + SimAutoIcon, TogetherIcon, TypeSafeIcon, VertexIcon, @@ -101,6 +102,8 @@ const PROVIDER_ICONS: Readonly,