Skip to content

Start a workflow from Mailchimp Transactional events

To run a workflow when Mailchimp Transactional reports that an email was sent, delivered, opened, clicked, or bounced, add a Webhook block whose Source is Mailchimp Transactional (Mandrill) and give its URL to a webhook in Mailchimp Transactional. Mailchimp Transactional posts up to 1,000 events in one request, as a list. Each event in the list starts its own run.

Mailchimp Transactional was called Mandrill, and its pages and requests still use that name in places. The Mailchimp source is a different one: it receives the audience webhooks of Mailchimp’s marketing product.

You need a Mailchimp Transactional account in which you can add webhooks, and edit access to the workflow’s project. The Mailchimp Transactional steps happen in its own console.

Add the Webhook block and generate its URL

Section titled “Add the Webhook block and generate its URL”
  1. In a draft workflow, add a Webhook block. The block palette also lists Mailchimp Transactional (Mandrill) webhook in the Start group, which adds the block with its source already set.
  2. Under Source, choose Mailchimp Transactional (Mandrill). The line under the setting reads “Verifies the signature · one run per event in a batch · skips duplicates”.
  3. Under Webhook URL, select Generate URL, then copy the URL.

The badge beside the URL reads “Runs start after publish”. The URL contains a token, and anyone who has the URL can send requests to it. Keep it out of shared documents.

Create the webhook in Mailchimp Transactional

Section titled “Create the webhook in Mailchimp Transactional”
  1. In Mailchimp Transactional, open the webhooks page and select Add a Webhook.
  2. Under Trigger on Events, choose the events Mailchimp Transactional sends to this URL.
  3. Paste the URL you copied into Post To URL, exactly as the block shows it.
  4. Select Create Webhook.

Enter the URL with nothing added, removed, or changed. Mailchimp Transactional signs each request over the URL as you entered it, and OutWin checks the signature against the block’s own URL. With a key saved, a webhook whose URL differs from the block’s fails the check on every delivery.

When you create the webhook, Mailchimp Transactional checks that the URL answers. The block answers the check itself, also while the workflow is a draft. Recent deliveries lists the check as Handshake with “Mailchimp Transactional (Mandrill) checked that the URL answers.”, and the last line under Set up reads the same. It starts no run.

The Webhook block offers these event types: send, deferral, hard_bounce, soft_bounce, delivered, open, click, spam, unsub, and reject.

Mailchimp Transactional makes a key for each webhook when the webhook is created, and signs each request with it. Its documentation calls it the webhook’s authentication key. The key lets OutWin check the signature.

  1. In Mailchimp Transactional, find the webhook on the webhooks page and copy its key.
  2. In OutWin, paste the key into Key in the block’s settings and select Save.

After you save, the settings show only the last four characters of the key, with Replace and Remove. Under Set up, the second line changes to “The key is saved: deliveries are verified.”

Mailchimp Transactional issues the key for one webhook, so OutWin saves it on the block’s URL. It is not saved on a connection. A second Webhook block has its own URL and needs its own webhook and key. If you reset the key on the webhooks page, copy the new one and select Replace in OutWin.

Without a saved key the block still starts runs, and nothing is verified: anyone who has the URL can start the workflow. Publishing then shows a warning that ends “has no signing secret saved, so its deliveries are not verified: anyone who has this URL can start this workflow”. The warning does not block publishing.

Under Events that start a run, tick the event types that start a run. With none ticked, every event Mailchimp Transactional sends starts a run. To start runs for a type that is not listed, type it into the box under the list and select Add.

An event whose type is not ticked is listed as Filtered out and starts no run. To narrow further by a field of the event, add a row under Only when. Webhook settings lists the comparisons.

  1. Send an email through Mailchimp Transactional so that it causes one of the events the webhook sends.
  2. In OutWin, look under Recent deliveries in the block’s settings.

