Blocks
Blocks are the units of execution in a workflow. Each block takes inputs, does one job, and produces output that downstream blocks can use. Chain them together and you get a workflow thatβs easy to read, test and debug.
How a block works
Every block has three parts:
- Inputs β values from the workflow payload or a prior blockβs output
- Config β the blockβs settings (prompt, URL, condition, etc.)
- Output β a structured result the next block can reference
You reference a prior blockβs output using {{block_id.output}}. For example, if you have an LLM block with ID summarize, the next block can read its result as {{summarize.output}}.
A simple three-block chain looks like this:
- Input block β accepts
{{inputs.user_query}}from the caller - LLM block (
summarize) β uses{{inputs.user_query}}in its prompt - Text block β shapes the final response using
{{summarize.output}}
See Logic and State for full details on how state moves between blocks.
Block categories
Input and output
- Input β defines the runtime payload fields callers must provide
- Text / JSON β shapes or transforms data into a clean output format
- HTTP β calls external APIs and returns the response
AI processing
- LLM / Reasoning β generates text, answers questions, extracts structure
- Web Search / Scrape β pulls live context from the web
- JavaScript β runs custom logic when built-in block config isnβt enough
If a decision needs to be made dynamically at runtime by an agent, use Agent Code Execution instead of a static block.
Control flow
- Conditional / Continue If / Stop If β branch based on a value or condition
- Delay β adds a time-based pause (useful for rate-limited APIs)
- Reduce β iterates over a list and aggregates results
Data and integrations
- Query Collection Table β retrieves documents from Scoutβs internal knowledge base
- Save Document to Table β persists workflow output for later retrieval
- Slack / Discord / Twilio / CRM blocks β push actions into external tools
Choosing the right block
| Situation | Block to use |
|---|---|
| Accepting caller input | Input |
| Generating or analyzing text | LLM or Reasoning |
| Calling a REST API | HTTP |
| Branching on a value | Conditional |
| Custom logic that config canβt express | JavaScript |
| Storing results for retrieval later | Save Document to Table |
| Sending a message to a user | Slack, Discord or Twilio |
A few common trade-offs:
- LLM vs. JavaScript β Use JavaScript when the logic is deterministic and testable. Use LLM when the input is unstructured or requires judgment.
- HTTP vs. integration blocks β Integration blocks (Slack, Twilio, etc.) handle auth and formatting for you. HTTP is for any other API.
- Conditional vs. Stop If β Stop If ends the workflow immediately. Conditional routes to different branches and keeps going.
Block design rules
- Keep each block focused on one responsibility
- Name blocks by what they do, not the tool they use (e.g.,
fetch_customernothttp_1) - Add guard conditions before expensive or irreversible actions
- Avoid long implicit chains β keep transformations explicit so theyβre easy to trace in the Console
Next steps
- Logic and State: Connect outputs safely across blocks
- Jinja Templates: Build dynamic block inputs
- Console: Inspect each block run in real time
Last updated on