# Agent Blocks: Run Agents as Workflow Steps Source: https://docs.scoutos.com/agents/agent-blocks Embed Scout agents as steps inside a workflow. Process unstructured data, route intelligently, generate content, and pass results to downstream blocks. Agent Blocks are the bridge between [Agents](/agents/overview) and [Workflows](/workflows/overview). A workflow gives you reliable, repeatable structure — triggers, branching, and integrations that run the same way every time. An agent gives you judgment — the ability to read messy input, reason about it, and decide what to do. An Agent Block lets you drop that judgment into any step of a workflow, so the structured parts stay deterministic while the hard parts get handled by an AI agent. Agent Blocks run an agent you've already built in Scout. If you don't have one yet, start with [Getting Started with Agents](/agents/getting-started) and come back once you have an agent to embed. ## When to Use an Agent Block Reach for an Agent Block whenever a step needs to interpret something rather than follow a fixed rule. **Processing unstructured data.** Pull intent, urgency, and key details out of an incoming email, support ticket, or document — text that has no fixed schema and can't be parsed with a condition. **Intelligent routing.** Categorize tickets, score and qualify leads, or tag feedback so downstream blocks can branch on the result. **Content generation.** Draft a follow-up email, summarize a meeting, or produce a report from the data the workflow has gathered so far. **Research and enrichment.** Research a company, surface recent news, or assemble context about a contact before the workflow records or acts on it. If a step is purely deterministic — "route to engineering when `priority == 1`" — use a [Condition Block](/workflows/blocks) instead. Agent Blocks are for the steps that genuinely need language understanding or judgment. ## How Agent Blocks Work ### Adding a block Open the workflow where you want to add AI judgment, and click the **+** to add a new block. Choose **Agent Block** from the block picker, then select which of your agents should run at this step. Give the agent its instructions for this step and map in the inputs it needs (see below). Choose how the agent should return its result — plain text, JSON, or structured data — based on what downstream blocks expect. ### Configuring inputs An Agent Block can draw its inputs from three sources: * **The workflow trigger** — data from the event that started the run, e.g. `{{ trigger.ticket_body }}` * **Previous blocks** — output from any block earlier in the workflow * **Static values** — fixed text or configuration you type directly You reference dynamic inputs with Jinja template syntax. For example, to pass the body of an incoming ticket into the agent: ```text theme={null} {{ trigger.ticket_body }} ``` Keep inputs small and explicit. Pass only the fields the agent needs to make its decision — not the entire workflow state. Focused inputs produce more reliable results and make the workflow easier to debug. ### Handling output The agent's response is available to downstream blocks as `agent_result`, referenced through the block's name. If an Agent Block named `analyze_ticket` returns a structured result, later blocks can read individual fields: ```text theme={null} {{ blocks.analyze_ticket.agent_result.category }} {{ blocks.analyze_ticket.agent_result.urgency }} {{ blocks.analyze_ticket.agent_result.suggested_action }} ``` When an agent returns JSON, parse it with a JSON block before referencing individual fields downstream. That guarantees later blocks receive clean, structured data instead of a raw string. ## Example: Meeting Follow-up Workflow This workflow turns a raw meeting transcript into tracked tasks and a drafted follow-up email — without anyone reviewing the transcript by hand. A webhook receives the meeting transcript when the call ends. An agent reads the transcript and extracts action items, decisions, and follow-ups, assigning an owner and deadline to each. An Action Block creates a task in your project tool for each action item the agent returned. A second agent drafts a follow-up email summarizing the decisions and next steps. An Action Block sends the draft through Gmail to the meeting attendees. The workflow runs the same way every time, while the agents absorb the nuance of each individual meeting — different attendees, different decisions, different follow-ups. ## Example: Lead Intelligence Workflow This workflow enriches a new lead, records it, and routes it based on its value — combining research, a CRM write, content generation, and branching in a single run. A webhook fires when a new lead submits a form. An agent researches the lead's company and assembles context: size, industry, recent news, and a lead score. An Action Block creates a CRM record populated with the enriched data. An agent generates a personalized outreach email tailored to the company and its context. A Condition Block checks the lead score: high-value leads notify a sales rep immediately, while the rest enter a nurture sequence. ## Best Practices **Keep agents focused.** One task per block. Chain several focused Agent Blocks rather than asking a single agent to do everything — focused agents are more accurate and far easier to debug when something goes wrong. **Define clear outputs.** Tell the agent exactly what format to return, ideally JSON with named fields like `category`, `urgency`, `summary`, and `suggested_action`. Predictable output is what makes downstream blocks reliable. **Handle edge cases.** Add a Condition Block after the agent to catch invalid or low-confidence output and route it to a human review queue instead of letting the workflow act on a bad result. **Use instructions as configuration.** Be specific in the prompt about the inputs, the required output format, and any constraints. The prompt is how you tune an Agent Block's behavior for its place in the workflow. ## Limitations * **Agent Blocks run synchronously by default.** The workflow waits for the agent to finish before moving to the next block. * **Split long tasks.** Complex work that takes more than a few seconds should be broken across multiple blocks, or handled with [async interactions](/agents/getting-started) so the workflow isn't blocked. * **Use Condition Blocks for deterministic logic.** If a decision doesn't require judgment, a Condition Block is faster and more predictable than an agent. *** ## Next Steps See how triggers, blocks, and branching fit together. Explore every block type you can combine with Agent Blocks. Build and configure the agents you embed in workflows. Coordinate multiple agents on a single complex task. # Agent Versioning: Git for Agents, Without the Commands Source: https://docs.scoutos.com/agents/agent-versioning Scout versions every change to your agents. Test changes in isolation, promote the best version to production in one click, and roll back instantly. Agent Versioning is version control built into Scout. Every time you change an agent, Scout captures a new version automatically — so you can experiment freely, test changes without touching production, and roll back the moment something goes wrong. It's the safety net that lets you iterate on live agents with confidence. * **Automatic versioning** — every edit creates a new version, no manual saves of "v2-final-final" required * **Version isolation** — test changes without affecting the version your users see * **One-click promotion** — make any version the production version instantly * **Instant rollback** — revert to a previous version in seconds Each version is its own agent ID, and the **active** version is the one designated for production. ## The Problem It Solves Agent configurations are complex. A single agent ties together prompts, model parameters, database connections, workflows, skills and integrations, permissions, and scheduling. Change one prompt to fix an edge case and you might quietly break three others. Without version control, teams resort to workarounds: duplicating agents, copy-pasting configs into documents, or simply hoping the last change was an improvement. Agent Versioning replaces all of that with systematic change tracking and one-click rollback — no workarounds needed. ## Demo