Learn to build a lead‑gen → cold email → invoice loop with Active AI, see real prompts, costs, and debugging tips, then grab the ready‑made blueprint.
How to Run Active AI Automation Pipelines Without Coding
If you’ve ever tried to stitch together cold‑email outreach, lead scraping, and invoice generation with a handful of separate tools, you know how quickly the workflow frays.
With actively ai you can connect those pieces into a single loop that runs on a schedule, logs every step, and alerts you when something stalls.
By the end of this guide you’ll have a working prototype and know where to swap in your own APIs or data sources.
What most guides get wrong
Many tutorials treat the AI agent as a black box that just “works” once you drop in a prompt. They skip the part where you have to shape the input data, handle rate limits, and log failures. The result is a demo that looks great in a video but dies after the first run when the scraper returns empty fields or the email service throttles you.
What you actually need is a contract between each step: a defined JSON schema, a fallback when a field is missing, and a retry policy that respects the provider’s limits. Without that contract the whole chain breaks silently and you waste hours checking logs.
Why does the AI agent stall after the third email?
I’ve seen this pattern repeatedly: the workflow runs fine for the first two contacts, then the AI agent returns a generic apology and stops. The usual suspect is the token window. Each iteration adds the previous email thread to the context, and after a couple of loops the prompt exceeds the model’s limit.
🤖
Recommended Reading
AI Side Hustles
12 Ways to Earn with AI
Practical setups for building real income streams with AI tools. No coding needed. 12 tested models with real numbers.
The fix is to truncate the history before you call the model. Keep only the last user message and a short summary of the prior exchange. In ActiveAI you can add a “trim text” step that runs a simple regex to cut the input to 800 characters.
Building the core loop with ActiveAI
Start by creating a new workflow in the ActiveAI dashboard. Choose the “Schedule” trigger and set it to run every fifteen minutes. (Yes, the native scheduler only accepts whole‑hour intervals, so we’ll use a workaround later.)
Add an HTTP request step that pulls the latest lead from your Airtable base. Use the GET endpoint https://api.airtable.com/v0/appXXXXX/Leads?maxRecords=1&filterByFormula={Status}=%22New%22 and include your API key in the headers.
Next, add a “Set variable” step that extracts the lead’s email, name, and company from the response JSON. Map them to variables email, name, company.
Now insert the AI agent. Use the GPT‑4 model with the following prompt:
You are a friendly sales assistant. Write a short cold‑email to {{name}} at {{company}}. Mention one recent blog post they published (use the {{blog_url}} variable if available). Keep it under 120 words. End with a clear call‑to‑action to book a 15‑minute chat.
Note the double curly braces – ActiveAI replaces them with the variable values at runtime. The output of this step is stored in email_body.
After the AI step, add another HTTP request to send the email via SendGrid. POST to https://api.sendgrid.com/v3/mail/send with a JSON body that includes personalizations, from, subject (you can generate the subject in a prior AI step or hard‑code it), and content set to email_body.
Finally, update the Airtable record to set Status to “Contacted” and store the email_body in a log field. This closes the loop.
Adding a lead‑gen scraper step
If you don’t already have a source of fresh leads, you can scrape LinkedIn or a industry directory with Apify. Create an Apify actor that returns a JSON array of objects with name, email, company, and optionally blog_url. In ActiveAI, add an HTTP request step that calls the Apify endpoint and stores the result in a variable leads.
Then use a “Iterate over array” step to process each lead one by one. Inside the loop, map the current item’s fields to the variables we used earlier (email, name, company, blog_url). The rest of the workflow stays the same.
I love how the iterator lets you reuse the same email‑generation logic without duplicating steps. It feels like writing a function in a traditional language, but you get it with a few clicks.
Hooking up the invoice generator
Once a lead replies positively, you’ll want to create an invoice automatically. Add a webhook step that listens for a label change in your CRM (for example, when a Gmail thread gets the “Interested” label). When the webhook fires, pull the deal amount from your CRM and call the Stripe API to create an invoice.
The Stripe request looks like this:
POST https://api.stripe.com/v1/invoices
Headers: Authorization: Bearer sk_test_...
Form data:
customer = cus_XXXXX
days_until_due = 30
description = "Service for {{company}}"
After the invoice is created, update the Airtable record with the invoice URL and set a “Invoice Sent” flag. This keeps your finance team in the loop without manual copy‑pasting.
How to debug when this breaks
First, check the ActiveAI execution log. Each step shows its input, output, and any error messages. If the AI agent returns an empty string, look at the prompt length – you may have exceeded the model’s context window.
If the HTTP request to Airtable fails, verify that your API key still has the right scope and that the base ID hasn’t changed. ActiveAI will show the exact status code (e.g., 401 or 429) which helps you decide whether to refresh the token or add a delay.
When the SendGrid step throws a “max daily quota exceeded” error, you know you’ve hit the provider’s limit. The fix is to either upgrade your SendGrid plan or add a pause step that spreads the sends over several hours.
One gripe I have is the lack of a built‑in retry‑with‑backoff option. You have to manually add a “Delay” step and copy‑paste the same request again, which feels clunky.
On the love side, the real‑time log viewer is a lifesaver. Being able to click a step and see the exact JSON that went in and out cuts debugging time from ten minutes to under a minute.
Price and value opinion
ActiveAI charges $29 per month for 5 000 automation minutes, which is enough for a solo operator running a few loops a day. I think that’s fair for the reliability you get.
The $99 per month tier jumps to 25 000 minutes but adds only a few extra features like priority support and a higher concurrent run limit. Unless you’re running dozens of parallel workflows, that price feels steep for what you actually receive.
The free tier gives you 500 minutes a month and blocks the scheduler entirely, so you can’t automate anything on a repeat basis. Honestly, the free plan is a joke if you intend to build a real‑world pipeline.
As a mild aside, the documentation sometimes assumes you know the exact field names of the Airtable API — and good luck finding a complete example for the nested filter formula.
For more on this exact angle, deeper coverage of AI agent platforms.
If you’d rather skip the build and deploy a working version in an afternoon, we’ve packaged this workflow as a blueprint at deepusecase.com/vault.