Docs

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.

  1. Read the finished batch. Call get_message_batch with the batch_id, wait_ms set to 45000 and limit set to 100, and read on with cursor until next_cursor is null. Wait until status is completed.
  2. Keep only what Amdahl wrote. Keep an item when result.ok is true, result.outcome is rewritten and result.placeholders is empty. Leave out every other item and count why: a failed item, a kept draft (your own text, unchanged), a needs_input item, and an item with a blank such as [Last Name] still in it. Never edit a message.
  3. 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 and linkedin_url from the row of your own list with that id. If the agent no longer has the list, it asks you for it.
  4. Split the subject. For an email, when message opens with a Subject: line, the text after it is amdahl_subject and the rest, after the blank line, is amdahl_message. With no Subject: line, there is no amdahl_subject. For LinkedIn, the whole message is amdahl_message.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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 an X-API-Key header. In Claude Code, give the server a name that does not contain "lemlist" (for example lm): 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_campaign and update_lead_variables. The agent reads the connected server's tool list and uses those. Where add_lead_to_campaign takes no custom variables, the agent adds the lead, then sets both variables with update_lead_variables. Through the API, it is POST https://api.lemlist.com/api/campaigns/{campaignId}/leads/ with email, firstName, lastName, linkedinUrl and, 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/mcp with an Instantly API v2 key (Settings, then Integrations, then API Keys) in an Authorization header.
  • 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_campaigns and create_lead are 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/add with campaign_id and leads, each lead holding email, first_name, last_name, company_name and custom_variables set to {"amdahl_subject": "...", "amdahl_message": "..."}. Send a new idempotency_key for 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 has amdahl_message only. 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/AddLeadsToCampaignV2 with the key in an X-API-KEY header (use the host in HeyReach's API docs): campaignId and up to 100 accountLeadPairs, each with a lead holding firstName, lastName, profileUrl and customUserFields set to [{"name": "amdahl_message", "value": "..."}]. A lead without all three of firstName, lastName and profileUrl fails without an error, so the agent leaves it out and checks failedLeadsCount.
  • 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 resumePausedCampaign to false, 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) as Authorization: Bearer <key>, or sign in with OAuth. The tools in its docs that matter here are reply_search_sequences, reply_create_contact, reply_update_contact and reply_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 is POST https://api.reply.io/v3/custom-fields with title set to the name, fieldType set to text and entityType set to contact. 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 with reply_create_contact, then enrolls them with reply_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/contacts with email or linkedInUrl, and customFields set to [{"key": "amdahl_message", "value": "..."}], then POST /v3/sequences/{id}/contact-links/bulk with contactIds.
  • Hold: enroll only into a sequence that is new or paused (reply_search_sequences returns its status). The agent never calls reply_start_sequence or POST /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 their status. POST https://server.smartlead.ai/api/v1/campaigns/{campaign_id}/leads?api_key=... takes up to 400 leads in lead_list, each with email, first_name, last_name, company_name, linkedin_profile and custom_fields set to {"amdahl_subject": "...", "amdahl_message": "..."}. Leave settings at its defaults. The answer counts added_count and skipped_count. The limit is 60 requests a minute on the standard plan, and the agent waits on a 429.
  • Hold: use a campaign whose status is DRAFTED or PAUSED. Smartlead's docs say leads added to an active campaign follow its schedule, so the agent does not add to an ACTIVE one, 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-key header. Woodpecker also has its own MCP server (https://api.woodpecker.co/mcp/v1, with a tool named addProspectsToCampaign): use it if it is already connected.
  • Variable: Woodpecker has no fields with a name of your choice. It has 15 snippet slots, snippet1 to snippet15 in 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 example snippet1 and snippet2, 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_list lists campaigns (filter with status=DRAFT,PAUSED,EDITED). POST https://api.woodpecker.co/rest/v1/add_prospects_campaign takes campaign with campaign_id, and prospects, each with email, first_name, last_name, linkedin_url and the snippets. Snippet text is HTML, so the agent turns each line break into <br>. Leave force off: with it off, a prospect who replied or bounced before is refused. A prospect already in the campaign comes back as DUPLICATE and is not changed.
  • Hold: use a campaign that is DRAFT, EDITED or PAUSED, and never call the run endpoint. A prospect can also be added with status set to PAUSED, 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: Bearer header.
  • Variable: La Growth Machine has 20 fixed fields, customAttribute1 to customAttribute20, each up to 2,500 characters. The agent puts the message in customAttribute1 and, for email, the subject in customAttribute2. 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/campaigns lists campaigns with their status and audience. POST https://apiv2.lagrowthmachine.com/flow/leads adds one lead: audience (a name or id), linkedinUrl or proEmail, firstname, lastname and the custom attributes. It is one request a lead: the agent sends about 5 a second and waits on a 429.
  • 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) or PAUSED, 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:

  1. Create the two custom fields in the tool (below), so the import can map to them.
  2. Import the file and map amdahl_subject and amdahl_message to those fields.
  3. Put the variable in the step, and check the preview.

Outreach

  • Import: Actions, then Bulk Create, then Prospects. A .csv in 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_message to Custom 1 and amdahl_subject to 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, .xlsx or .xls with 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.