Instantly Core Workflow A: Campaign Launch Pipeline
Overview
Build the core Instantly outreach pipeline: create a campaign with email sequences, add leads with personalization, assign sending accounts, and launch. This is the primary money-path workflow for cold email outreach via Instantly API v2.
Prerequisites
- Completed
instantly-install-auth setup
- At least one warmed-up email account in Instantly
- Lead data (CSV or programmatic) with email + first name at minimum
- API key with
campaigns:all and leads:all scopes
Instructions
Step 1: Create a Campaign with Sequences
import { instantly } from "./src/instantly";
interface CreateCampaignPayload {
name: string;
campaign_schedule: {
start_date: string;
end_date?: string;
schedules: Array<{
name: string;
timing: { from: string; to: string };
days: Record<string, boolean>;
timezone: string;
}>;
};
sequences: Array<{
steps: Array<{
type: "email";
delay: number;
delay_unit?: "minutes" | "hours" | "days";
variants: Array<{ subject: string; body: string }>;
}>;
}>;
daily_limit?: number;
stop_on_reply?: boolean;
stop_on_auto_reply?: boolean;
email_gap?: number;
link_tracking?: boolean;
open_tracking?: boolean;
}
async function createCampaign() {
const payload: CreateCampaignPayload = {
name: "Q1 Outbound — Decision Makers",
campaign_schedule: {
start_date: "2026-04-01",
schedules: [
{
name: "Business Hours",
timing: { from: "09:00", to: "17:00" },
days: { "1": true, "2": true, "3": true, "4": true, "5": true, "0": false, "6": false },
timezone: "America/New_York",
},
],
},
// sequences array takes ONE element — add steps inside it
sequences: [
{
steps: [
{
type: "email",
delay: 0, // first email — no delay
variants: [
{
subject: "{{firstName}}, quick question about {{companyName}}",
body: `Hi {{firstName}},\n\nI noticed {{companyName}} is scaling its outbound — we help teams like yours book 3x more meetings without adding headcount.\n\nWorth a 15-min call this week?\n\nBest,\n{{senderName}}`,
},
{
subject: "Idea for {{companyName}}",
body: `Hey {{firstName}},\n\nSaw that {{companyName}} is growing fast. We helped [similar company] increase reply rates by 40%.\n\nOpen to a quick chat?\n\n{{senderName}}`,
},
],
},
{
type: "email",
delay: 3,
delay_unit: "days",
variants: [
{
subject: "Re: {{firstName}}, quick question about {{companyName}}",
body: `Hi {{firstName}},\n\nJust following up on my last note. Would love to share how we helped [company] with a similar challenge.\n\nHappy to work around your schedule.\n\n{{senderName}}`,
},
],
},
{
type: "email",
delay: 4,
delay_unit: "days",
variants: [
{
subject: "Re: {{firstName}}, quick question about {{companyName}}",
body: `Hi {{firstName}},\n\nI know you're busy — just wanted to check if improving outbound results is a priority right now.\n\nIf not, no worries at all. If so, I'd love 15 minutes.\n\nBest,\n{{senderName}}`,
},
],
},
],
},
],
daily_limit: 50,
stop_on_reply: true,
stop_on_auto_reply: false,
email_gap: 120, // seconds between emails
link_tracking: false, // disable for better deliverability
open_tracking: true,
};
const campaign = await instantly<{ id: string; name: string; status: number }>(
"/campaigns",
{ method: "POST", body: JSON.stringify(payload) }
);
console.log(`Campaign created: ${campaign.name} (${campaign.id})`);
return campaign;
}