# Sommatic Docs

> Guides, references and agent tools to build on Sommatic AI: workflows, nodes, expressions, AI, human-in-the-loop, Git Sync and the API.

Sommatic AI is a distributed cognitive layer for organizations: it receives events (email, webhooks, schedules, queues), runs versioned workflows of nodes (AI, data, integrations, human tasks) under identity and governance, and records every run.

Instructions for agents:
- Read pages as Markdown: every page has a twin at the same address ending in `.md` (for example https://docs.sommatic.ai/en/workflows.md). Do not scrape the HTML.
- Install the skills for focused instructions: `npx skills add https://docs.sommatic.ai` (index at https://docs.sommatic.ai/.well-known/agent-skills/index.json).
- The node catalog as data: https://docs.sommatic.ai/catalog/nodes.json. The public API as OpenAPI: https://docs.sommatic.ai/openapi/sommatic.json. Git Sync JSON Schemas: https://docs.sommatic.ai/schemas/git-sync/.
- Never invent node slugs, config fields or expression variables: check them in the node reference and the expressions reference first.

## Get started

- [What is Sommatic AI](https://docs.sommatic.ai/en/get-started.md): Sommatic AI is a layer that turns events into governed, traceable work. It receives signals, runs versioned workflows node by node, brings in a person when a case needs one and records every step.
- [Core concepts](https://docs.sommatic.ai/en/get-started/concepts.md): The ideas you need before building in Sommatic AI — artifacts, workflows and their versions, nodes, ports and envelopes, runs, tasks, governed AI and traceability — and how they fit together.
- [Built on Link Loom](https://docs.sommatic.ai/en/get-started/link-loom.md): Sommatic AI runs on the Link Loom SDK: its services are Link Loom services, every node is a Link Loom worker, and part of the expression helpers, the API envelope, the ids and the record fields come from the SDK. What Sommatic AI inherits and where you see it.
- [Quickstart](https://docs.sommatic.ai/en/get-started/quickstart.md): Build your first workflow in the Sommatic AI portal — create a credential, add a webhook trigger, configure nodes, test the draft while the canvas lights up, publish a version and find the run.
- [Glossary](https://docs.sommatic.ai/en/get-started/glossary.md): The terms used across the Sommatic AI documentation and portal, from artifact and envelope to ingress binding, flow version and task, with the identifier each one has in the API.

## Build with agents

- [Build with agents](https://docs.sommatic.ai/en/agents.md): How coding agents read these docs - Markdown twins of every page, llms.txt, a JSON catalog, the OpenAPI document and skills today, and an MCP server, CLI and plugins coming soon.
- [Skills](https://docs.sommatic.ai/en/agents/skills.md): Install the Sommatic AI skills in your coding agent with one command, so it loads focused instructions for Sommatic AI tasks only when it needs them.
- [MCP server](https://docs.sommatic.ai/en/agents/mcp.md): The Sommatic AI docs MCP server will let Claude Code, Codex, Cursor and other MCP clients search and read these docs as tools. Planned setup, and what to use until it ships.
- [CLI](https://docs.sommatic.ai/en/agents/cli.md): The @sommatic/cli command line will print any docs page as Markdown and set up the docs in your coding agent. Planned commands, and the plain HTTP you can use today.
- [llms.txt and the catalog](https://docs.sommatic.ai/en/agents/llms-txt.md): The machine-readable files of these docs - Markdown twins, llms.txt and llms-full.txt per language, the JSON catalog, the OpenAPI document and the Git Sync schemas - and what each one contains.

## Workflows

- [Workflows](https://docs.sommatic.ai/en/workflows.md): A workflow is a versioned graph of nodes that Sommatic AI runs step by step when a trigger fires. Design it in the studio or in Git, test the draft, publish a version and follow every run.
- [Lifecycle](https://docs.sommatic.ai/en/workflows/lifecycle.md): The objects of a workflow and how they move: from draft to version, from version to runs, and how every node of a run executes as a Link Loom worker with its own state machine.
- [Drafts and versions](https://docs.sommatic.ai/en/workflows/lifecycle/versions.md): How a draft becomes an immutable version, which version each trigger and mode runs, and the statuses a version can have.
- [Runs and their statuses](https://docs.sommatic.ai/en/workflows/lifecycle/runs.md): The statuses of a run (flow instance) and of its result, and the record each node leaves.
- [Backend and orchestrator](https://docs.sommatic.ai/en/workflows/lifecycle/backend-and-orchestrator.md): How a run flows between the Sommatic AI API and the workflow orchestrator: who receives the trigger, which records are created and when, how the graph is executed and reported back step by step, and who writes the result.
- [How a node runs](https://docs.sommatic.ai/en/workflows/lifecycle/node-execution.md): Each step of a run creates a Link Loom worker for the node, activates it in the background and stops it: what the worker receives, what it returns and why no state survives the step.
- [Worker state machine](https://docs.sommatic.ai/en/workflows/lifecycle/worker-states.md): The finite state machine of a Link Loom worker: its seven states, the nine events that move it, the hook each transition runs and what a workflow step uses.
- [When a node fails](https://docs.sommatic.ai/en/workflows/lifecycle/failures.md): The two ways a node fails, leaving through its error port or crashing its worker, and how each one ends the step and the run.
- [Isolation and sandboxes](https://docs.sommatic.ai/en/workflows/lifecycle/isolation.md): Where a node runs and where its code runs: workers in the service process or in their own thread, expressions in a separate JavaScript context, code nodes in their own context or process.
- [Workflow Studio](https://docs.sommatic.ai/en/workflows/studio.md): The portal editor for workflows. Build the graph on the canvas, configure each node with its input and output side by side, save the draft, run it with live progress, inspect events in the debug console and deploy a version.
- [Ports and envelope](https://docs.sommatic.ai/en/workflows/ports-and-envelope.md): Every node returns an envelope with ok, data, port and meta. The data becomes the next node's input, and the port decides which edges the engine follows. This page covers ports, edges, fan-out and how the final port settles a run.
- [Triggers](https://docs.sommatic.ai/en/workflows/triggers.md): The first node of a workflow decides how its runs start — a webhook call, a schedule, a mailbox, another workflow or a person. This page lists the triggers, what each one passes to the next node and which version it runs.
- [Webhooks](https://docs.sommatic.ai/en/workflows/webhooks.md): Start a workflow from any system that can send an HTTP POST. Create the endpoints from the webhook trigger, choose test or prod mode, send JSON, wait for the result or run asynchronously and follow the progress over Server-Sent Events.
- [Errors](https://docs.sommatic.ai/en/workflows/errors.md): How failures move through a workflow — the error port every node has, what the engine does when a node fails, how a run ends completed or failed, and what flow.try, retries and timeouts do and do not do.
- [Sub-workflows](https://docs.sommatic.ai/en/workflows/sub-workflows.md): Compose workflows from reusable pieces. workflow.chain calls another workflow and can wait for its result; workflow.trigger receives the call, filters callers and passes the data on. Both runs share a correlation id.
- [Testing](https://docs.sommatic.ai/en/workflows/testing.md): Test a workflow before it reaches production. Run the saved draft from the studio, feed it sample data, execute a single node, listen for a real test webhook, watch every event in the debug console and read the result of each node.
- [Publishing](https://docs.sommatic.ai/en/workflows/publishing.md): Publish a workflow's draft as an immutable, numbered version that production traffic runs, roll back to an earlier version, read the warnings publishing returns, and pause a workflow per mode without unpublishing it.
- [Limits](https://docs.sommatic.ai/en/workflows/limits.md): The ceilings and fixed behaviors a workflow runs under — 100 steps per run, retries only in the nodes that implement them, timeouts, request body sizes, scheduling intervals and when changes to a workflow take effect.
- [Gotchas](https://docs.sommatic.ai/en/workflows/gotchas.md): The workflow behaviors that surprise people most — test calls running the draft, schedules read as intervals, sub-workflows that fail behind an out port, nodes that run twice, renamed labels and more — and what to do about each one.

## Expressions

- [Expressions](https://docs.sommatic.ai/en/expressions.md): Expressions let a node read data from the trigger and from earlier nodes. Write JavaScript between double braces in a node field and Sommatic AI evaluates it right before the node runs.
- [Variables](https://docs.sommatic.ai/en/expressions/variables.md): The variables an expression can read, with their type and an example each — the current input, the output of any earlier node, the run, the workflow, the node itself, dates and ids — and the names that do not exist.
- [Helpers](https://docs.sommatic.ai/en/expressions/helpers.md): The helper functions an expression can call — JMESPath queries, defaults for empty values, slugs, query strings, Base64 and random ids — plus lodash, Luxon and the JavaScript built-ins.
- [Recipes](https://docs.sommatic.ai/en/expressions/recipes.md): Expression patterns that work in production workflows — reading earlier nodes, building typed objects, defensive conditions, dates in a time zone, safe URLs, defaults and lists — ready to copy into a node field.
- [Gotchas](https://docs.sommatic.ai/en/expressions/gotchas.md): The mistakes that most often break expressions in Sommatic AI workflows — object literals, fields that start and end with an expression, text conversion, wrapped code results, renamed nodes, literal braces — and how to avoid each one.
- [JSONata](https://docs.sommatic.ai/en/expressions/jsonata.md): Where Sommatic AI evaluates JSONata instead of JavaScript — data.transform and the conditions of flow.if and flow.switch written without braces — how to reference fields and run variables, and the differences that trip people up.
- [Handlebars](https://docs.sommatic.ai/en/expressions/handlebars.md): How data.template renders text with Handlebars — what data the template sees, the built-in helpers you can use, HTML escaping, and how later nodes read the rendered text.
- [JSON Schema](https://docs.sommatic.ai/en/expressions/json-schema.md): How data.validate checks a payload against a JSON Schema (draft-07) — the ports it opens, what the validator accepts, and the strict rules that make a schema fail before it validates anything.
- [Code nodes](https://docs.sommatic.ai/en/expressions/code-nodes.md): What code.js and code.python can use when they run — input, globals, logs, timeouts and output shape — and how to pass them data from other nodes and the run.

## Nodes

- [Nodes](https://docs.sommatic.ai/en/nodes.md): Every node a workflow can use, grouped by family, with its configuration, ports, contracts and implementation status.

## AI artifacts

- [AI artifacts](https://docs.sommatic.ai/en/ai.md): The AI artifacts Sommatic AI governs (LLM providers, prompt templates, knowledge resources, agents and tools) and how workflow nodes use them. Each one is a record of your organization, with an owner, a status and an API.
- [LLM providers](https://docs.sommatic.ai/en/ai/llm-providers.md): An LLM provider is one concrete model deployment registered in your organization. AI nodes reference it by id, and Sommatic AI resolves the endpoint and key on the server when the node runs.
- [Prompt templates](https://docs.sommatic.ai/en/ai/prompt-templates.md): A prompt template keeps instructions, a template body with placeholders, its variables, the expected output fields and examples in one record. The ai.prompt node fills it with workflow data.
- [Knowledge resources](https://docs.sommatic.ai/en/ai/knowledge-resources.md): A knowledge resource is governed content that AI nodes read, such as a taxonomy, a dataset or a policy. Publishing it records a numbered version, bindings show where it is used, and Git Sync can keep it in a repository.
- [Agents and tools](https://docs.sommatic.ai/en/ai/agents-and-tools.md): An agent profile defines how an agent behaves (model, prompt, allowed tools, limits) and a cognitive tool defines a capability an agent may call, with its schema, safety class and limits. Today both are governed definitions; no node runs an agent yet.
- [Memory and datasources](https://docs.sommatic.ai/en/ai/memory-and-datasources.md): A memory store describes where agents may keep context between runs, and an external datasource describes a data source they may query. Both declare what is allowed, by whom and for how long. Today they are governed definitions.

## Human in the loop

- [Human in the loop](https://docs.sommatic.ai/en/human-in-the-loop.md): A task is a contract between Sommatic AI and a person. The system provides context and evidence; the person provides a structured output that the task validates before it can be completed.
- [Task lifecycle](https://docs.sommatic.ai/en/human-in-the-loop/task-lifecycle.md): The statuses of a task, the transitions that move it between them and what each transition checks or changes, including the output validation on complete.
- [Notifications](https://docs.sommatic.ai/en/human-in-the-loop/notifications.md): How people learn about their tasks. A server-sent event stream pushes new tasks to their assignee, and the React SDK turns task events into toasts with actions, including due-soon and overdue reminders.

## Apps

- [Apps](https://docs.sommatic.ai/en/apps.md): An app is a real React application, versioned and hosted by App Engine, that gives people an operational surface. It declares where it can open, what input it expects and what output it returns.
- [Runtime SDK](https://docs.sommatic.ai/en/apps/runtime-sdk.md): The sdk prop App Engine passes to every app. Session, input, context and identity; data, files, people and notifications; navigation; and the calls that end a session with or without output.
- [Launch modes](https://docs.sommatic.ai/en/apps/launch-modes.md): A launch mode says where and why an app was opened, from the launcher to a task or the Command Center. Apps declare the modes they support in the manifest and adapt their layout to the current one.
- [Contracts](https://docs.sommatic.ai/en/apps/contracts.md): Every app declares what it receives and what it returns as two JSON Schema files. The input contract shapes sdk.input; the output contract is the payload of sdk.submitOutput that tasks, workflows and other apps rely on.
- [Apps in workflows](https://docs.sommatic.ai/en/apps/workflow-bridge.md): How apps and workflows meet today. A task can carry an app that collects its output, and the sommatic.app.handoff node ends a run by handing its result to an app through a task.

## Git Sync

- [Git Sync](https://docs.sommatic.ai/en/git-sync.md): Keep workflows and knowledge resources as files in a Git repository and load them into Sommatic AI from one branch per installation. Changes travel through pull requests; Sommatic AI reads, previews and applies, and never writes to the repository.
- [Packages](https://docs.sommatic.ai/en/git-sync/packages.md): A package is any folder of the repository with a sommatic.json manifest. The manifest lists the workflows and knowledge resources of the package, each with a stable logical key and a file path.
- [Environments and tokens](https://docs.sommatic.ai/en/git-sync/environments-and-tokens.md): An environment file holds what changes between installations (the branch, variables, resource ids and where to read secrets). Resource files reference those values with tokens that Sommatic AI resolves when it syncs, not at runtime.
- [Resource files](https://docs.sommatic.ai/en/git-sync/resource-files.md): Each workflow or knowledge resource is one JSON file with a sommatic header. Workflows use the studio export format with stable node ids; runtime fields are never stored.
- [Preview and apply](https://docs.sommatic.ai/en/git-sync/preview-and-apply.md): Preview resolves a package or a resource at the head of the branch and shows what would change, without writing. Apply writes exactly the commit you previewed, skips what did not change and can publish new versions.
- [Export and unlink](https://docs.sommatic.ai/en/git-sync/export-and-unlink.md): Export turns a Sommatic AI workflow or knowledge resource into a repository file with tokens, ready for a pull request. Unlink stops syncing one resource in one installation without touching the repository.
- [Branches and CI](https://docs.sommatic.ai/en/git-sync/ci.md): Move changes from feature branches to development, qa and main through pull requests, and validate every pull request against the public JSON Schemas before anything reaches an installation.
- [Playbook for coding agents](https://docs.sommatic.ai/en/git-sync/agents.md): A complete procedure for coding agents that write Sommatic AI workflows as files. Read the contract, edit with stable node ids and tokens, register the resource, validate, open a pull request and, when allowed, preview and apply.

## Command Center

- [Command Center](https://docs.sommatic.ai/en/command-center.md): The Command Center lets people operate your app through explicit commands, and optionally through natural language that a model turns into a plan of those same commands.
- [Add the Command Center to your app](https://docs.sommatic.ai/en/command-center/integration.md): Mount the Command Center in a React app with three providers, register its commands, and make each page operable with a co-located *.sommatic.jsx file.
- [Omnisearch](https://docs.sommatic.ai/en/command-center/omnisearch.md): Omnisearch is one search box for records and commands. Configure the categories it searches, the shortcuts it answers to, and how it hands a request to the Command Center.

## SDKs

- [SDKs](https://docs.sommatic.ai/en/sdks.md): The React SDK, @sommatic/react-sdk, brings Sommatic AI into your web app - services for the API, real-time streams, the Command Center, the workflow canvas and task components.
- [Configuration](https://docs.sommatic.ai/en/sdks/react/configuration.md): Point the React SDK at your backend with configureSommatic, send a Veripass token with each service, and tune timeouts and debug logs.
- [Services](https://docs.sommatic.ai/en/sdks/react/services.md): Service classes of the React SDK - one per API resource, all built on BaseApi - and the stream classes that follow runs and task assignments over server-sent events.
- [Components](https://docs.sommatic.ai/en/sdks/react/components.md): React components of the SDK - the Command Center panel, chat, the workflow canvas and its live console, task views, task notifications and knowledge resource editors.
- [Hooks](https://docs.sommatic.ai/en/sdks/react/hooks.md): React hooks of the SDK - the Command Center and its registration hooks, the task inbox, real-time task events, deadline monitoring, the run console and notification preferences.

## API

- [API](https://docs.sommatic.ai/en/api.md): The Sommatic AI REST API lets your systems design and publish workflows, start and follow runs, manage AI assets, resolve tasks and sync from Git. Base URL, groups and a first request.
- [Authentication](https://docs.sommatic.ai/en/api/authentication.md): Authenticate API requests with a Bearer token issued by Veripass for your organization. Webhooks authenticate through their own ingress binding instead.
- [Conventions](https://docs.sommatic.ai/en/api/conventions.md): The rules every endpoint follows - the response envelope, the queryselector segment of reads, pagination, writes and deletes, ids, timestamps and organization scope.
- [Errors](https://docs.sommatic.ai/en/api/errors.md): How the API reports a failure - the envelope with success false, the HTTP statuses you will see, common messages, and how to handle them and retry safely.

## Security

- [Security](https://docs.sommatic.ai/en/security.md): How Sommatic AI binds every operation to an identity and an organization, keeps secrets out of workflow definitions and records what each run did. Identity comes from Veripass; governance is built into the runtime.
- [Credentials](https://docs.sommatic.ai/en/security/credentials.md): A credential stores the secret of an external service once, encrypted. Nodes pick it by id and the orchestrator resolves it on the server when the node runs, so secrets never appear in a workflow, an expression or Git.
- [Audit](https://docs.sommatic.ai/en/security/audit.md): What Sommatic AI records so you can reconstruct any run. Who started it and from where, which version ran, what each node returned and which port it took, plus deployments from Git and credential use.

## Expression API reference

- [Expression API reference](https://docs.sommatic.ai/en/expressions/reference.md): Every variable and helper an expression can use, with its signature, arguments, return value, errors and examples run against the engine Sommatic AI runs.
- [Input Data](https://docs.sommatic.ai/en/expressions/reference/input-data.md): The data that reached the current node.
- [Input Access](https://docs.sommatic.ai/en/expressions/reference/input-access.md): The same input in item form: the current item and the list of items.
- [Node Reference](https://docs.sommatic.ai/en/expressions/reference/node-reference.md): The output of any node that already ran in this execution, the previous node and the entry point of a chained workflow.
- [Execution Context](https://docs.sommatic.ai/en/expressions/reference/execution-context.md): Ids of the current run, the workflow and the node being executed, and the environment.
- [Date & Time](https://docs.sommatic.ai/en/expressions/reference/date-time.md): The current moment and today, as Luxon DateTime values.
- [Generators](https://docs.sommatic.ai/en/expressions/reference/generators.md): New random identifiers.
- [Encoders](https://docs.sommatic.ai/en/expressions/reference/encoders.md): Base64 and URL query strings.
- [Validators](https://docs.sommatic.ai/en/expressions/reference/validators.md): Checks on values.
- [Helpers](https://docs.sommatic.ai/en/expressions/reference/helpers.md): Defaults for empty values, slugs, JMESPath queries and lodash.
- [JavaScript Globals](https://docs.sommatic.ai/en/expressions/reference/javascript-globals.md): The standard JavaScript functions and objects an expression can use (Math, JSON, text, numbers, lists, objects, dates, regular expressions, Intl), with what each returns, and the Node APIs that do not exist.
- [lodash](https://docs.sommatic.ai/en/expressions/lodash.md): Every lodash function available as `_` inside expressions: arrays, collections, objects, strings and more, in the exact version Sommatic AI runs.
- [Luxon dates](https://docs.sommatic.ai/en/expressions/luxon.md): Dates and times with Luxon: `$now` and `$today` are Luxon DateTime values, so every method below works on them.
- [JMESPath](https://docs.sommatic.ai/en/expressions/jmespath.md): Query JSON with JMESPath through `$jmespath(data, query)`: filters, projections and the built-in functions listed here.
- [JSONata functions](https://docs.sommatic.ai/en/expressions/jsonata-functions.md): The built-in functions of JSONata, the language that `data.transform` and the expression fallback of flow nodes use.

## Node reference

Each family lists its nodes; each node page (`/en/nodes/<slug>.md`) has how it runs, its config, ports with data, errors, the node JSON for a workflow and the full definition.

- [Triggers](https://docs.sommatic.ai/en/nodes/family/triggers.md): cron.trigger, event.trigger, manual.trigger, queue.trigger, webhook.trigger, workflow.trigger
- [Flow control](https://docs.sommatic.ai/en/nodes/family/flow.md): flow.if, flow.join, flow.mutex, flow.rate.limit, flow.split, flow.switch, flow.try, flow.wait, flow.window
- [AI](https://docs.sommatic.ai/en/nodes/family/ai.md): ai.archive.decompress, ai.classify, ai.classify.registry, ai.classify.triage, ai.compare, ai.compliance.check, ai.compose, ai.decision, ai.deep.extract, ai.docx.extract.text, ai.email.parse, ai.embed, ai.enrich, ai.entity.extract, ai.extract, ai.generate, ai.html.extract.text, ai.intent, ai.keyphrases, ai.language, ai.legal.extract.structured-multi-pass, ai.multimodal.extract.text, ai.multimodal.extract.text.cascade-pipeline, ai.ocr, ai.ocr.adaptive, ai.parse.document, ai.pdf.extract.text, ai.pptx.extract.text, ai.prompt, ai.qa, ai.rag.compose, ai.rag.retrieve, ai.relation.extract, ai.rewrite, ai.safety.filter, ai.safety.scan, ai.score, ai.sentiment, ai.summarize, ai.topics, ai.transcribe, ai.translate, ai.vector.search, ai.vector.upsert, ai.xlsx.extract.text
- [Data](https://docs.sommatic.ai/en/nodes/family/data.md): data.chunk, data.convert.to.pdf, data.datetime, data.lookup, data.math, data.parse, data.stringify, data.template, data.transform, data.uuid, data.validate
- [Input and output](https://docs.sommatic.ai/en/nodes/family/io.md): io.desktop.clipboard, io.desktop.input, io.desktop.notify, io.desktop.open, io.desktop.screenshot, io.ftp, io.graphql, io.grpc, io.http, io.imap, io.jsonrpc, io.local.file, io.local.shell, io.mqtt, io.smtp, io.soap, io.ssh, io.websocket
- [Integrations](https://docs.sommatic.ai/en/nodes/family/integrations.md): integrations.aws.s3.storage, integrations.microsoft.azure.blob, integrations.microsoft.azure.cosmos, integrations.microsoft.azure.document-intelligence, integrations.microsoft.azure.speech, integrations.microsoft.sqlserver.query, integrations.mongodb.operation, integrations.openai.gpt-4o.vision, integrations.oracle.mysql.query, integrations.postgresql.query, integrations.redis.command
- [Connectors](https://docs.sommatic.ai/en/nodes/family/connectors.md): connectors.microsoft.outlook.attachments, connectors.microsoft.outlook.mail, connectors.microsoft.outlook.message.category, connectors.microsoft.outlook.trigger, connectors.microsoft.outlook.trigger.multi
- [Human in the loop](https://docs.sommatic.ai/en/nodes/family/hitl.md): human.approval.gate, human.task.create, sommatic.app.execute, sommatic.app.handoff, stoneos.industry.apply
- [Identity](https://docs.sommatic.ai/en/nodes/family/identity.md): consent.check, crypto.decrypt, crypto.encrypt, crypto.hash, pii.redact, token.inspect, token.issue, veripass.evaluate
- [Operations](https://docs.sommatic.ai/en/nodes/family/ops.md): audit.append, metrics.emit, ops.checkpoint, ops.dedupe, ops.state.read, ops.state.write, ops.trace.end, ops.trace.start, saga.begin, saga.compensate, vectry.log
- [Code](https://docs.sommatic.ai/en/nodes/family/code.md): code.js, code.python, code.shell
- [Composition](https://docs.sommatic.ai/en/nodes/family/workflow.md): workflow.chain

## Optional

- [llms-full.txt](https://docs.sommatic.ai/llms-full.txt)
- [Docs MCP server (when available)](https://docs.sommatic.ai/mcp)
