Lead Distro AILead Distro AI
DocsAutomationsAutomation Basics

Automation Basics

Automate your workflows with triggered webhooks, emails, Slack messages, and Google Sheets updates on every lead, call, and destination event. Full automation guide for Lead Distro AI.

Last updated:

What are Automations?

Automations are actions that fire automatically when a lead event occurs. They run in the background and never block the lead distribution flow.

Trigger Events

Triggers come in three families. Lead triggers fire on a lead campaign, call triggers fire on a Calls campaign, and destination triggers fire on a destination's own account activity.

Lead triggers

  • Lead Ingested (lead.created) — every new lead received, before routing.
  • Lead Accepted (lead.accepted) — the lead was sold to a destination.
  • No destination took the lead (lead.rejected): any lead that did not sell, for any reason. Covers the next three triggers. {{no_sale_type}} says which one (rejected, unsold or error).
  • Destination Rejected the Lead (lead.destination_rejected): at least one destination got the lead and turned it down, and none bought it. To act on one destination only, add the condition Rejected by Destination Includes that destination. {{rejected_by}} lists the names of every destination that said no.
  • Lead Unsold (lead.unsold): no destination could take it, so it was never sent (caps full, filters, hours, paused, none set up).
  • Lead Delivery Error (lead.delivery_error): something broke while sending, like a timeout or a bad delivery URL.
  • Lead Returned (lead.returned): a destination returned a lead it bought (a partial return on a shared lead counts), or someone set it to Returned. {{return_reason}} holds the reason.
  • Duplicate Detected (lead.duplicate) — the lead matched an existing record.
  • Lead Converted (lead.converted) — the destination marked it converted.
  • Not Qualified (lead.not_qualified) — the destination marked it not qualified.
  • Status Changed (lead.status_changed) — any manual status change on a lead.
  • Outcome Stage Changed (lead.outcome_stage_changed) — the lead moved stages; you can limit it to specific stages.
  • Lead Queued (lead.queued) — a queue rule held the lead for later release.
  • Lead Reached X Days Old (lead.aged) — fires once when a lead passes the age you set, for reselling aged leads. Needs Track Lead Age on in campaign settings.

Call triggers (Calls campaigns)

  • Call Connected (call.connected) — a destination just answered. Fires while the call is live, carrying the caller's info including any pre-call data, so you can email or webhook the details to the destination in real time.
  • Pre-Call Data Received Late (call.enriched) — a source posted caller info through the Enrich API after the call had already started. Fires again with the updated info so nothing is missed.
  • Call Completed (call.completed) — a call connected to a destination and ended normally.
  • Call Qualified (call.qualified) / Call Not Qualified (call.not_qualified) — the destination marked the call.
  • Call No Answer (call.no_answer) — no destination picked up.
  • Call Billable (call.billable) — a destination was charged for the call.
  • Call Refunded (call.refunded) — a billable call was refunded or returned, so the charge should be reversed. The payload still carries the original amount.

Destination triggers

  • Wallet Balance Below $X (buyer.wallet_balance_below) — a destination's wallet dropped below your threshold.
  • Cap Reached X% (buyer.cap_threshold_reached) — a destination's lead or budget cap crossed your percentage.
  • Destination Paused Delivery (buyer.delivery_paused) / Destination Resumed Delivery (buyer.delivery_resumed) — a destination paused or resumed their own delivery from the Partner Portal.
  • Destination Error Spike (buyer.delivery_failing) / Destination Recovered (buyer.delivery_recovered): Leads campaigns only. A destination stopped taking leads (its last 5 deliveries failed, or its last 3 over at least an hour if it gets few leads), or it took leads again afterward. Fires for every destination on the campaign; add a Destination condition to watch just one. With Destination Error Spike on in Settings, Notifications (on by default), we also email you (and post to your Slack, if connected) when it goes down and when it is back.

Action Types

ActionWhat It Does
WebhookSends a POST (or PUT / GET) with the full payload to any URL, with your own headers and body template.
EmailSends an email to any address, with a subject and rows you build from merge fields.
SlackPosts a message to a Slack channel via an incoming webhook URL.
Google SheetAppends a row to a connected Google Sheet.
Re-distributeSends the lead to another campaign or destination. Lead triggers only — it self-skips on call and destination triggers.

Webhook Success Response

Some systems answer 200 OK even when they refuse the data, with the real answer inside the reply (for example {"status":"ERROR"}). On a Webhook action, turn on Success Response to say what a good reply looks like. With it off, any 200-level reply counts as a success.

  • Reply contains: the send is a success only when the reply holds a word or phrase you type, such as ACCEPTED. Upper and lower case do not matter.
  • Reply field: read one field from a JSON or XML reply (for example status, or result.code for a nested one) and compare it: is, contains, is not, or is present.
  • A reply that does not match is logged as a failed send in the Delivery Logs, with the reason. A reply that is not 200-level is always a failed send.

Testing an Automation

Webhook, Email and Slack actions have a Send Test button. Test Payload Data lists only the fields your message or body uses, each with a sample value you can change. Click Show all fields to see every field on the campaign.

  • Your test values are kept. They are saved with the automation, remembered in your browser after each test, and they fill in the other automations on the same campaign, so you type a sample lead once.
  • A webhook test sends exactly what a real send would. A {{field}} with no value goes out blank, and values are escaped so a quote cannot break the JSON.
  • A field marked "Not a campaign field" is a {{field}} in your body that the campaign does not have. A real send leaves it blank unless the lead carries it, so check the spelling.
  • A red line under the JSON body means the body is not valid JSON (often a missing quote or an extra comma). Fix it before you go live: the receiving system will reject it.
  • With Success Response on, the test result says whether the reply counted as a success, the same verdict a real send would get.

