Skip to Content
πŸŽ‰ Scout Docs 2.0 is here!
AgentsAgent Blocks

Agent Blocks in Workflows

Workflows are great for predictable, repeatable automation. But real data is messy. Agent Blocks let you drop an AI agent into any workflow step so you can handle the unpredictable without building complex branching logic.

What are Agent Blocks?

Agent Blocks let you run AI agents as steps within a workflow. You get the repeatability of structured workflows and the judgment of an AI agent in the same automation.

Instead of rigid if/then logic, an Agent Block can:

  • Analyze data and make intelligent decisions
  • Handle variations and unexpected inputs
  • Extract information from unstructured text
  • Generate personalized content
  • Route work to the right destination

Before you start: You’ll need at least one agent built in Scout before you can use Agent Blocks. See Getting Started with Agents to create your first agent.

When to Use Agent Blocks

Processing Unstructured Data

When a webhook receives data that doesn’t follow a predictable format:

Trigger: New email arrives ↓ Agent Block: Analyze email, extract sender intent, urgency and key information ↓ Condition: Route based on agent's analysis β”œβ”€ Urgent β†’ Create high-priority ticket β”œβ”€ Sales inquiry β†’ Forward to CRM └─ General β†’ Auto-respond and archive

Intelligent Routing

Let an agent decide where data should go:

  • Categorize support tickets by topic and assign to the right team
  • Evaluate leads and route to appropriate sales rep
  • Analyze feedback and tag for product, engineering or marketing

Content Generation

Create personalized content as part of an automation:

  • Generate custom email responses
  • Create meeting summaries from transcripts
  • Draft reports based on collected data

Research and Enrichment

Have an agent research and add context:

  • Webhook receives a new contact β†’ Agent researches company and enriches record
  • Lead comes in β†’ Agent finds relevant news and adds talking points
  • Customer mentioned β†’ Agent pulls recent activity for context

How Agent Blocks Work

Adding an Agent Block

  1. Open your workflow in the Scout workflow builder
  2. Click + to add a new block where you want the agent to run
  3. Select Agent Block from the block type list
  4. Choose an agent from your library using the Agent dropdown
  5. Write your instructions in the Prompt field β€” this is where you tell the agent what to do with the inputs it receives
  6. Map your inputs (from the trigger or previous blocks) using the input fields
  7. Set your output format: text, JSON or structured data

Input Configuration

Agent Blocks receive data from:

  • Workflow trigger β€” The initial event (webhook payload, schedule, etc.)
  • Previous blocks β€” Output from earlier workflow steps
  • Static values β€” Fixed parameters you define

Reference inputs using Jinja template syntax in your prompt:

Instructions: "Analyze this support ticket: {{ trigger.ticket_body }} Return JSON with category, urgency and suggested_action."

Output Handling

The agent’s response is available to subsequent blocks as agent_result:

// Reference agent output in later blocks {{ blocks.analyze_ticket.agent_result.category }} {{ blocks.analyze_ticket.agent_result.urgency }} {{ blocks.analyze_ticket.agent_result.suggested_action }}

When you ask the agent to return JSON, parse it with a JSON block before referencing individual fields downstream.

Example: Meeting Follow-up Workflow

Trigger: Webhook (meeting transcript received from video conferencing) ↓ Agent Block: Analyze Transcript Input: meeting_transcript Instructions: "Extract action items, decisions made and follow-ups. Identify owners and deadlines." ↓ Action Block: Create Tasks For each action item β†’ Create task in project management tool ↓ Agent Block: Draft Follow-up Email Input: meeting_summary, attendees, action_items Instructions: "Write a professional follow-up email summarizing the meeting and highlighting action items." ↓ Action Block: Send Email Send draft via Gmail to all attendees

The workflow runs the same way every time. The agents handle the nuance of each unique meeting.

Example: Lead Intelligence Workflow

Trigger: Webhook (new lead from website form) ↓ Agent Block: Research Company Input: lead_company_name Instructions: "Research this company. Find their industry, size, recent news and potential pain points our product could address." ↓ Action Block: Create CRM Record Create contact with enriched data ↓ Agent Block: Generate Outreach Input: research_findings, lead_info Instructions: "Write a personalized outreach email addressing their likely needs based on the research." ↓ Condition: Check Lead Score If high-value β†’ Notify sales rep immediately Otherwise β†’ Add to nurture sequence

Best Practices

Keep Agents Focused

Each Agent Block should do one thing well:

  • βœ… β€œExtract the purchase intent from this message”
  • ❌ β€œAnalyze everything about this customer and decide what to do”

Chain multiple focused Agent Blocks instead of one complex agent.

Define Clear Outputs

Structure your agent instructions to return predictable formats:

Instructions: "Analyze this support ticket. Return JSON with: - category: one of [technical, billing, feature-request, other] - urgency: one of [low, medium, high, critical] - summary: 1-2 sentence summary - suggested_action: what should happen next"

This makes the output easy to use in subsequent workflow blocks.

Handle Edge Cases

Agents can get it wrong. Add fallback logic to catch bad outputs:

Agent Block β†’ Condition Block (was output valid?) β”œβ”€ Yes β†’ Continue workflow └─ No β†’ Route to human review queue

Use Agent Instructions as Configuration

Treat agent instructions like workflow configuration. Be specific about:

  • What input the agent receives
  • What format the output should be
  • Any constraints or preferences

Limitations

  • Agent Blocks run synchronously by default. For long-running tasks (research, multi-step analysis), consider breaking the work into smaller blocks or using async interactions
  • Complex tasks that take more than a few seconds should be split across multiple focused Agent Blocks
  • For purely deterministic logic, use Condition Blocks instead β€” they’re faster and cheaper

Next Steps


Built with ❀️ by Scout OS

Last updated on