{
  "id": "ujc2wJpEj35OK72q",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Notify new BOAMP IT tenders to Slack channel",
  "tags": [],
  "nodes": [
    {
      "id": "fa25f63e-3a39-4760-a7e5-1f13fd44cdf6",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1232,
        544
      ],
      "parameters": {
        "color": 5,
        "width": 500,
        "height": 380,
        "content": "## BOAMP to Slack Notification\n\n**Who it's for:** Consultants, ESN, and agencies who want instant Slack alerts when new IT tenders are published on the French BOAMP platform.\n\n**What it does:** Runs on schedule (every 6h) or manually, fetches tenders from BOAMP, formats a readable message, and posts to Slack. Configurable keyword, limit, and channel. Sends a friendly message when no tenders are found.\n\n**Setup:** Add Slack credential. Adjust Config node (channel, keyword, limit)."
      },
      "typeVersion": 1
    },
    {
      "id": "0cae8cd7-20ca-4cdf-81e8-dc5cda58e9bd",
      "name": "Sticky Note 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1776,
        576
      ],
      "parameters": {
        "color": 7,
        "width": 200,
        "height": 100,
        "content": "**Step 1 - Config**\n\nEdit channel, keyword, limit"
      },
      "typeVersion": 1
    },
    {
      "id": "1fe82fb1-3336-4f83-b756-c7108e7eb970",
      "name": "Sticky Note 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2080,
        656
      ],
      "parameters": {
        "color": 7,
        "width": 280,
        "height": 100,
        "content": "**Step 2\u20133 - Fetch & Format**\n\nBOAMP API \u2192 Build message (with/without results)"
      },
      "typeVersion": 1
    },
    {
      "id": "774108e7-fe95-4712-9bc3-71d9c457cec2",
      "name": "Sticky Note 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2464,
        656
      ],
      "parameters": {
        "color": 7,
        "width": 180,
        "height": 100,
        "content": "**Step 4 - Send**\n\nPost to Slack"
      },
      "typeVersion": 1
    },
    {
      "id": "3521a803-dd2c-46ef-b8b7-dd842d03429f",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "position": [
        1792,
        832
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "SLACK_CHANNEL",
              "type": "string",
              "value": "#tenders"
            },
            {
              "id": "2",
              "name": "BOAMP_KEYWORD",
              "type": "string",
              "value": "informatique"
            },
            {
              "id": "3",
              "name": "RESULT_LIMIT",
              "type": "number",
              "value": 5
            },
            {
              "id": "4",
              "name": "EMPTY_MESSAGE",
              "type": "string",
              "value": "Aucun appel d'offres IT trouv\u00e9 pour cette ex\u00e9cution."
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "8306073a-16eb-4a60-b9dd-cd8b5d1d2b47",
      "name": "Schedule Every 6 Hours",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1792,
        688
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 6
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5b209db3-5184-45c3-80ff-619bc9de1be0",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        1792,
        1024
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6917b65e-3872-4e93-b6da-3d214ea0c7a6",
      "name": "Fetch BOAMP IT Tenders",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2064,
        832
      ],
      "parameters": {
        "url": "=https://boamp-datadila.opendatasoft.com/api/explore/v2.1/catalog/datasets/boamp/records?limit={{ $json.RESULT_LIMIT ?? 5 }}&refine=objet:{{ $json.BOAMP_KEYWORD ?? 'informatique' }}&sort=-dateparution",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "a7ebb993-7cee-4958-98e1-9f3ccc4fac2d",
      "name": "Format Slack Message",
      "type": "n8n-nodes-base.code",
      "position": [
        2272,
        832
      ],
      "parameters": {
        "jsCode": "const config = $('Config').first().json;\nconst results = $input.first().json?.results ?? [];\nconst keyword = config.BOAMP_KEYWORD ?? 'informatique';\nconst emptyMsg = config.EMPTY_MESSAGE ?? \"Aucun appel d'offres trouv\u00e9.\";\nlet text;\nif (results.length === 0) {\n  text = `*BOAMP \u2014 ${keyword}*\\n\\n${emptyMsg}`;\n} else {\n  const lines = results.map((r, i) => `${i+1}. *${r.objet || 'Sans titre'}*\\n   \ud83d\udcc5 ${r.dateparution || 'N/A'} | ${r.nomacheteur || 'N/A'}\\n   \ud83d\udd17 ${r.url_avis || 'https://boamp.fr'}`).join('\\n\\n');\n  text = `*Nouveaux appels d'offres BOAMP \u2014 ${keyword} (${results.length})*\\n\\n${lines}`;\n}\nreturn { json: { ...config, text } };"
      },
      "typeVersion": 2
    },
    {
      "id": "e2305392-3722-44fc-9ba0-c2544a4e415f",
      "name": "Send to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        2496,
        832
      ],
      "parameters": {
        "operation": "create"
      },
      "typeVersion": 2.4
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "7d8e2609-e192-4cab-aa29-8f7511c4f5b5",
  "connections": {
    "Config": {
      "main": [
        [
          {
            "node": "Fetch BOAMP IT Tenders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Slack Message": {
      "main": [
        [
          {
            "node": "Send to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch BOAMP IT Tenders": {
      "main": [
        [
          {
            "node": "Format Slack Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Every 6 Hours": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}