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.

Author
Alex Barlow
Published

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.

  1. Read the profile links and messages from my sheet
  2. Skip any rows already marked Sent
  3. Open each profile link
  4. Check the profile header for the word Message
  5. If it is there, click Message and send the message
  6. Write Sent back into the row, in column C
Click to launch the Chrome extension. Not installed? You can create an account and try it free.Opens the Chrome extension. Free account to try.

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 data
    • Custom data: Sent
  • 2.0 Read data from a Google Sheet
    • Spreadsheet: your sheet, the profile link in column A and the message in column B
    • Last cell: far enough right to include column C
  • 3.0 Remove results that contain certain words
    • Data: [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 page
      • URL: the profile link column of [word-removed-data]
    • 4.2 Get data from bot's current page
      • Select: the profile header, the area holding the Message button
    • 4.3 If condition
      • Data to check: [scrape-data]
      • Condition to check: Message, in the word Instagram shows in your language
      • Reverse condition: Run steps if condition is true
      • 4.3.1 Click element
        • Select: the Message button
        • Click: Custom with Use element text instead of HTML on
      • 4.3.2 Wait
      • 4.3.3 Click element
        • Select: the Not now button
        • Click: Custom with Use element text instead of HTML on
        • Optional click: on
      • 4.3.4 Wait
      • 4.3.5 Enter text
        • Select text field: the conversation's text box
        • Text: the message column of [word-removed-data]
      • 4.3.6 Press key(s)
        • Key: Return
      • 4.3.7 Find row in a Google Sheet
        • Spreadsheet: your sheet
        • Values (comma separated): the profile link column of [word-removed-data]
        • Exact match: on
        • Columns (optional): 1
      • 4.3.8 Write data to a Google Sheet
        • Spreadsheet: your sheet
        • DATA: [custom-data]
        • Write options: Add to existing data
        • Starting cell: C[find-row-google-sheet]

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