Mailchimp Audiences MemberStatusChangeTrigger

Mailchimp Audiences MemberStatusChangeTrigger

Certified

Trigger on Mailchimp member status changes

Polls GET /lists/{listId}/members for members with the given status, by last change time (last_changed), and starts one execution per poll with every member changed since the last poll, stored as an ION file (trigger.uri, trigger.count).

last_changed also moves on edits that do not change the status (merge fields, tags...), so an already unsubscribed member that is edited fires again. Rows with another status are ignored.

The position is kept in the namespace KV Store, per flow, trigger, status and audience (changing status starts over with a first poll): the newest last_changed seen plus the ids seen at exactly that time. The first poll only records the current position. Each poll reads at most 1000 rows (more only when they all share one timestamp), so a backlog larger than 1000 drains over several polls.

yaml
type: io.kestra.plugin.mailchimp.audiences.MemberStatusChangeTrigger

Push unsubscribes to a suppression list.

yaml
id: mailchimp_unsubscribes
namespace: company.team

triggers:
  - id: unsubscribed
    type: io.kestra.plugin.mailchimp.audiences.MemberStatusChangeTrigger
    apiKey: "{{ secret('MAILCHIMP_API_KEY') }}"
    listId: "a1b2c3d4e5"
    status: UNSUBSCRIBED
    interval: PT10M

tasks:
  - id: log
    type: io.kestra.plugin.core.log.Log
    message: "{{ trigger.count }} member(s) unsubscribed: {{ trigger.uri }}"
Properties

Audience ID

Mailchimp audience (list) id, found in the audience settings or with ListAudiences.

Possible Values
SUBSCRIBEDUNSUBSCRIBEDCLEANEDPENDINGTRANSACTIONAL

Status

Fire for members that now have this status: SUBSCRIBED, UNSUBSCRIBED, CLEANED, PENDING or TRANSACTIONAL. Sent lower case to Mailchimp.

OAuth access token

Set exactly one of apiKey or accessToken. server is required with an access token.

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

Mailchimp API key

Set exactly one of apiKey or accessToken. The data center is taken from the key suffix (for example -us19) unless server is set.

Base URL override

Replaces https://<server>.api.mailchimp.com/3.0. The credential is sent to this URL, so it must be an https *.api.mailchimp.com host.

DefaultSTORE
Possible Values
STOREFETCHFETCH_ONENONE

Fetch strategy

STORE: write the new rows as ION to internal storage and return the uri. FETCH: return the new rows in rows (at most one page of 1000, or more when they share one timestamp). Default STORE.

DefaultPT5M
Formatduration

Polling interval

Time between two polls. Defaults to 5 minutes, minimum 30 seconds to stay well within Mailchimp's rate limits.

Default3

Max retries

Retries done by this plugin on HTTP 429 (all methods) and on 5xx or I/O errors (GET and PUT only), with exponential backoff. Default 3, between 0 and 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.

Data center

Mailchimp data center such as us19. Required with accessToken, optional with apiKey (overrides the key suffix).

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

DefaultPT2M

Request timeout

Idle read timeout of each call: how long to wait without receiving data. Default PT2M, must be positive. Mailchimp itself cuts requests off after 120 seconds.

Defaulttrue

A condition that determines whether the trigger should run.

A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.

Number of new members

Number of new members, as rows in the uri file or in rows.

Audience ID

Mailchimp audience (list) id the members belong to.

SubTypeobject

New members

The new members, same fields as ListMembers, oldest first. Set when fetchType is FETCH.

Formaturi

New members URI

ION file in internal storage, one row per member, same fields as ListMembers, oldest first. Set when fetchType is STORE.