{
  "schema_version": "1.0.0",
  "id": "monthly-revenue-narrative",
  "title": "Write a monthly revenue note from the finance sheet",
  "category": "reporting",
  "difficulty": "intermediate",
  "featured": false,
  "description": "On the first of the month, read last month's revenue summary row and have AI write a short plain-English note emailed to the partners.",
  "tags": [
    "reporting",
    "revenue",
    "ai-summary",
    "google-sheets",
    "monthly"
  ],
  "apps": [
    "Schedule by Zapier",
    "Google Sheets",
    "AI by Zapier",
    "Gmail"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 3 steps after the trigger",
      "AI by Zapier"
    ]
  },
  "tasks": {
    "typical": 3,
    "max": 3
  },
  "trigger": {
    "app": "Schedule by Zapier",
    "event": "Every Month",
    "kind": "schedule",
    "title": "First of the month at 9am",
    "why": "Runs on the first of each month, after the books for the previous month are closed.",
    "config": {
      "Day of the Month": "1",
      "Time of Day": "9am",
      "Timezone": "YOUR_TIMEZONE"
    },
    "outputs": [
      "pretty_date",
      "date",
      "day_of_week",
      "week_of_year"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "month",
      "kind": "search",
      "app": "Google Sheets",
      "event": "Lookup Spreadsheet Row",
      "title": "Read last month's summary row",
      "why": "The summary tab keeps one row keyed `last_month`, filled by formulas from the ledger tab.",
      "fields": {
        "Drive": "My Google Drive",
        "Spreadsheet": "Finance",
        "Worksheet": "Monthly summary",
        "Lookup Column": "key",
        "Lookup Value": "last_month",
        "Should this step be considered a \"success\" when nothing is found?": "Yes"
      },
      "outputs": [
        "row_number",
        "_zap_search_was_found_status",
        "month_label",
        "revenue",
        "revenue_prior",
        "new_clients",
        "lost_clients",
        "top_client",
        "top_client_share",
        "notes"
      ]
    },
    {
      "key": "note",
      "kind": "ai",
      "app": "AI by Zapier",
      "event": "Analyze and Return Data",
      "title": "Write the note",
      "why": "The prompt allows only the figures in the row, so the note cannot invent a number.",
      "fields": {
        "Model": "Default (fast)",
        "Instructions": "Write a monthly revenue note for business partners. Use only the figures given; do not calculate anything beyond the percentage change in revenue. Return subject (under 70 characters) and body (two short paragraphs: first what changed and by how much, second the client movements and any concentration risk if the top client is over 30 percent of revenue; end with the notes line if present). Plain text, no bullet points.",
        "Input data": "Month: {{month.month_label}}\nRevenue: {{month.revenue}} (prior month {{month.revenue_prior}})\nNew clients: {{month.new_clients}}\nLost clients: {{month.lost_clients}}\nTop client: {{month.top_client}} at {{month.top_client_share}} percent\nNotes: {{month.notes}}",
        "Output fields": "subject, body"
      },
      "outputs": [
        "subject",
        "body"
      ]
    },
    {
      "key": "send",
      "kind": "action",
      "app": "Gmail",
      "event": "Send Email",
      "title": "Email the partners",
      "why": "Sent from the bookkeeper's mailbox so replies come back to a person.",
      "fields": {
        "To": "YOUR_PARTNERS_LIST",
        "Subject": "{{note.subject}}",
        "Body Type": "plain",
        "Body": "{{note.body}}\n\nSheet: YOUR_SHEET_URL",
        "From Name": "YOUR_NAME"
      },
      "outputs": [
        "id",
        "thread_id"
      ]
    }
  ]
}
