Workflows

Chain your agents, conditions and HTTP calls into blocks that run in order. Design them on a canvas, run them with an input, and see every block's input and output.

Blocks

  • StartEvery workflow has one. It defines the inputs you fill in when you run it, such as message.
  • AgentSends a message to one of your agents and returns its reply. The agent runs exactly as it does in chat: same model, knowledge base, MCP tools, rate limit and usage.
  • Knowledge lookupSearches an agent's knowledge (documents, websites, snippets, Q&A) and returns the top matches as numbered passages, ready to drop into an agent's message. Empty when nothing matches.
  • MCP tool callCalls one tool on one of an agent's MCP servers with JSON arguments, and returns the tool's result.
  • ClassifySorts text into one of your labels using an agent's model and key, and continues down that label's path, or Other. The output has label and confidence.
  • ExtractPulls the fields you list (text, number, date, email or yes/no) out of text as JSON. Later blocks read them as {{steps.<id>.output.<field>}}. A missing required field stops the run, or takes a Missing path if you choose.
  • Guardrail checkChecks text against guardrails and continues down Pass or Fail, with the failing guardrails and reasons in the output. Built-in: PII (can redact instead), Prompt injection, Toxicity, Off-topic and Profanity. Add your own on the Guardrails tab of Workflows, or from the block: a rule judged by the agent's model, a pattern, or a word list.
  • Send emailSends an email from SentientOne with your name, replies going to your account email. Up to 5 recipients per email and 100 emails a day per account.
  • Slack messagePosts to a Slack channel through an incoming webhook. The webhook URL is kept secret and shown masked after saving.
  • WebhookPOSTs JSON to your URL, signed with the workflow's signing secret (see below).
  • ConditionTests a value (contains, equals, matches a pattern, is empty…) and continues from its True or False handle.
  • HTTP requestCalls a public URL (GET, POST, PUT, PATCH or DELETE) with headers and a JSON body. The response becomes the block's output; JSON responses can be read by key.
  • Set valueBuilds text or JSON from variables, for example to reshape an API response before the next block.
  • DelayWaits up to 30 seconds, then passes the previous output on unchanged.
  • EndReturns the workflow's output. You can have more than one, for example one per condition branch.

Build a workflow

  1. 1

    Create it

    Open Workflows and click New workflow. You start with Start connected to End.
  2. 2

    Add blocks

    Click a block in the Blocks list on the canvas (search it by name): it's added after the selected block, or before the End block, and connected for you. You can also drag blocks onto the canvas and connect them by dragging from a blue dot to the next block. Hover a connection and click × to remove it.
  3. 3

    Configure each block

    Click a block to edit it in the settings column on the right. Blocks with something to fix get a red outline; the toolbar shows how many are left to fix. Press Delete to remove the selected block or connection.
  4. 4

    Test, then publish

    Click Test run, fill in the inputs and click Run test. Each block lights up on the canvas as it runs, and the log below shows its input, output and duration. When it works, click Publish so live runs use it.

Agent knowledge and tools

Select an Agent, Knowledge lookup or MCP tool call block and open its Knowledge or Tools tab to manage that agent's documents, websites, snippets, Q&A and MCP servers without leaving the designer. These are the agent's own settings: changes show up on the agent's page and everywhere the agent is used.

Start a run from a webhook

Every workflow has a trigger URL, shown in the Start block. Create a token there (it's shown once), then POST a JSON body: it becomes the run's inputs, so {{input.order.id}} reads nested values. Only the published version runs; a draft answers 409. You get { run_id } straight away (HTTP 202), or the finished run with ?wait=true (up to 30 seconds). Bodies are limited to 100 KB and each workflow to 60 triggers a minute.

bash
curl -X POST 'https://<your app>/api/workflows/hooks/<workflow id>?wait=true' \
  -H "X-Workflow-Token: $WORKFLOW_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "message": "New order", "order": { "id": 42 } }'

Verify Webhook block requests

Create a signing secret in the workflow settings (click an empty part of the canvas); it's shown once. Each request carries X-SentientOne-Timestamp and X-SentientOne-Signature: sha256=<hex>, an HMAC-SHA256 of <timestamp>.<raw body> with your secret. Recompute it and compare in constant time.

javascript
import crypto from "crypto";

function verify(secret, timestamp, rawBody, signature) {
  const expected = "sha256=" + crypto.createHmac("sha256", secret).update(`${timestamp}.${rawBody}`).digest("hex");
  const a = Buffer.from(expected), b = Buffer.from(signature);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

Draft and published

A new workflow is a draft. Only a published workflow runs for real. The header shows where a workflow stands:

  • DraftOnly Test runs work. Live runs are refused with “This workflow is a draft. Publish it to run it.”
  • PublishedLive runs use the version you published. Click Publish, check the summary and confirm: the current version is saved and becomes the live one.
  • Published · changes not publishedYou've saved changes since publishing. Live runs keep using the published version until you publish again, so you can edit and test safely.

Publishing is blocked while any block has something to fix. To stop live runs, open the … menu next to Publish and choose Back to draft; your draft isn't changed.

Test run and live run

  • Test runThe designer's Test run button saves your draft and runs it, published or not. Test runs are marked Test in Past runs and can only be started from the designer.
  • Live runA run of the published version, started from the API with your API key. Live runs are marked Live in Past runs.

Start a live run with the workflow's id (it's in the designer's address) and the Start block's inputs. The response streams each block as it finishes; send "stream": false to wait and get the finished run as JSON instead.

bash
curl -X POST https://api.sentientone.ai/v1/workflows/run \
  -H "X-Api-Key: $SENTIENTONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow_id": "<workflow id>",
    "mode": "live",
    "input": { "message": "Where is my order?" },
    "stream": false
  }'

The JSON answer has run_id, status (succeeded or failed), output, error and total_tokens. A draft workflow returns HTTP 409 with the code WORKFLOW_NOT_PUBLISHED.

Variables

Text fields in a block can use variables. They're replaced with their values when the block runs:

text
{{input.message}}              an input from the Start block
{{last.output}}                the output of the block before this one
{{steps.agent_x1.output}}      the output of a specific block (its id is shown in its settings)
{{steps.http_k2.output.id}}    a key inside a JSON output

An unknown variable becomes empty text. In an HTTP body, values are escaped so the body stays valid JSON.

Limits

  • BlocksA run executes at most 25 blocks. Blocks can't loop back to an earlier block.
  • TimeAn agent block has 2 minutes, an MCP tool call 30 seconds, an HTTP block and a knowledge lookup 20 seconds, and a whole run a little under 5 minutes.
  • HTTPOnly public http and https addresses. Redirects aren't followed, and responses over 512 KB are refused.
  • RunsUp to 30 runs a minute and 5 at once per account (Test runs included). Over that, a run is refused with HTTP 429 and nothing is charged; wait a moment and run it again.
  • FailuresIf a block fails, the run stops there and the log shows which block failed and why.

Usage

Each Agent, Classify, Extract and Guardrail block is a normal agent reply: it costs 1 credit and appears in Analytics and Tracing like any chat message. A live run of a workflow that has an HTTP request, Webhook, Slack message or Send email block also costs 1 credit per run (Test runs from the designer don't). Out of credits, a run is refused before it starts with HTTP 402 OUT_OF_CREDITS: buy credits in Settings → Billing.