Weekly Smartlead performance snapshot to Google Sheets

By General Input

Every Monday at 8am, log last week's Smartlead campaign metrics into a shared Google Sheet so your team has one source of truth for outbound.

Integrations

  • Smartlead
  • Google Sheets

Type

Deterministic Code

Categories

  • Sales
  • Operations

Build me a code-based workflow that publishes a weekly Smartlead campaign performance snapshot into a shared Google Sheet, so the team has a single source of truth for outbound metrics.

Trigger: run on a cron every Monday at 8:00am local time.

Steps:

1. Call Smartlead List Campaigns to enumerate all campaigns on the connected account. Paginate through all results.

2. Compute the previous ISO week window (Monday 00:00 through Sunday 23:59 of the week before the run). This is always within Smartlead's 30-day per-request cap for the analytics-by-date endpoint.

3. For each campaign returned in step 1, call Smartlead Get Campaign Analytics by Date scoped to that previous-week window. Preserve the campaign id and name alongside the returned metrics.

4. For each campaign, build one row with these columns in order: week_of (the Monday date of the reported week, ISO format), campaign_name, sent, unique_opens, unique_clicks, replies, bounces, unsubscribes, open_rate, reply_rate, bounce_rate. Compute open_rate = unique_opens / sent, reply_rate = replies / sent, bounce_rate = bounces / sent. Guard against divide-by-zero by writing 0 when sent is 0. Format rates as decimals rounded to 4 places (the sheet can format them as percentages).

5. Call Google Sheets Append Values once with all rows for the week, targeting a spreadsheet id and a tab named "Weekly Performance". Use valueInputOption USER_ENTERED so numeric columns are stored as numbers. Append below the last row of existing data so the tab acts as a rolling history.

Inputs the user should configure on the workflow: the target Google spreadsheet id, the tab name (default "Weekly Performance"), and the timezone used to anchor "previous ISO week" and the 8am run time.

The pipeline is fully deterministic with a fixed column mapping. There is no drafting, sentiment, or reasoning step. Handle Smartlead's 429 responses with exponential backoff using the x-ratelimit-reset header, and keep the whole run idempotent enough to safely re-run if it fails partway (for example, log the campaign ids you have already written this week).

Connections needed: Smartlead (API key) and Google Sheets (OAuth with write access to the target spreadsheet).

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seatsBuild audience segments from product usage and push to LoopsTurn the people who engage with your posts into Pipedrive leads