{
  "name": "Meeting Notes → Wiki Publisher — Purrly",
  "flow": [
    {
      "id": 1,
      "module": "gateway:CustomWebHook",
      "version": 1,
      "parameters": {
        "hook": 1,
        "maxResults": 1
      },
      "mapper": {},
      "metadata": {
        "designer": { "x": 0, "y": 0 },
        "restore": { "parameters": { "hook": { "label": "New Meeting Notes Webhook" } } },
        "parameters": [
          { "name": "hook", "type": "hook:gateway:CustomWebHook", "label": "Webhook" },
          { "name": "maxResults", "type": "number", "label": "Maximum number of results" }
        ]
      }
    },
    {
      "id": 2,
      "module": "notion:ActionQueryDatabase",
      "version": 1,
      "parameters": {
        "database": "[MEETING_NOTES_DB]"
      },
      "mapper": {
        "databaseId": "[MEETING_NOTES_DB]",
        "filter": {
          "property": "Status",
          "select": { "equals": "Ready to Publish" }
        }
      },
      "metadata": {
        "designer": { "x": 300, "y": 0 },
        "parameters": [],
        "restore": {}
      }
    },
    {
      "id": 3,
      "module": "notion:ActionCreatePage",
      "version": 1,
      "parameters": {},
      "mapper": {
        "parent": {
          "database_id": "[WIKI_DB]"
        },
        "properties": {
          "Name": {
            "title": [
              {
                "type": "text",
                "text": { "content": "{{2.results[0].properties.Name.title[0].text.content}}" }
              }
            ]
          },
          "Source Meeting": {
            "rich_text": [
              {
                "type": "text",
                "text": { "content": "{{2.results[0].id}}" }
              }
            ]
          },
          "Published": {
            "date": { "start": "{{formatDate(now; 'YYYY-MM-DD')}}" }
          },
          "Status": {
            "select": { "name": "Draft" }
          }
        }
      },
      "metadata": {
        "designer": { "x": 600, "y": 0 },
        "parameters": [],
        "restore": {}
      }
    },
    {
      "id": 4,
      "module": "builtin:BasicAggregator",
      "version": 1,
      "parameters": {
        "aggregateMode": "array"
      },
      "mapper": {},
      "metadata": {
        "designer": { "x": 900, "y": 0 },
        "parameters": [],
        "restore": {}
      }
    },
    {
      "id": 5,
      "module": "notion:ActionAppendBlocks",
      "version": 1,
      "parameters": {},
      "mapper": {
        "pageId": "{{3.id}}",
        "blocks": [
          {
            "object": "block",
            "type": "heading_2",
            "heading_2": {
              "rich_text": [{ "type": "text", "text": { "content": "Summary" } }]
            }
          },
          {
            "object": "block",
            "type": "paragraph",
            "paragraph": {
              "rich_text": [
                {
                  "type": "text",
                  "text": {
                    "content": "{{2.results[0].properties.Summary.rich_text[0].text.content}}"
                  }
                }
              ]
            }
          },
          {
            "object": "block",
            "type": "heading_2",
            "heading_2": {
              "rich_text": [{ "type": "text", "text": { "content": "Decisions" } }]
            }
          },
          {
            "object": "block",
            "type": "numbered_list_item",
            "numbered_list_item": {
              "rich_text": [
                {
                  "type": "text",
                  "text": {
                    "content": "{{2.results[0].properties.Decisions.rich_text[0].text.content}}"
                  }
                }
              ]
            }
          },
          {
            "object": "block",
            "type": "heading_2",
            "heading_2": {
              "rich_text": [{ "type": "text", "text": { "content": "Action Items" } }]
            }
          },
          {
            "object": "block",
            "type": "to_do",
            "to_do": {
              "rich_text": [
                {
                  "type": "text",
                  "text": {
                    "content": "{{2.results[0].properties.Actions.rich_text[0].text.content}}"
                  }
                }
              ],
              "checked": false
            }
          }
        ]
      },
      "metadata": {
        "designer": { "x": 1200, "y": 0 },
        "parameters": [],
        "restore": {}
      }
    },
    {
      "id": 6,
      "module": "notion:ActionUpdatePage",
      "version": 1,
      "parameters": {},
      "mapper": {
        "pageId": "{{2.results[0].id}}",
        "properties": {
          "Status": {
            "select": { "name": "Published" }
          },
          "Wiki Entry": {
            "rich_text": [{ "type": "text", "text": { "content": "{{3.id}}" } }]
          }
        }
      },
      "metadata": {
        "designer": { "x": 1500, "y": 0 },
        "parameters": [],
        "restore": {}
      }
    },
    {
      "id": 7,
      "module": "notion:ActionQueryDatabase",
      "version": 1,
      "parameters": {
        "database": "[MEETING_NOTES_DB]"
      },
      "mapper": {
        "databaseId": "[MEETING_NOTES_DB]",
        "filter": {
          "and": [
            { "property": "Status", "select": { "equals": "Ready to Publish" } },
            { "property": "Wiki Entry", "rich_text": { "is_not_empty": true } }
          ]
        }
      },
      "metadata": {
        "designer": { "x": 1800, "y": 0 },
        "parameters": [],
        "restore": {}
      }
    },
    {
      "id": 8,
      "module": "builtin:BasicRouter",
      "version": 1,
      "parameters": {},
      "mapper": {
        "routes": [
          {
            "label": "Notifications enabled",
            "condition": "{{2.results[0].properties.NotifyTeam.checkbox}} === true",
            "output": "{{9}}"
          }
        ],
        "fallback": "{{10}}"
      },
      "metadata": {
        "designer": { "x": 2100, "y": 0 },
        "parameters": [],
        "restore": {}
      }
    },
    {
      "id": 9,
      "module": "email:ActionSendEmail",
      "version": 1,
      "parameters": {},
      "mapper": {
        "to": "[TEAM_NOTIFICATION_LIST]",
        "subject": "New wiki entry: {{3.properties.Name.title[0].text.content}}",
        "content": "<p>Hey team,</p><p>A new meeting just got published to the company wiki:</p><p><strong>{{3.properties.Name.title[0].text.content}}</strong></p><p><a href=\"{{3.url}}\">→ Open the wiki entry</a></p><p>The summary, decisions, and action items have been written automatically from the meeting notes. Any tracked action items now show up as to-do blocks — check them off directly in Notion.</p><p>This email is sent by your Meeting Notes → Wiki Publisher automation.</p>",
        "contentType": "html"
      },
      "metadata": {
        "designer": { "x": 2400, "y": 0 },
        "parameters": [],
        "restore": {}
      }
    },
    {
      "id": 10,
      "module": "notion:ActionUpdatePage",
      "version": 1,
      "parameters": {},
      "mapper": {
        "pageId": "{{3.id}}",
        "properties": {
          "Status": {
            "select": { "name": "Published" }
          }
        }
      },
      "metadata": {
        "designer": { "x": 2400, "y": 120 },
        "parameters": [],
        "restore": {}
      }
    }
  ],
  "metadata": {
    "instant": true,
    "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"
  }
}
