CallRail form to Salesforce lead with Slack alert

By General Input

Every 15 minutes, turn new CallRail form submissions into Salesforce leads and ping a Slack channel with an AI summary and suggested reply.

Integrations

  • CallRail
  • Salesforce
  • Slack

Type

Agentic Task

Categories

  • Sales
  • Marketing

Build me an agent workflow that runs on a cron trigger every 15 minutes and syncs new CallRail form submissions into Salesforce as leads, with a Slack alert for the sales team.

On each run, the agent should:

1. Call CallRail "List All Form Submissions" for my account, filtered to submissions created since the previous run (use a small overlap window, e.g. the last 20 minutes, to be safe). Request the tags and the full form data fields so we can see what's already been processed and read every field the visitor typed.

2. For each submission, skip it if the tags already include a "synced-to-sf" tag, or if it looks like obvious spam. Spam rules: missing email address, or the main message field is shorter than 5 characters. Log skipped submissions briefly and move on.

3. For each remaining submission, read out the prospect's name, email, phone, the message they typed, and the marketing attribution (CallRail's source and campaign, plus the form name and the tracking number or landing page if present).

4. Call Salesforce "Create Lead" with those mapped fields. Map first and last name from the CallRail name field, email and phone directly, and set LeadSource as a combination of the CallRail source and campaign (for example "CallRail - Google Ads - Spring Promo"). Put the form name in Company if no company was captured, and any state or city the form captured into the matching Salesforce fields. Capture the new lead's Salesforce ID from the response.

5. Call Salesforce "Add Note to Lead" against that new lead ID, with a note title like "CallRail form submission" and the full raw form text as the body (every field the visitor typed, key/value pairs). This guarantees reps see exactly what was submitted, not just the fields we mapped.

6. Generate a short AI summary of the submission with three parts: (a) two sentences on what the prospect is asking for, (b) one line on which marketing source and campaign brought them in, and (c) a one-paragraph suggested first-touch reply tailored to their question, in a friendly professional tone, that I can copy paste into an email.

7. Call Slack "Send a Message" to the channel I choose at setup time (default #inbound-leads). Post the summary as a single message: prospect name on the first line in bold, then the two-sentence ask, then "Source: …", then the suggested reply paragraph indented as a quote, then a link to the new Salesforce lead record. Use Slack mrkdwn formatting (single asterisks for bold).

8. Call CallRail "Update a Form Submission" on the same submission to add a "synced-to-sf" tag (preserve any existing tags). This is what guarantees the same submission never gets processed twice on future runs.

If any step fails for a given submission, do not tag it as synced, log the error, and continue with the next submission so one bad record doesn't block the rest.

At setup time, ask me which Slack channel to post to, which CallRail company (or all of them), and confirm the default LeadSource format. Use my CallRail, Salesforce, and Slack connections for all calls.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredChat quality review board for LiveChat support leadsWin back no-show and cancelled appointments every morningLive Loop returns analytics with product-level drill-downNewsletter pre-flight and approval board for Mailjet sendsTurn a prospect spreadsheet into personalized sequence enrollmentsMailjet email delivery lookup console for support teamsCatch feature flags that never got switched on in productionA website visitor queue that remembers what you hide