ZapierChecked blueprint7 nodes
Round-robin a Facebook lead to the next rep
Each Facebook Lead Ads lead is assigned to the next rep in turn with a Storage counter, texted a hello, and announced to that rep by Slack DM.
Portfolio reference build with demo data and placeholder credentials, not a client deployment.
Pain
Ends the “we saw your inquiry tomorrow morning” leak. A new ad or web lead gets a personal SMS or email and a Slack alert.
Solution
Each Facebook Lead Ads lead is assigned to the next rep in turn with a Storage counter, texted a hello, and announced to that rep by Slack DM.
Impact · From the blueprint
No manual assignment, and every lead hears from you within a minute. Managers stop refereeing who got which lead.
- Advanced
- Validated
- Auto path
- Facebook Lead Ads
- Code by Zapier
- Storage by Zapier
- Formatter by Zapier
- Twilio
- Slack
Library status: passing. Schema, field mapping, task count, and Code-step unit tests pass. Not built in a live Zapier account.

Step inspector
The first step shows the checked-in sample payload.Later steps name the node. They are not a live execution.
Guardrails
No approval, retry, or demo-gate node was detected by name. Read the README before connecting live credentials.
Credential ids in the JSON are placeholders. These files are portfolio demos.
Deploy this for your business
Tell us this slug and what still happens by hand. We will map it onto your accounts. This page is not a claim that the blueprint already runs for a customer.
README
Portfolio demo by Mustafa (mustafaautomation). Not client work. The people, companies, and numbers in it are made up. Rebuild it in your own Zapier account. Nothing here is connected to anyone's account.
Category: Speed to lead
Difficulty: advanced
Apps: Facebook Lead Ads, Code by Zapier, Storage by Zapier, Formatter by Zapier, Twilio, Slack
Zapier plan: Professional (multi-step Zap: 6 steps after the trigger; Formatter by Zapier)
Tasks per run: 3
Test status: passing (schema, mapping scope, task count, Code step unit tests)
Problem
Ad leads go to a shared inbox and the fastest rep takes the best ones, or nobody takes them at all. Managers want an even split and a first contact within minutes, without buying a routing tool.
Who it's for
Sales teams of two to five reps running Facebook lead ads, usually real estate, mortgages, home services, or education.
How the Zap runs
flowchart TD s1["1. Facebook Lead Ads: New Lead<br/>New lead from the ad form"] s2["2. Code by Zapier<br/>Format the phone number"] s1 --> s2 s3["3. Storage by Zapier<br/>Count this lead"] s2 --> s3 s4["4. Formatter by Zapier<br/>Turn the count into a rep slot"] s3 --> s4 s5["5. Formatter by Zapier<br/>Look up the rep for the slot"] s4 --> s5 s6["6. Twilio<br/>Text the lead"] s5 --> s6 s7["7. Slack<br/>Tell the assigned rep"] s6 --> s7
Build it in the Zapier editor
Zapier has no import file for a Zap like this one, so it is built by hand from the steps below. zap.json is the same Zap in a machine-readable form (schema), and zap.yaml is the same document in YAML.
A value like [2. vendor] means: click the field, open step 2 in the data picker, and choose vendor. Plain text is typed as shown. YOUR_... is a value from your own account.
Before you start
- Create a Storage by Zapier secret key once (any long random string) and use the same one on every Storage step.
- Have these ready from your own accounts:
YOUR_FACEBOOK_PAGE,YOUR_STORAGE_SECRET,YOUR_TWILIO_NUMBER.
Steps
1. Trigger: New lead from the ad form
App: Facebook Lead Ads · Event: New Lead · instant (the app pushes each event to Zapier) · Tasks: 0
Facebook pushes each lead from the form to Zapier.
| Field | Value |
|---|---|
| Page | YOUR_FACEBOOK_PAGE |
| Form | Free consultation |
Fields this library maps from the trigger: lead_id, created_time, full_name, email, phone_number, ad_name, form_name. Zapier shows them with its own labels; pick the one with the same meaning.
2. Action: Format the phone number
App: Code by Zapier · Event: Run JavaScript · Tasks: 1
Facebook passes the number as typed; Twilio needs E.164.
Paste the whole of code/normalize-phone.js into the code box. Source: content/code/normalize-phone.cjs. Unit tests: content/code/normalize-phone.test.cjs.
| Input Data key | Value |
|---|---|
phone | [1. phone_number] |
default_country | 1 |
Returns: e164, valid, extension.
3. Action: Count this lead
App: Storage by Zapier · Event: Increment Value · Tasks: 0
Storage by Zapier keeps one number across runs. Each lead adds one, and the remainder picks the rep.
| Field | Value |
|---|---|
| Secret Storage Key | YOUR_STORAGE_SECRET |
| Key | facebook_lead_counter |
| Increment By | 1 |
Later steps can map: amount.
4. Action: Turn the count into a rep slot
App: Formatter by Zapier · Event: Numbers · Tasks: 0
MOD of the count by the number of reps gives 0, 1, 2, then 0 again.
| Field | Value |
|---|---|
| Transform | Spreadsheet-Style Formula |
| Formula | MOD([3. amount], 3) |
Later steps can map: output.
5. Action: Look up the rep for the slot
App: Formatter by Zapier · Event: Utilities · Tasks: 0
A lookup table maps the slot to a Slack username. Change the table when the team changes.
| Field | Value |
|---|---|
| Transform | Lookup Table |
| Lookup Key | [4. output] |
| Lookup Table › 0 | ayesha.k |
| Lookup Table › 1 | bilal.r |
| Lookup Table › 2 | chen.w |
| Fallback Value | ayesha.k |
Later steps can map: output.
6. Action: Text the lead
App: Twilio · Event: Send SMS · Tasks: 1
A first contact within a minute, from the team number, before the rep has even seen the lead.
| Field | Value |
|---|---|
| From Number | YOUR_TWILIO_NUMBER |
| To Number | [2. e164] |
| Message | Hi [1. full_name], thanks for requesting a free consultation. One of our advisors will call you shortly from this number. Reply STOP to opt out. |
| Send Large Messages? | No |
Later steps can map: sid, status.
7. Action: Tell the assigned rep
App: Slack · Event: Send Direct Message · Tasks: 1
Only the assigned rep is pinged, so ownership is clear.
| Field | Value |
|---|---|
| To Username | [5. output] |
| Message Text | New lead for you: [1. full_name] [2. e164] [1. email] from ad "[1. ad_name]". They have been texted; please call within 15 minutes. |
| Send as a bot? | Yes |
| Bot Name | Zap alerts |
Later steps can map: ts.
Test it
Use sample-trigger.json as the test record. For an instant or webhook trigger, send it to the trigger once; for a polling trigger, create a matching record in the app and click Test trigger. Then test each step in order and read its output before you turn the Zap on.
{
"lead_id": "1290045871236654",
"created_time": "2026-11-25T16:03:40+0000",
"full_name": "Jordan Meyers",
"email": "jordan.meyers@example.com",
"phone_number": "+1 (512) 555-0187",
"ad_name": "Winter refinance - video 2",
"form_name": "Free consultation"
}
Plan and task usage
| Step | App | Tasks |
|---|---|---|
| 1. New lead from the ad form | Facebook Lead Ads | 0 |
| 2. Format the phone number | Code by Zapier | 1 |
| 3. Count this lead | Storage by Zapier | 0 |
| 4. Turn the count into a rep slot | Formatter by Zapier | 0 |
| 5. Look up the rep for the slot | Formatter by Zapier | 0 |
| 6. Text the lead | Twilio | 1 |
| 7. Tell the assigned rep | Slack | 1 |
A typical run uses 3 tasks. Zapier does not charge tasks for triggers, Filter, Paths, Formatter, Delay, Looping, Digest, Storage, or Zapier Tables steps. AI by Zapier is counted here as 1 task; Zapier prices it by model tier, so a larger model can cost more.
Minimum plan: Professional, because of: multi-step Zap: 6 steps after the trigger; Formatter by Zapier. The Free plan only runs two-step Zaps (a trigger and one action) and leaves out Filters, Paths, Formatter, webhooks, AI by Zapier, and premium apps.
Customize
- For four reps, change the formula to
MOD(..., 4)and add a fourth row to the lookup table. - Weight the split by listing a busy rep twice in the lookup table (slots 0 and 3 both map to them, with
MOD(..., 4)). - Add a HubSpot or Pipedrive step to set the owner on the CRM record too.
Limits
- Two leads in the same second can read the same counter value. At ad-lead volumes that is rare, and the cost is one rep getting two in a row.
Time saved
No manual assignment, and every lead hears from you within a minute. Managers stop refereeing who got which lead.
Files
| File | What it is |
|---|---|
zap.json | The Zap, step by step, in schema 1.0.0. |
zap.yaml | The same document in YAML. |
sample-trigger.json | Fictional trigger record for the first test. |
diagram.png | The step list, drawn like the Zapier editor. |
code/normalize-phone.js | Paste-ready Code by Zapier step. |