Mailchimp Account
Tasks that check the connection to a Mailchimp account.
Tasks that connect Kestra workflows to Mailchimp.
Manage audiences, members, tags and campaigns in Mailchimp, read campaign reports, and trigger flows on new subscribers, status changes and sent campaigns. Authenticate with an API key or OAuth access token and keep credentials in secrets.
Manage audiences, members, tags and campaigns, read campaign reports, and start flows on new subscribers or sent campaigns, without custom scripts, with the Mailchimp Marketing API.
Every task and trigger accepts the same connection properties. Store credentials as secrets, e.g. {{ secret('MAILCHIMP_API_KEY') }}, and set them once for a whole namespace with plugin defaults. Set exactly one of:
apiKey): the data center (server) is read from the key suffix, e.g. -us19. Set server only to override it.accessToken): server is then required (for example us19). Run the OAuth code flow once outside Kestra, read the dc value from https://login.mailchimp.com/oauth2/metadata, and store the token as a secret.The credential is sent in an Authorization: Bearer header, never in the URL, and redirects are not followed. baseUrl replaces the API root. It receives your credential, so it must be an https *.api.mailchimp.com host; anything else is rejected. Only the Kestra operator can allow http on localhost / 127.0.0.1 (for a local proxy or mock), by starting the JVM with -Dkestra.plugin.mailchimp.allow-local-base-url=true.
id: mailchimp_ping
namespace: company.team
tasks:
- id: ping
type: io.kestra.plugin.mailchimp.account.Ping
apiKey: "{{ secret('MAILCHIMP_API_KEY') }}"
account.Ping checks that your credentials and data center are valid.audiences.ListAudiences lists audiences (lists).audiences.ListMembers lists the members of an audience, with filters on status and change dates. Required: listId.audiences.UpsertMember adds a contact or updates an existing one (status, merge fields, tags, language, VIP). Required: listId, email, statusIfNew.audiences.BatchSubscribe subscribes or updates many members from a list of items or an ION file, in chunks of up to 500 per request. Required: listId, from.audiences.UpdateMemberTags adds and removes tags on one member. Required: listId, email, tags.campaigns.ListCampaigns lists campaigns, with filters on type, status, audience and send time.campaigns.SendCampaign sends a campaign, after checking its send checklist. Required: campaignId.reports.GetCampaignReport returns the report summary (opens, clicks, bounces...) of a sent campaign. Required: campaignId.reports.ListEmailActivity lists what each recipient of a sent campaign did. Required: campaignId.Tasks that return many items (ListAudiences, ListMembers, ListCampaigns, ListEmailActivity) take a fetchType: FETCH returns the items in rows, FETCH_ONE returns the first one in row, STORE writes them as an ION file to Kestra internal storage and returns a uri, and NONE only counts them. ListAudiences and ListCampaigns default to FETCH; ListMembers and ListEmailActivity default to STORE, because an audience can hold many thousands of rows. Use maxItems to bound a large result.
All triggers share interval (default PT5M, minimum PT30S, checked when the flow is saved) and fetchType: STORE (default) writes the new items to an ION file and returns its uri, FETCH returns them in rows.
audiences.NewSubscriberTrigger starts an execution when new members join an audience. Required: listId. Outputs: listId, count, uri or rows.audiences.MemberStatusChangeTrigger starts an execution when members get a given status, such as UNSUBSCRIBED. Required: listId, status. Outputs: listId, count, uri or rows.campaigns.CampaignSentTrigger starts an execution when campaigns have been sent. Optional: listId, includeReport. Outputs: count, uri or rows, campaignId, sendTime, title, report.How they poll:
uri) or in rows.SendCampaign or BatchSubscribe) is not replayed after a 5xx or timeout; it is retried only when Mailchimp answers 429, which means the request was rejected. If one of them fails that way, check Mailchimp before re-running the flow. Each retry is logged as a warning.maxRetries defaults to 3 (0 to 10). Kestra's HTTP client also replays a GET or PUT once after a 429 or 503 on its own, so 0 only turns off the plugin's retries. Kestra's task-level retry stays available on top.timeout is an idle read timeout of each call and defaults to 120 seconds, Mailchimp's own limit.UpsertMember and BatchSubscribe can subscribe people directly. Only add contacts who gave consent, and use statusIfNew: PENDING for double opt-in. You are responsible for GDPR and Mailchimp's terms.
SendCampaign is irreversible: Mailchimp emails the whole audience and the send cannot be recalled. By default the task fails without sending when the campaign's send checklist is not ready. Only send campaigns you have reviewed.
OAuth token helper task, webhooks, the Mailchimp batch operations endpoint, and creating or editing campaigns and audiences.