Send Instagram DMs from a Google Sheet
How to send Instagram DMs from a Google Sheet: install the Chrome extension, click Build with Browser agent, tell the agent what you want, and follow its prompts. A working bot is built and tested in minutes.
Here is how the automation works. To send Instagram DMs from a Google Sheet, loop over a sheet of profile links and messages, open each profile, click Message, type the message with Enter text and press Return, then write Sent back into the row so the next run skips it. An If condition skips profiles with no Message button, private or blocked, instead of failing the run.
Build the Instagram DM sender from a description
Describe it and click the button: the agent builds and tests the DM sender in your Chrome extension. Instagram has to be signed in in the browser the automation runs in; for a cloud run, add the login steps from automate Instagram login with 2FA. To like each user's newest post as well, see send Instagram DMs and like each user's latest post.
- Read the profile links and messages from my sheet
- Skip any rows already marked Sent
- Open each profile link
- Check the profile header for the word Message
- If it is there, click Message and send the message
- Write Sent back into the row, in column C
You need a Google Sheet with the profile link in column A and the message in column B, one row per message, with no header, and column C empty for the marker. Each row is marked Sent as its message goes, so a stopped run picks up where it left off without sending twice. Start with a handful of rows: too many DMs in a short time gets an Instagram account blocked.
Build the Instagram DM sender step by step
The steps the agent builds, as the Builder shows them: each step by its name, with the fields to set under it. Add them yourself in this order in the step-by-step builder, or open the agent's result there to adjust it.
- 1.0
Enter custom dataCustom data: Sent
- 2.0
Read data from a Google SheetSpreadsheet: your sheet, the profile link in column A and the message in column BLast cell: far enough right to include column C
- 3.0
Remove results that contain certain wordsData:[google-sheet-data]Words (comma separated):[custom-data]
- 4.0
Loop through data- repeats for every row in
[word-removed-data]
- 4.1
Go to pageURL: the profile link column of[word-removed-data]
- 4.2
Get data from bot's current pageSelect: the profile header, the area holding the Message button
- 4.3
If conditionData to check:[scrape-data]Condition to check: Message, in the word Instagram shows in your languageReverse condition: Run steps if condition is true
- 4.3.1
Click elementSelect: the Message buttonClick: Custom with Use element text instead of HTML on
- 4.3.2
Wait - 4.3.3
Click elementSelect: the Not now buttonClick: Custom with Use element text instead of HTML onOptional click: on
- 4.3.4
Wait - 4.3.5
Enter textSelect text field: the conversation's text boxText: the message column of[word-removed-data]
- 4.3.6
Press key(s)Key: Return
- 4.3.7
Find row in a Google SheetSpreadsheet: your sheetValues (comma separated): the profile link column of[word-removed-data]Exact match: onColumns (optional): 1
- 4.3.8
Write data to a Google SheetSpreadsheet: your sheetDATA:[custom-data]Write options: Add to existing dataStarting cell:C[find-row-google-sheet]
- repeats for every row in
Common questions about sending Instagram DMs from a sheet
Why does the run stop at the Message click?
The profile has no Message button, a private account you do not follow, and the condition should have skipped it. Reselect the header in Get data from bot's current page so it covers the button. When a run fails, hand it to the agent and it repairs the step.
How many Instagram DMs can I send in one run?
A few at a time. Set Maximum cycles on Loop through data to 5 to send five, and raise it once you know the account is not being limited. Schedule the automation to send a batch a day rather than everything at once.
Why does the run stop when Instagram shows a prompt over the conversation?
The prompt covers the text box. Add another optional Click element by its button text. See closing pop-ups and prompts. When a run fails, hand it to the agent and it repairs the step.
Can I personalise each Instagram DM?
Yes, two ways. Add more columns to the sheet, such as the person's name or the product you are writing about, and insert them into Text on Enter text alongside the message column, or build the whole message with Enter custom data and send [custom-data]. Or take the details from the profile page itself: add a Get data from bot's current page step inside the If condition, before Enter text, that scrapes the name or bio, and insert [scrape-data] into the message. Either change is a line to the agent, which adjusts the bot for you.
Can I send Instagram DMs without code?
Yes. Every step here is a no-code step in the Chrome extension, and the agent builds them from the lines above; there is no Instagram API or script involved.
Can I run the Instagram DM automation on a schedule?
Yes. Save the automation and set a schedule; each run skips the rows marked Sent and sends the next batch, so a batch a day works through the list.
What happens to profiles with no Message button?
The If condition skips them, and the row is left unmarked, so the next run tries them again. To stop that, add the same Find row in a Google Sheet and Write data to a Google Sheet steps after the If condition with a second Enter custom data step holding Skipped, and add Skipped to the words removed in step 3.0.
Can I like each user's newest post as well as DM them?
Yes. Send Instagram DMs and like each user's latest post adds the like, and you can copy its steps into this automation.
Can I send Instagram DMs in the cloud or only on my machine?
Either. In the cloud it needs the login steps from automate Instagram login with 2FA, or Store Cookie turned on on the first Go to page step with one signed-in run; on the desktop app it uses the Instagram session already in your browser.
Where do I get help?
Get in touch with support, or ask in the axiom.ai community.
Related guides
Send Instagram DMs and like each user's latest post
- Read the profile links and messages from my sheet
- Skip any rows already marked Sent and liked
- Open each profile link
- Check the profile header for the word Message
- If it is there, click Message and send the message
- Then open their newest post and like it
- Write Sent and liked back into the row, column C
Send X (Twitter) DMs from a Google Sheet
- Open each X profile link in my sheet
- If the profile has a Message button, click it
- Type my message and send it
- Delete the profile from the sheet once done
Bulk delete Gmail emails to clean up your inbox
- Take my list of senders and search terms
- Search my Gmail inbox for each one
- Select every email that matches
- Delete them all