Send to your sequencer
How an agent takes a finished batch of Amdahl messages and adds each lead to a paused sequencer campaign with its message as a per-lead variable: one recipe per tool (lemlist, Instantly, HeyReach, Reply.io, Smartlead, Woodpecker, La Growth Machine, Outreach, Salesloft, HubSpot, Apollo).
Level: one sentence to your agent. Call: get_message_batch, then your sequencer's own tool or API. You need: Amdahl connected to your agent, a finished batch, your recipients' emails or LinkedIn URLs (the list you wrote the batch from), and a campaign in your sequencer.
A batch from Optimize a campaign ends as a set of written messages. This page is how your agent puts them into your sequencer, so you say it in one sentence:
Send these to my lemlist campaign.
In this recipe your agent does the write, not Amdahl. Amdahl emails no prospect or customer, and it writes nothing to a CRM. Here the agent adds the leads through your sequencer's own MCP server, or through its API with your own key. Amdahl never sees that key, and it does not reach your sequencer. Amdahl's part ends when the agent reads the batch. In the console, Send to can instead add a batch's leads to a campaign you pick in Instantly, Smartlead, lemlist or HeyReach (HeyReach is in beta), using the key you connected there, and it never starts the campaign.
The rules for every tool
Your agent follows these for every sequencer below.
- Read the finished batch. Call
get_message_batchwith thebatch_id,wait_msset to 45000 andlimitset to 100, and read on withcursoruntilnext_cursorisnull. Wait untilstatusiscompleted. - Keep only what Amdahl wrote. Keep an item when
result.okistrue,result.outcomeisrewrittenandresult.placeholdersis empty. Leave out every other item and count why: a failed item, akeptdraft (your own text, unchanged), aneeds_inputitem, and an item with a blank such as[Last Name]still in it. Never edit amessage. - Match each item to its recipient. The batch result carries no email address or profile URL. Each item has an
item_id: the id you sent for that row. Take the email, names andlinkedin_urlfrom the row of your own list with that id. If the agent no longer has the list, it asks you for it. - Split the subject. For an email, when
messageopens with aSubject:line, the text after it isamdahl_subjectand the rest, after the blank line, isamdahl_message. With noSubject:line, there is noamdahl_subject. For LinkedIn, the wholemessageisamdahl_message. - Show what it will add, then wait. Before it adds anything, the agent shows you: the tool and the campaign by name and its status, how many leads it will add, how many it left out and why (one line), and the first two leads in full with their message. It adds nothing until you say yes.
- Use a paused or draft campaign. Some tools start sending as soon as a lead lands in a running campaign. The agent adds leads only to a campaign you created in the tool and that is paused or a draft, or that has no email account or sender attached yet. It reads the status first. If the campaign is running, it stops and tells you. It never starts, resumes, activates or launches a campaign: you do that in the tool, after you read the first messages there.
- Add one lead, then the rest. The agent adds one lead first and checks that the variable shows in the tool's preview and that the campaign is still paused. Then it adds the others in batches.
- Leave out what does not fit. A LinkedIn tool needs a profile URL for each lead, and some need first and last names. A lead without them, or a message longer than the tool's limit for a custom field, is left out and counted, not cut or guessed.
- Report. The agent says how many it added, how many the tool skipped (for example, already in the campaign) and the ids that failed.
The variable is the same name in every tool: amdahl_message, and amdahl_subject for an email. The syntax around it is the tool's own, and each section names it.
Through the tool's MCP server
lemlist
- Connect:
https://app.lemlist.com/mcp. Sign in with OAuth when it asks, or send your lemlist API key in anX-API-Keyheader. In Claude Code, give the server a name that does not contain "lemlist" (for examplelm): lemlist refuses OAuth clients with that word in the name. - Variable:
{{amdahl_message}}and{{amdahl_subject}}, double braces with no spaces inside, and the name is case sensitive. A variable holds up to 2,000 characters, so the agent leaves out a longer message and says so. - How it adds: lemlist's agent guide names
get_campaigns(it can filter by running, paused or draft),add_lead_to_campaignandupdate_lead_variables. The agent reads the connected server's tool list and uses those. Whereadd_lead_to_campaigntakes no custom variables, the agent adds the lead, then sets both variables withupdate_lead_variables. Through the API, it isPOST https://api.lemlist.com/api/campaigns/{campaignId}/leads/withemail,firstName,lastName,linkedinUrland, as extra keys in the same body,"amdahl_subject"and"amdahl_message". The API takes one lead a request, up to 20 requests every 2 seconds. - Hold: use a campaign you made in the lemlist app. A campaign created through the API counts as running. Leave the campaign's auto-review off: added leads then wait in "To review" and do not send until someone launches them. The agent never calls
set_campaign_state, the start or pause endpoints, or the launch-lead endpoint. - Docs: MCP setup, create a lead in a campaign, custom variables.
Instantly
- Connect:
https://mcp.instantly.ai/mcpwith an Instantly API v2 key (Settings, then Integrations, then API Keys) in anAuthorizationheader. - Variable:
{{amdahl_message}}and{{amdahl_subject}}. Names are case sensitive and must match the lead's custom variable exactly. - How it adds: Instantly names its tools
{action}_{resource}:list_campaignsandcreate_leadare in its docs, and the rest are generated from the API. The agent reads the connected tool list instead of guessing a name. Through the API, one request adds up to 1,000 leads:POST https://api.instantly.ai/api/v2/leads/addwithcampaign_idandleads, each lead holdingemail,first_name,last_name,company_nameandcustom_variablesset to{"amdahl_subject": "...", "amdahl_message": "..."}. Send a newidempotency_keyfor each batch so a retry adds nothing twice. A lead already in the campaign is skipped, not updated. - Hold: Instantly's docs do not say whether a lead added to an active campaign sends at once, so the agent adds only to a draft or paused campaign, and never calls the activate endpoint. Instantly bodies are HTML: check the preview, and if the lines run together, the agent turns each line break into
<br>. - Docs: MCP tools, add leads in bulk, add variables.
HeyReach
- Connect: in HeyReach, open Integrations, then HeyReach MCP Server, then New MCP Key, and copy the MCP Connection URL. Each workspace has its own URL, and a new key changes it.
- Variable:
{amdahl_message}, single braces. HeyReach does not list a variable sent by the API in the step's "Add variable" menu, so type it into the message step by hand. A message step has no subject, so a LinkedIn lead hasamdahl_messageonly. A field name may use letters, digits and underscores. - How it adds: HeyReach does not publish its MCP tool names, so the agent reads the connected tool list and uses the one that adds leads to a campaign. Through the API it is
POST /api/public/campaign/AddLeadsToCampaignV2with the key in anX-API-KEYheader (use the host in HeyReach's API docs):campaignIdand up to 100accountLeadPairs, each with aleadholdingfirstName,lastName,profileUrlandcustomUserFieldsset to[{"name": "amdahl_message", "value": "..."}]. A lead without all three offirstName,lastNameandprofileUrlfails without an error, so the agent leaves it out and checksfailedLeadsCount. - Hold: HeyReach's help center says that adding leads by API to a paused or finished campaign starts it again, and it does not take leads into a draft. So the agent sets
resumePausedCampaigntofalse, reads the campaign's status straight after the first lead, and stops if it no longer says paused. If you want no risk at all, add the leads with a CSV in HeyReach's own app instead (see Any other tool). - Docs: HeyReach MCP, how to add leads, custom variables.
Reply.io
- Connect:
https://mcp.reply.io/with a Reply.io API key (Settings, then API Key) asAuthorization: Bearer <key>, or sign in with OAuth. The tools in its docs that matter here arereply_search_sequences,reply_create_contact,reply_update_contactandreply_add_contact_to_sequence. - Variable:
{{amdahl_message}}and{{amdahl_subject}}, double braces, case sensitive. Create both as custom contact fields first: an email step refuses a variable Reply.io does not know. With the API, that isPOST https://api.reply.io/v3/custom-fieldswithtitleset to the name,fieldTypeset totextandentityTypeset tocontact. A custom field belongs to the contact, so a contact in two sequences carries one message. - How it adds: the agent finds the sequence with
reply_search_sequences, creates each contact withreply_create_contact, then enrolls them withreply_add_contact_to_sequence(up to 100 at a time). Reply.io's tool docs do not show whether the contact tools take custom fields. If they do not, the agent uses the API:POST /v3/contactswithemailorlinkedInUrl, andcustomFieldsset to[{"key": "amdahl_message", "value": "..."}], thenPOST /v3/sequences/{id}/contact-links/bulkwithcontactIds. - Hold: enroll only into a sequence that is
neworpaused(reply_search_sequencesreturns its status). The agent never callsreply_start_sequenceorPOST /v3/sequences/{id}/start. A running sequence works on a new contact straight away, within its schedule. - Docs: MCP tools, create a contact, bulk add contacts to a sequence.
Through the tool's API, with your own key
For these three, your agent calls the vendor's API with a key you give it. Paste the key into the chat only if your agent runs on your own machine, and say it is for this one task. The agent keeps it out of files, commits and anything it shows you.
Smartlead
- Key: in Smartlead, Settings, then API Key Management, then create an admin key (it needs a plan that includes the API). The key goes in the URL as
?api_key=, not in a header. - Variable:
{{amdahl_message}}and{{amdahl_subject}}, in the subject or the body, case sensitive. - How it adds:
GET https://server.smartlead.ai/api/v1/campaigns/?api_key=...lists campaigns with theirstatus.POST https://server.smartlead.ai/api/v1/campaigns/{campaign_id}/leads?api_key=...takes up to 400 leads inlead_list, each withemail,first_name,last_name,company_name,linkedin_profileandcustom_fieldsset to{"amdahl_subject": "...", "amdahl_message": "..."}. Leavesettingsat its defaults. The answer countsadded_countandskipped_count. The limit is 60 requests a minute on the standard plan, and the agent waits on a429. - Hold: use a campaign whose status is
DRAFTEDorPAUSED. Smartlead's docs say leads added to an active campaign follow its schedule, so the agent does not add to anACTIVEone, and never calls the campaign status endpoint. - Docs: add leads to a campaign, list campaigns, variables.
Woodpecker
- Key: in Woodpecker, the Add-ons menu, then API & Integrations, then API keys, then Create a key. It goes in an
x-api-keyheader. Woodpecker also has its own MCP server (https://api.woodpecker.co/mcp/v1, with a tool namedaddProspectsToCampaign): use it if it is already connected. - Variable: Woodpecker has no fields with a name of your choice. It has 15 snippet slots,
snippet1tosnippet15in the API and{{SNIPPET_1}}to{{SNIPPET_15}}in the copy. The agent asks which two slots are free, then puts the subject in one and the message in the other, for examplesnippet1andsnippet2, and the step uses{{SNIPPET_1}}and{{SNIPPET_2}}. A prospect with an empty snippet that the copy uses goes to "To Check" and gets nothing. - How it adds:
GET https://api.woodpecker.co/rest/v1/campaign_listlists campaigns (filter withstatus=DRAFT,PAUSED,EDITED).POST https://api.woodpecker.co/rest/v1/add_prospects_campaigntakescampaignwithcampaign_id, andprospects, each withemail,first_name,last_name,linkedin_urland the snippets. Snippet text is HTML, so the agent turns each line break into<br>. Leaveforceoff: with it off, a prospect who replied or bounced before is refused. A prospect already in the campaign comes back asDUPLICATEand is not changed. - Hold: use a campaign that is
DRAFT,EDITEDorPAUSED, and never call the run endpoint. A prospect can also be added withstatusset toPAUSED, so that it waits even if the campaign later runs. - Docs: add prospects to a campaign, snippets, authentication.
La Growth Machine
- Key: in La Growth Machine, All settings, then Integrations & API, then the API tab (it needs a plan that includes the API). It goes in an
Authorization: Bearerheader. - Variable: La Growth Machine has 20 fixed fields,
customAttribute1tocustomAttribute20, each up to 2,500 characters. The agent puts the message incustomAttribute1and, for email, the subject incustomAttribute2. Its docs show the variable in the step as{{customAttribute1}}in one place and{{custom_attribute_1}}in another, so insert it from the editor's variable list instead of typing it, and check the preview. A line break in a value is dropped: the agent turns each into<br>. - How it adds: La Growth Machine adds a lead to an audience, and a campaign takes the leads of its audience.
GET https://apiv2.lagrowthmachine.com/flow/campaignslists campaigns with theirstatusand audience.POST https://apiv2.lagrowthmachine.com/flow/leadsadds one lead:audience(a name or id),linkedinUrlorproEmail,firstname,lastnameand the custom attributes. It is one request a lead: the agent sends about 5 a second and waits on a429. - Hold: a lead added to the audience of a campaign that is running starts its sequence. So the agent adds only to the audience of a campaign that is
READY(not yet launched) orPAUSED, or to a new audience with no campaign, which you then attach to a campaign in the app. The API cannot launch a campaign. - Docs: developer docs, add leads to an ongoing campaign.
Through a file import
Outreach, Salesloft, HubSpot and Apollo are set up for an import in their own app, so the agent writes a file and you import it. The agent builds a CSV with one row for each lead it will add: email, first_name, last_name, company, linkedin_url, amdahl_subject and amdahl_message, plus any other column from your list. A formula-looking value (one that starts with =, +, - or @) gets a ' in front. It shows you the rows as in rule 5 and saves it as <list-name>-<tool>.csv. Then you:
- Create the two custom fields in the tool (below), so the import can map to them.
- Import the file and map
amdahl_subjectandamdahl_messageto those fields. - Put the variable in the step, and check the preview.
Outreach
- Import: Actions, then Bulk Create, then Prospects. A
.csvin UTF-8, up to 100,000 rows. Choose Skip, Overwrite or Update Missing Fields for a prospect who already exists (the email is the key). - Field: an admin first adds a prospect field configuration (Administration, then Records, then Prospects, then Fields configuration, then Add configuration). A custom field holds about 30,000 characters. Map
amdahl_messageto Custom 1 andamdahl_subjectto Custom 2. - Variable:
{{custom1}}and{{custom2}}. Insert it with the Add Variable button, or by typing{{in the editor. A subject that uses a variable a prospect lacks can break the whole send. - Hold: a sequence is off until someone activates it, and prospects added to it wait as Pending. Add them to a sequence that is off, or whose steps are Manual Email (a task, not a send). Never click Activate.
- Docs: import prospects, add a custom field, variables.
Salesloft
- Import: People, then Create People, then Import from CSV. Up to 5,000 records a file (1,000 is the advice). Each row needs a name and an email or phone number. Leave the Cadence and Assignee columns out.
- Field: an admin first adds two person fields of type Text (Settings, then Field Configuration, then Person Fields, then Add Custom Field). A field name starts with a letter and uses letters, digits, dashes and underscores. Salesloft's docs give no length limit for a Text field, so import one row first and check the whole message arrived.
- Variable: use the Dynamic Fields button in the email editor and pick the field. Salesloft's docs do not show the typed form of a custom field, so do not type it.
- Hold: do not use "Finish Import and Add to Cadence". Add the people to a cadence later, with each email step as a manual step (leave "Automate this step" unticked), so the email waits in People Due until you send it.
- Docs: import people from a CSV, person fields, dynamic fields.
HubSpot
- Import: Data Management, then Data Integration, then Import data, then Quick import (contacts). A
.csv,.xlsxor.xlswith one header row. Every column maps to a contact property. - Field: create two contact properties of type Multi-line text (Settings, then Properties, then Contact, then Create property), or use "Create new property" in the mapping step. A text property holds 65,536 characters. HubSpot's help says sequences do not support line breaks in multi-line text, so the message can lose its line breaks: check the preview.
- Variable: in the template, use the Personalize dropdown, then Contact, then your property, and set a fallback. Do not type the token: HubSpot documents the typed form only for coded templates, and warns that curly brackets typed by hand can break the template. A template subject holds 256 characters. HubSpot fills the token when it enrolls the contact, so an edit to the property later does not change an email already enrolled.
- Hold: by default the first email goes out as soon as possible on enrolment. Make step 1 "Send later", or make every email step a manual email task. A contact can be in one sequence at a time, and you can enroll 50 contacts in one action.
- Docs: import contacts, create properties, enroll contacts in a sequence.
Apollo
- Import: People, then Import, then CSV. Each row needs one of company name, company website, LinkedIn URL or email, and a real first and last name. Set "If contacts already exist" to update, and add the contacts to a list, not a sequence.
- Field: create two contact custom fields first (Settings, then Data management, then Objects, fields, stages, then Contact fields & stages, then Create Field), of type Multi-line text. Apollo asks for a maximum number of characters (set 2,000 or more, line breaks count) and the type cannot change later. If the field is new, start the upload again after you create it.
- Variable: in the email step, click
{ }in the body, then pick the custom field. For the subject, copy the variable from the body and paste it in. A required variable that is blank blocks that email, and Apollo shows the contact as "Not sent". - Hold: an inactive sequence takes no contacts in the app, and an active sequence enrolls them on its schedule. So make every email step a Manual email, which makes a task for you and sends nothing.
- Docs: import a CSV of contacts, create custom contact fields, use custom dynamic variables.
Any other tool
The same file works for a tool that is not named here: the agent writes the CSV above, and you import it and map the two columns to custom fields. Any tool with a per-contact custom field and a merge variable can use amdahl_message. If your tool has its own MCP server, say so: the agent follows the rules at the top of this page with the tools it lists.
After they go out
When a message is sent, tell your agent. It reports it with report_message_sent (see Report sent messages) so Amdahl knows what went out. That report is all Amdahl does here: it does not send, and it does not touch your sequencer.
Next: Optimize before you send puts the optimizer in front of every message your code sends.