{
  "name": "Make Notion-to-Slack Weekly Digest — Purrly",
  "flow": [
    {
      "id": 1,
      "module": "builtin:BasicScheduler",
      "version": 1,
      "parameters": {
        "label": "Every Monday 09:00 workspace time",
        "schedule": "0 9 * * 1"
      },
      "mapper": {},
      "metadata": {
        "designer": { "x": 0, "y": 0 },
        "restore": {
          "parameters": {
            "schedule": { "value": "0 9 * * 1" }
          }
        },
        "parameters": [
          { "name": "schedule", "type": "text", "label": "Cron expression" },
          { "name": "label", "type": "text", "label": "Schedule name" }
        ]
      }
    },
    {
      "id": 2,
      "module": "notion:SearchObjects",
      "version": 1,
      "parameters": {
        "connection": "[NOTION_CONNECTION]",
        "databaseId": "[NOTION_DATABASE_ID]",
        "limit": 100
      },
      "mapper": {
        "query": "",
        "filter": {
          "property": "Status",
          "select": { "equals": "[INCLUDE_STATUS]" }
        },
        "sorts": [
          { "property": "Updated", "direction": "descending" }
        ]
      },
      "metadata": {
        "designer": { "x": 320, "y": 0 },
        "restore": {
          "parameters": {
            "connection": { "label": "Notion connection" },
            "databaseId": { "label": "Database ID" },
            "limit": { "value": "100" }
          }
        },
        "parameters": [
          { "name": "connection", "type": "account", "label": "Notion connection" },
          { "name": "databaseId", "type": "text", "label": "Database ID" },
          { "name": "limit", "type": "number", "label": "Maximum rows" }
        ]
      }
    },
    {
      "id": 3,
      "module": "builtin:BasicIterator",
      "version": 1,
      "parameters": {
        "array": "{{2.results}}"
      },
      "mapper": {
        "title": "{{2.properties.Name.title[1].plain_text}}",
        "owner": "{{2.properties.Owner.people[1].name}}",
        "status": "{{2.properties.Status.select.name}}",
        "updated_at": "{{2.last_edited_time}}",
        "link": "{{2.url}}"
      },
      "metadata": {
        "designer": { "x": 640, "y": 0 },
        "restore": {
          "parameters": {
            "array": { "value": "{{2.results}}" }
          }
        },
        "parameters": [
          { "name": "array", "type": "array", "label": "Notion result array" }
        ]
      }
    },
    {
      "id": 4,
      "module": "builtin:TextAggregator",
      "version": 1,
      "parameters": {
        "feeder": 3,
        "rowSeparator": "\n"
      },
      "mapper": {
        "text": "• *{{3.title}}* — {{ifempty(3.owner; \"Unassigned\")}} · {{3.status}} · <{{3.link}}|open in Notion>"
      },
      "metadata": {
        "designer": { "x": 960, "y": 0 },
        "restore": {},
        "parameters": [
          { "name": "feeder", "type": "array", "label": "Source module" },
          { "name": "rowSeparator", "type": "text", "label": "Row separator" }
        ]
      }
    },
    {
      "id": 5,
      "module": "slack:ActionCreateMessage",
      "version": 1,
      "parameters": {
        "connection": "[SLACK_CONNECTION]",
        "channel": "[SLACK_CHANNEL]"
      },
      "mapper": {
        "text": ":spiral_calendar_pad: *Weekly Notion digest — {{formatDate(now; \"YYYY-MM-DD\")}}*\n\n{{ifempty(4.text; \"No matching Notion updates this week.\")}}\n\n_{{4.length}} items · generated by Make_",
        "as_user": true
      },
      "metadata": {
        "designer": { "x": 1280, "y": 0 },
        "restore": {
          "parameters": {
            "connection": { "label": "Slack connection" },
            "channel": { "label": "Destination channel" }
          }
        },
        "parameters": [
          { "name": "connection", "type": "account", "label": "Slack connection" },
          { "name": "channel", "type": "channel", "label": "Destination channel" },
          { "name": "text", "type": "text", "label": "Message text" }
        ]
      }
    }
  ],
  "metadata": {
    "instant": false,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": true,
      "confidential": false,
      "dataloss": false,
      "dlq": false,
      "freshVariables": false
    },
    "designer": {
      "orphans": []
    },
    "zone": "eu1.make.com"
  }
}
