Automations

Your daily reports, as scripts.

Fetch the numbers, shape the message, post it to the client's Slack every morning.

How it works

Write it, test it, earn the schedule.

Automations in 0:37, with captions.
01

Start from the starter

A small script in the client's space. It reaches only the hosts you allow.

02

Run it to check

Run now shows the raw data beside the message, and posts nothing.

03

Turn on the schedule

Once a test run passes, it posts every morning to the client's channel.

The example library

Three scripts to copy.

The scripts we run ourselves, with a demo client in place of the real one.

Daily email performance

Every morning at 08:00

Yesterday's campaigns and flows: revenue, orders and each campaign by name.

var campaigns = report("campaign-values-reports", "yesterday");var flows = report("flow-values-reports", "yesterday");var revenue = sum(campaigns) + sum(flows);return { text: "Email, yesterday", blocks: grid(revenue, orders, campaigns, flows) };

A/B tests in progress

Every day at 10:00

Every running test on the client's store, with each variant's numbers.

var running = experiments().filter(function (e) { return e.status === "running"; });if (!running.length) return null;return { text: running.length + " tests running",  blocks: running.map(function (e) { return variantRows(e, CURRENCY); }) };

Monthly photo request

The 15th, with reminders

Asks the client for next month's photos in a thread and saves what comes back.

var month = nextMonth(); var id = store.get("ask:" + month);if (!id) { store.set("ask:" + month, slack.post(question(month))); return null; }var files = slack.replies(id).flatMap(function (r) { return r.files; });if (files.length) { save(files); return "Saved " + files.length + " photos."; }

The details

Ask the client in a thread
slack.post gives back the message's id, slack.replies reads the thread under it (text, files, reactions), store keeps a small notebook between runs, and slack.copyFile saves a file from a reply. Return null when there is nothing to say.
The rules it keeps
Secrets never come back: names are listed, values never return, and every run's history is scrubbed of them. Run now never posts. The page is for workspace admins, and each automation lives in one client's space.
The sandbox
Scripts run with a sixty-second budget and no clock library, so dates are computed by hand; the examples show how. A scheduled run that fails tells the owner, not the channel.
Feeds the Growth Lab
A bet closes with the result the morning report shows. How a week in the lab runs.