Daily foot traffic anomaly alerts in Slack

By General Input

Every weekday morning, get one Slack message listing only the venues whose foot traffic swung outside your threshold.

Integrations

  • Placer.ai
  • Google Sheets
  • Slack

Type

Deterministic Code

Categories

  • Operations
  • Marketing

Build a code workflow that runs every weekday at 7am local time and posts a Slack alert about foot traffic anomalies for a list of tracked venues. The full pipeline is deterministic, no LLM reasoning needed.

Trigger: cron, Monday through Friday at 7:00am. Make the time zone configurable.

Step 1. Read the watch list from Google Sheets. Use the Google Sheets Get Values operation on a tab called venues. Each row has: venue name, Placer.ai ApiId (composite id like venue:597d121159b03f6cf8e78962), venue URL, and an optional threshold expressed as a decimal (e.g. 0.15 means plus or minus 15%). Default threshold is 0.15 when the column is blank.

Step 2. For each venue, call the Placer.ai Visit Trends Report operation with daily granularity for the prior 28 days (end date = yesterday, start date = 28 days before yesterday, inclusive). Use a single collection request batching the venues when possible to reduce API calls. Handle the Placer.ai async pattern: a 202 means the report is still generating, retry the same request body after ~5 seconds until a 200 comes back. Calls returning 202, 429, or 5xx do not count against the weekly quota.

Step 3. For each venue, compute deterministically: the 7-day rolling average of daily visits over the most recent 7 days, the trailing 28-day baseline average over the full window, and the percentage change = (recent7 - baseline28) / baseline28. Flag the venue when abs(percentageChange) > threshold. Skip any venue where Placer.ai returned no data (204) or fewer than 7 days of values.

Step 4. If at least one venue is flagged, append one row per flagged venue to a tab named history in the same spreadsheet using Google Sheets Append Values. Columns: run date, venue name, ApiId, recent 7-day avg, 28-day baseline, percentage change, direction (up or down), threshold used.

Step 5. Post a single Slack message to a configured channel using the Slack Send a Message operation. Use Slack mrkdwn and Block Kit. Header line summarizes how many venues moved. Then a clean bulleted list, one line per flagged venue, sorted by absolute percentage change descending. Each line shows the venue name as a clickable link to the venue URL, an up or down arrow, the percentage change rounded to one decimal, and the recent vs baseline numbers in parentheses. If zero venues flag, do not post anything (silent days are fine).

Inputs the user configures at setup: the Google Sheet ID, the venues tab name (default venues), the history tab name (default history), the Slack channel ID, the default threshold (default 0.15), and the schedule time zone.

Credentials needed: Placer.ai (API key), Google Sheets (OAuth, write scope so the history tab can be appended to), Slack (user OAuth, chat:write).

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageWin back LiveChat visitors whose chats went unansweredLet 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 boardChat quality review board for LiveChat support leadsLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seats