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 archiveIntelligent 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
- Open your workflow in the Scout workflow builder
- Click + to add a new block where you want the agent to run
- Select Agent Block from the block type list
- Choose an agent from your library using the Agent dropdown
- Write your instructions in the Prompt field β this is where you tell the agent what to do with the inputs it receives
- Map your inputs (from the trigger or previous blocks) using the input fields
- 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 attendeesThe 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 sequenceBest 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 queueUse 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
- Workflows Overview β Learn more about workflow fundamentals
- Agents β Build agents to use in your workflows
- Async Interactions β Run long agent tasks without blocking your workflow
- Getting Started β Start building your first workflow
Built with β€οΈ by Scout OS