Request icon
Script icon
ForEach icon
Schedule icon

Sync Google Sheets Leads to a Mailchimp Subscriber List

Poll a Google Sheet on a schedule and subscribe every lead email to a Mailchimp audience with Kestra's HTTP, Python, and ForEach tasks.

Categories
BusinessData

Keep your Mailchimp audience in sync with a Google Sheet of leads, no manual CSV exports or imports. This blueprint polls a spreadsheet range on a schedule, extracts every valid email address, and subscribes each one to a Mailchimp list through the Members API. It closes the gap between where teams capture leads (a shared sheet) and where they nurture them (an email platform), turning a recurring copy and paste chore into a hands-off, near real time pipeline built entirely from Kestra core HTTP and scripting tasks.

How it works

  1. The every_two_minutes trigger (io.kestra.plugin.core.trigger.Schedule, cron */2 * * * *) fires the flow every two minutes.
  2. read_google_sheets (io.kestra.plugin.core.http.Request) sends a GET to the Google Sheets v4/spreadsheets/{id}/values/{range} endpoint, authenticated with a bearer token, and returns the range as JSON.
  3. parse_rows (io.kestra.plugin.scripts.python.Script) loads the response body, skips the header row, keeps only rows whose first column contains an @, and emits the cleaned list via Kestra.outputs.
  4. subscribe_emails (io.kestra.plugin.core.flow.ForEach) iterates the email list with a concurrencyLimit of 5, running add_to_mailchimp (io.kestra.plugin.core.http.Request) to POST each address with status: subscribed to the Mailchimp lists/{id}/members endpoint.

What you get

  • A scheduled, end to end sync from spreadsheet rows to Mailchimp subscribers.
  • Header skipping and email validation so only clean addresses are pushed.
  • Parallel subscription with a bounded concurrency limit to respect API rate limits.
  • Parameterized inputs for sheet ID, range, audience ID, and datacenter, so the same flow serves many lists.

Who it's for

  • Marketing teams capturing inbound leads in a shared sheet and feeding them straight into campaigns.
  • Sales operations replacing one off list uploads with a continuous sync.
  • RevOps and growth engineers wiring lightweight integrations without standing up a custom service.

Why orchestrate this with Kestra

Mailchimp and Google Sheets each have their own scheduling, but neither can watch a sheet and reconcile it against an audience on its own. Kestra gives you a declarative YAML flow with a native event and time trigger, automatic retries on transient HTTP failures, full execution lineage and logs for every subscribed address, and bounded parallelism through ForEach. You get observability and rerun control across two SaaS APIs that otherwise have no shared scheduler.

Prerequisites

  • A Google Cloud OAuth token with read access to the target spreadsheet.
  • A Mailchimp account, API key, audience (list) ID, and datacenter prefix.

Secrets

  • GOOGLE_OAUTH_TOKEN: bearer token for the Google Sheets API.
  • MAILCHIMP_API_KEY: API key used as the bearer token for the Mailchimp Members API.

Quick start

  1. Add the GOOGLE_OAUTH_TOKEN and MAILCHIMP_API_KEY secrets to your Kestra instance.
  2. Set the sheet_id, sheet_range, mailchimp_list_id, and mailchimp_datacenter inputs.
  3. Confirm column A of your range holds email addresses with a header row on top.
  4. Run the flow once manually, then let the schedule take over every two minutes.

How to extend

  • Map additional sheet columns (name, tags) into Mailchimp merge fields in the POST body.
  • Swap the Schedule trigger for a webhook to sync on demand.
  • Add a deduplication or hashing step before subscribing to skip already synced rows.
  • Branch on the Mailchimp response to log or alert on failed subscriptions.

Links

Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.