Mailchimp Audiences NewSubscriberTrigger

Mailchimp Audiences NewSubscriberTrigger

Certified

Trigger on new Mailchimp subscribers

Polls GET /lists/{listId}/members for subscribed members by opt-in time (timestamp_opt) and starts one execution per poll with every new subscriber, stored as an ION file (trigger.uri, trigger.count).

The position is kept in the namespace KV Store, per flow, trigger and audience: the newest timestamp_opt seen plus the ids seen at exactly that time, so members opting in during the same second are neither lost nor fired twice. The first poll only records the current position: existing subscribers do not fire. 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.

Members are tracked by opt-in time (timestamp_opt): a member imported or added with a timestamp_opt older than the stored position (for example a backfill import keeping the original opt-in dates) does not fire.

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

Log every new subscriber of an audience.

yaml
id: mailchimp_new_subscriber
namespace: company.team

triggers:
  - id: new_subscriber
    type: io.kestra.plugin.mailchimp.audiences.NewSubscriberTrigger
    apiKey: "{{ secret('MAILCHIMP_API_KEY') }}"
    listId: "a1b2c3d4e5"
    interval: PT5M

tasks:
  - id: log
    type: io.kestra.plugin.core.log.Log
    message: "{{ trigger.count }} new subscriber(s) in {{ trigger.listId }}: {{ trigger.uri }}"
Properties

Audience ID

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

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.