Recent deliveries lists every event that reached the URL, including while the workflow is a draft. Events that arrived in one request are listed one by one, each marked with its place in the request, such as “2 of 5”. On a draft each is listed as Dropped with “The workflow is not published, so nothing ran.” It starts no run and is not run later. The last line under Set up changes from “Mailchimp Transactional (Mandrill) checked that the URL answers.” to, for example, “Received send. Dropped.”

With a key saved, an event listed as Dropped on a draft has passed the signature check. A delivery that fails the check is listed as Refused.

If you have edit access, select an event to see what the block passed on. The list is kept for seven days, and the data of the newest 20 events is kept.

Each run receives one event of the list. An HTTP request block or a database block directly after the Webhook block reads it with these expressions. An AI block such as Think receives the whole value as its input.

Expression What it holds
{{input.body}} The event as Mailchimp Transactional sent it, with fields such as event, ts, _id, and msg. Other fields depend on the event type.
{{input.body.msg.email}} One field of the message the event is about. Read any other field the same way.
{{input.event.type}} The event’s type, such as open. It is the event’s event field.
{{input.event.id}} An id OutWin builds from the event’s _id, event, and ts fields, because _id is the id of the message and not of the event.
{{input.event.time}} The event’s time as an ISO 8601 date and time. {{input.body.ts}} holds the same moment as Mailchimp Transactional sent it, in seconds.
{{input.delivery.verified}} true only when the signature was checked and passed.

A block further along reads the same values through the Webhook block’s name, as in {{steps["Mailchimp Transactional (Mandrill)"].body.msg.email}} for a block that kept the name it was added with. Data and context describes what each block passes on.

Publish the workflow. From then on, each event that passes the filter starts a run. On a published workflow the block’s settings are read-only, and Recent deliveries is in the block’s inspector. You can still replace the key there.

Outcome What happened
Ran The event started a run.
Waiting 10 runs of the workflow are already active. The event starts a run when one of them ends. An event that waits longer than an hour is listed as Dropped.
Duplicate An event with the same id already ran in the last 72 hours. The line reads “This event was already received and run, so it did not run again.”
Handshake Mailchimp Transactional’s check of the URL. It starts no run.

Runs start in the order events arrive. That is not always the order things happened, so do not build a workflow that relies on send arriving before open.

Receiving an event costs no credits, and neither does an event that is filtered out, a duplicate, or a handshake. A run that starts uses credits for the blocks that run in it.

Open Recent deliveries and read the outcome and the sentence beside the newest event.

What you see Cause Fix
“Nothing has arrived yet.” No request has reached the URL, not even the check of the URL. Check that the URL of the webhook in Mailchimp Transactional is the block’s current URL. Rotate token on a published workflow changes the URL, and the old one stops working.
Handshake and nothing else Mailchimp Transactional reached the URL, and no event the webhook sends has happened since. Check that the webhook sends the event you caused, and cause it again.
Dropped with “The workflow is not published, so nothing ran.” The workflow is a draft. Publish the workflow. Events that arrived before then are not run later.
Dropped with “The workflow is paused, so nothing ran.” The workflow is paused. Resume the workflow. Events that arrived while it was paused are not run later.
Filtered out with Events of type "click" are not chosen on this trigger. The event’s type is not ticked under Events that start a run. Tick the type, or clear every tick so that all events start a run. The settings are read-only on a published workflow.
Refused with “The signature did not match. Check that the secret saved here is the one the sender shows for this URL.” The saved key is not the one Mailchimp Transactional shows for this webhook, or the webhook’s URL is not exactly the block’s URL. The key differs when it was copied from another webhook or was reset after it was copied. Compare the webhook’s URL with the block’s URL, character by character, and correct it in Mailchimp Transactional. Then copy the webhook’s key again and select Replace. You do not republish the workflow.
Refused with “The request carried no signature.” A key is saved in OutWin, and the request did not carry Mailchimp Transactional’s signature. A request sent by hand to try the URL has none. Send an email through Mailchimp Transactional so that it sends the request.

A delivery listed as Refused is answered with status 401 and starts nothing. OutWin keeps none of its data. For every other outcome in the table, Mailchimp Transactional receives a success response and OutWin does not run the event later.