1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "leads": [
12 {
13 "firstName": "Sarah",
14 "lastName": "Chen",
15 "title": "VP of Engineering",
16 "company": "Acme Corp",
17 "industry": "Software / SaaS",
18 "employeeCount": 250,
19 "companyDescription": "B2B project management platform serving mid-market companies",
20 "techStack": [
21 "React",
22 "Node.js",
23 "PostgreSQL",
24 "AWS"
25 ],
26 "recentSignals": [
27 "Recently adopted React for frontend migration",
28 "Raised Series B in Jan 2026"
29 ],
30 "email": "sarah.chen@acmecorp.com"
31 },
32 {
33 "firstName": "Marcus",
34 "lastName": "Rivera",
35 "title": "Head of Sales",
36 "company": "GrowthFlow Inc",
37 "industry": "Sales Enablement",
38 "employeeCount": 80,
39 "companyDescription": "Revenue intelligence platform for outbound sales teams",
40 "recentSignals": [
41 "Hired 5 SDRs in Q1 2026",
42 "Job posting for Sales Operations Manager"
43 ],
44 "email": "m.rivera@growthflow.io"
45 },
46 {
47 "firstName": "Priya",
48 "lastName": "Kapoor",
49 "title": "CTO",
50 "company": "DataBridge Analytics",
51 "industry": "Data & Analytics",
52 "employeeCount": 45,
53 "companyDescription": "Real-time data pipeline and analytics for e-commerce brands",
54 "techStack": [
55 "Python",
56 "Kafka",
57 "Spark",
58 "Snowflake"
59 ],
60 "fundingStage": "Seed",
61 "email": "priya@databridgeanalytics.com"
62 }
63 ],
64 "model": "gpt-4o-mini",
65 "template": "You are a world-class B2B sales copywriter. Write personalized cold email copy that is concise, lead-focused, and drives replies. Reference the prospect's specific context. Never use generic phrases like 'I hope this email finds you well'."
66};
67
68
69const run = await client.actor("ryanclinton/ai-outreach-personalizer").call(input);
70
71
72console.log('Results from dataset');
73console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
74const { items } = await client.dataset(run.defaultDatasetId).listItems();
75items.forEach((item) => {
76 console.dir(item);
77});
78
79