Runbook, Lead Qualification Agent
Example build: lead qualification for a marketing agency Platform: your own automation account
Overview
This automation runs Lead Qualification Agent on your own automation account. When the trigger fires it runs 5 steps, 2 of them automated decision steps, and delivers the result to HubSpot CRM + a Slack #leads channel. It runs unattended; your team only steps in for the reply/exception paths and the checks below.
Trigger, how work enters the automation
Event: HTTP POST from an external service (form, CRM event, ad platform) Source: Typeform, new lead form submission
Required input fields:
| Field | Required | Notes |
|---|---|---|
name |
Recommended | |
email |
Yes | |
company |
Recommended | |
use_case |
If used | |
budget |
Recommended | |
timeline |
If used |
Step-by-step operation
Step 1, Extract contact info (automated_step)
Runs prompt extract (fast-tier model) and returns JSON (name, email, company, use_case, budget, timeline).
Data: form_payload → contact_json
Step 2, Score lead (automated_step)
Runs prompt score (fast-tier model) and returns JSON (score, tier, reason).
Data: contact_json, use_case, budget → score_json
Step 3, Route by score (conditional)
Branches on score_json.tier == 'high'.
Data: score_json → routed
Step 4, Create HubSpot contact (api_call)
HubSpot: create_contact Data: contact_json, score_json → crm_id
Step 5, Slack alert (high score) (notification)
Slack: post_message Data: contact_json, score_json → ,
Field maps, connected systems
| Tool | Action | Auth |
|---|---|---|
| HubSpot | create_contact | api_key |
| Slack | post_message | oauth |
| Typeform | webhook_trigger | webhook_secret |
Failure & alert paths
- Processing timeout or rate-limit → Retry up to 3 times with exponential backoff; alert on final failure.
- Invalid or empty step output (output does not match expected format) → Log raw output; route to human review queue; send Slack/email alert.
- External API call fails (non-2xx response) → Catch error, log payload, notify team, halt step (do not skip silently).
- Missing required input field → Halt workflow; return error to trigger source with field name.
What to monitor
- Output quality, spot-check that each automated decision step still returns the expected format on a few real records.
- Latency: execution time per run stays within the acceptance bar (a few seconds per automated step, up to 15s for heavier steps).
- Processing cost, watch for prompt drift or oversized inputs inflating usage.
- Integration health: CRM/Slack/API steps returning 2xx, no silent skips.
- Human-review queue: items routed there on invalid output are being actioned, not piling up.
Routine maintenance
- Review the execution log for failed or retried runs.
- Confirm every automated step’s output still parses (schema hasn’t drifted).
- Check the error-alert channel is still receiving test alerts.
- Re-run any runs that halted on an external API failure.
Updating the automation
- To change what an automated decision step does: edit its prompt in
prompt_registry.md, update the node’s system/user text in the tool, and re-run the acceptance checks for that step before go-live. - To add a step: add it to the process map, register any new prompt, then extend the acceptance checklist.
- To pause: disable the trigger in the platform: in-flight runs finish, no new runs start.
- Never edit a live prompt without re-running its acceptance check, a bad prompt fails silently on real data.
Ongoing support
Ongoing maintenance covers: prompt updates as your ICP/offer/process changes, adding new steps as the workflow grows, monitoring execution logs and output quality, tuning alerts, and latency/cost optimization.
