Skip to main content
Blocks are the units of execution in a Scout workflow. Each block takes inputs, performs exactly one job, and produces structured output that downstream blocks can reference. Chain them together and you get a workflow that’s easy to read, test, and debug — because every step is isolated and inspectable on its own.

How Blocks Work

Every block has three parts:
  • Inputs — values from the workflow’s trigger payload or a prior block’s output
  • Config — the block’s settings, such as a prompt, a URL, a condition expression, or a transformation rule
  • Output — a structured result the next block can reference by name
Reference any prior block’s output using double-brace syntax:
{{ block_id.output }}
For example, if you have an LLM block with the ID classify_ticket, the next block reads its result as {{ classify_ticket.output }}. You can also reference nested fields: {{ classify_ticket.output.urgency }}. Here is a simple three-block chain to illustrate the pattern:
Input Block        → accepts {{ inputs.user_query }} from the caller
LLM Block          → uses {{ inputs.user_query }} in its prompt; ID: summarize
Text/Output Block  → shapes the final response using {{ summarize.output }}
Name your blocks by what they do, not the tool they use. fetch_customer is more readable than http_1 when you’re tracing a failure in the logs six months later.

Block Types

Input and Output Blocks

Input

Defines the runtime payload fields that callers must provide when triggering the workflow. Every workflow starts with an Input block.

Text / JSON

Shapes or transforms data into a clean output format. Use this to restructure an API response or format a final return value.

HTTP

Calls any external REST API and returns the response body. Use this for any API that doesn’t have a dedicated integration block.

Save Document to Table

Persists workflow output to a Scout Database Table for later retrieval or search by agents and other workflows.

AI Processing Blocks

LLM / Reasoning

Generates text, answers questions, extracts structured data, or classifies inputs. Use this when the task requires language understanding.

Agent

Runs a fully configured Scout agent as a step inside your workflow. The agent uses its own tools, memory, and instructions to complete the task.

Web Search / Scrape

Pulls live context from the web. Use this to ground an LLM block in current information.

JavaScript

Runs custom logic when built-in block configuration isn’t sufficient. Use this for deterministic transformations that would be overcomplicated in a template.

Control Flow Blocks

Condition

Branches execution with if/else or switch logic based on any value in the workflow state.

Stop If

Ends the workflow immediately when a condition is true. Use this to short-circuit on invalid input or terminal errors.

Continue If

Proceeds only when a condition is met; otherwise skips the remaining blocks in that branch.

Delay

Adds a time-based pause between blocks. Useful for rate-limited APIs or workflows that need to wait for an external process.

Reduce

Iterates over a list and aggregates results. Use this to process arrays of items — records, tickets, leads — in a single workflow run.

Data and Integration Blocks

Query Database Table

Retrieves documents from a Scout Database — your internal knowledge base or stored workflow outputs.

Slack

Sends a message or creates a thread in any Slack channel or DM. Handles authentication and formatting for you.

Discord

Posts messages to Discord channels or direct messages without managing webhooks manually.

Twilio

Sends SMS messages or initiates calls via Twilio. Handles credentials and request signing automatically.

Choosing the Right Block

Use this reference table to select the right block for each step in your workflow.
SituationBlock to use
Accepting caller inputInput
Generating or analyzing textLLM or Reasoning
Calling a REST APIHTTP
Branching on a valueCondition
Stopping on an invalid stateStop If
Custom deterministic logicJavaScript
Storing results for later retrievalSave Document to Table
Sending a Slack messageSlack
Sending an SMSTwilio
Iterating over a listReduce
LLM vs. JavaScript — Use JavaScript when the logic is deterministic and testable with unit cases. Use LLM when the input is unstructured, ambiguous, or requires language understanding. HTTP vs. integration blocks — Integration blocks (Slack, Twilio, CRM) handle authentication and request formatting for you. Use HTTP for any other API. Condition vs. Stop If — Stop If ends the workflow immediately. Condition routes execution to different downstream branches and keeps the workflow running.

Agent Blocks: Embedding AI Judgment

An Agent Block lets you run a fully configured Scout agent as a single step in your workflow. This is the mechanism that allows you to combine the reliability of structured automation with the adaptability of AI. Use an Agent Block when:
  • A step requires reading and interpreting unstructured text
  • The right action depends on nuance that a simple condition can’t express
  • You want to reuse an existing agent’s capabilities inside a larger process
Here is an example of an Agent Block configuration for a support ticket triage workflow:
block: agent
id: triage_agent
agent_id: "support_triage_v2"
inputs:
  ticket_subject: "{{ inputs.subject }}"
  ticket_body: "{{ inputs.body }}"
  customer_tier: "{{ fetch_customer.output.tier }}"
output_key: triage_result
The block passes the relevant ticket fields to the agent. The agent responds with a structured decision — for example, { urgency: "high", queue: "engineering", draft_reply: "..." } — which downstream Condition and Action blocks can act on immediately.
Keep Agent Block inputs small and explicit. Pass only the fields the agent needs to make its decision — not the entire workflow state.

Condition Blocks: Branching Logic

A Condition Block evaluates an expression and routes execution to one of two or more downstream branches. Use it to handle different cases — different customer tiers, different ticket types, different API response codes — without duplicating the rest of your workflow.
block: condition
id: route_by_urgency
condition: "{{ triage_agent.output.urgency }}"
branches:
  high:
    next: escalate_to_engineering
  medium:
    next: assign_to_senior_support
  low:
    next: send_auto_reply
You can chain Condition blocks to handle complex routing trees. Keep each condition focused on a single decision to make the workflow readable.

Transform Blocks: Reshaping Data

Transform blocks (Text, JSON, and JavaScript blocks) restructure data between steps. Use them to:
  • Extract a specific field from a large API response
  • Rename keys to match a downstream block’s expected schema
  • Combine values from multiple prior blocks into a single object
  • Format a date, truncate a string, or compute a derived value
Here is a JavaScript Transform block that extracts and normalizes fields from a raw webhook payload:
// Block ID: normalize_payload
const raw = inputs.webhook_body;

return {
  ticket_id: raw.id,
  subject: raw.fields?.subject ?? "No subject",
  body: raw.fields?.description ?? "",
  customer_email: raw.reporter?.email?.toLowerCase(),
  created_at: new Date(raw.created).toISOString(),
};
Downstream blocks reference the normalized fields as {{ normalize_payload.output.ticket_id }}, {{ normalize_payload.output.subject }}, and so on.

Block Design Rules

Follow these rules to keep your workflows maintainable as they grow:
  • One responsibility per block. A block that fetches data should not also transform it. Split the jobs.
  • Name blocks by what they do. classify_urgency and fetch_customer are far more useful than llm_1 and http_2 when reading logs.
  • Guard expensive or irreversible actions. Place a Condition or Stop If block before any write operation, external API call with side effects, or message send.
  • Keep transformation chains explicit. Avoid long implicit data reshaping inside a prompt. Use a Transform block first so the LLM receives clean, predictable input.

Next Steps

Creating Workflows

Apply the validate-fetch-decide-act-return pattern when assembling your blocks.

Running Workflows

Execute your workflow and inspect block-level output in the Console.

Logs

Trace block-by-block execution and debug failures in production.

Environments

Promote your workflow safely from development to production.