Conditions

Add conditions to automations so they only fire when specific criteria are met — for example, only send a Slack notification when a lead from California is accepted.

Use the AI Assistant to set up automations conversationally — just say "Set up a Slack notification when a lead is accepted" and it will handle the configuration.

Frequently Asked Questions

What events can trigger an automation?
Three families. Lead events (lead.created, lead.accepted, lead.rejected, lead.destination_rejected, lead.unsold, lead.delivery_error, lead.returned, lead.duplicate, lead.converted, lead.not_qualified, lead.status_changed, lead.outcome_stage_changed, lead.queued, lead.aged), call events on a Calls campaign (call.connected, call.enriched, call.completed, call.qualified, call.not_qualified, call.no_answer, call.billable, call.refunded), and destination events (buyer.wallet_balance_below, buyer.cap_threshold_reached, buyer.delivery_paused, buyer.delivery_resumed, plus buyer.delivery_failing and buyer.delivery_recovered on Leads campaigns). Automations are decoupled from distribution: they run in the background and never block delivery.
What action types are supported in automations?
Five: Webhook (POST/PUT/GET to any URL with the full payload), Email (to any address, with merge fields in the subject and rows), Slack (post to a channel via an incoming webhook URL), Google Sheet (append a row to a connected sheet), and Re-distribute (send the lead to another campaign or destination — lead triggers only). Multiple automations can fire from one event — a single lead.accepted can notify Slack, update a Sheet, and post to a CRM webhook at the same time.
My destinations hit their daily caps. How do I hold the extra leads and send them later?
Two ways. For leads already turned away: on the Leads page, select them, click Reprocess, choose Same campaign (reprocess), then At a time and pick when. They show as Queued until then and go out within 15 minutes of that time. Up to 500 at once; Now sends up to 50 right away. For new overflow, automatically: add an automation with the trigger No destination took the lead, the condition Error Group is Destination Cap(s) Reached, and the action Re-distribute to the same campaign with Schedule for later set to Daily at a fixed time (for example 8:00 AM). Caps reset daily, so a short delay would only retry while everyone is still full. Under Advanced settings, the Re-send limit caps how many times one lead can be re-sent in total, so it can never loop forever.
Can I send the caller's details to my client the moment a call connects?
Yes. Use the Call Connected trigger on a Calls campaign — it fires while the call is still live and carries the caller's phone and location plus every field your source posted through the Enrich API. Pair it with the Email action to email your client the lead info, or the Webhook action to post it into their system. Turn on Pre-call Data in Campaign Settings first, or the payload only carries the caller's phone and location. For a per-destination version that fires only to whoever actually answered, use Data Delivery on the destination instead — see Warm & Live Transfers.
Can I add conditions to automations?
Yes. Add any number of conditions per automation — e.g., state == CA AND case_type == auto_accident. Conditions reference any field on the lead (system or custom). Nested AND/OR groups are supported for complex routing logic. The automation only fires when all top-level conditions are true.
What does a webhook automation payload look like?
JSON. Top-level system fields include lead_id, event_type (e.g., lead.accepted), event_at timestamp, campaign_id, buyer_id, supplier_id, status. Standard contact fields (first_name, last_name, email, phone, state, zip_code) are top-level when in your campaign's field mapping. Custom fields are nested under custom. Any authentication header configured on the destination (Basic, Bearer, API key, or OAuth 2.0) is sent with the request.
What happens if an automation webhook fails?
The webhook is sent once and the result is recorded in the Delivery Logs: the status code, what we sent and the reply. A send fails when the reply is not 200-level, when the request times out, or when Success Response is on and the reply does not match your rule. A failed automation never blocks lead distribution: the lead still goes to its destination through the destination's own delivery.
The webhook returns 200 but the other system did not take the lead. How do I catch that?
Turn on Success Response on the Webhook action and say what a good reply looks like: a word the reply must contain (such as ACCEPTED), or one reply field and the value it must have (such as status is success). After that, a 200 reply that does not match is logged as a failed send in the Delivery Logs, and Send Test shows the same verdict before you go live.
Which field holds the price a lead sold for?
{{revenue}}. It is filled once a destination accepts the lead, so use it on Lead Accepted and later events. {{cost}} is what you paid the source. Both are in the Fields picker under Lead Fields.
Can I send a different message to different team members on the same event?
Yes — via the Notifications tab. Set per-alert routing: who gets notified on lead.created (e.g., on-call AM), lead.rejected (compliance team), delivery failures (engineering), and so on. Each route can be Slack, email, or SMS. Granular routing prevents alert fatigue — your distribution engineer doesn't need to see every lead.accepted notification, just the failures.
How do I test an automation before going live?
Open the automation and click Send Test (Webhook, Email and Slack actions). It sends the action with sample values, and Test Payload Data lists only the fields your message uses so you can change them. Your values are kept for next time and shared with the other automations on the campaign. A webhook test sends exactly what a real send would, and with Success Response on it tells you whether the reply counted as a success. To test the whole chain, send a lead through a Test Mode source (flagged is_test: true).

If you have any questions, send us an email at support@leaddistro.ai