Dev.to Security 🔐 Cybersecurity 👁 1 📖 19 min read

n8n for Maritime & ShippingTech SaaS Vendors: 5 Automations for MARPOL, ISM Code, FMC OSRA-22, and USCG Compliance

Who This Is For If you build or operate maritime or shipping technology — ocean carrier management systems, port operations platforms, vessel tracking SaaS, maritime compliance tools, cargo customs clearance software —

Who This Is For

If you build or operate maritime or shipping technology — ocean carrier management systems, port operations platforms, vessel tracking SaaS, maritime compliance tools, cargo customs clearance software — your platform touches some of the most stringent multi-agency regulatory frameworks in any industry.

Your customers operate under: MARPOL Annex I/II/VI (oil record books, fuel oil records, air emissions), ISM Code (International Safety Management, SMS audit trails), SOLAS (safety equipment surveys, VDR), FMC OSRA-22 (detention/demurrage tariff transparency), USCG (Certificate of Inspection, Port State Control), CBP ISF 10+2 (24-hour pre-arrival filing), STCW (seafarer certification), IMO CII/EEXI (carbon intensity indicators).

The compliance clock problem is acute: CBP ISF late filing = $5,000/day immediately. MARPOL oil spill = 24-hour USCG notification. ISM Code non-conformity = 48-hour flag state report. One missed clock means a vessel detained, a customer's COI suspended, or a $5k/day penalty accumulating while ops teams scramble.

Here are five n8n automation workflows — with full import-ready JSON — that maritime SaaS vendors use to keep customers compliant and their own platforms running.

Workflow 1: Tier-Segmented Customer Onboarding Drip

Maritime SaaS customers span a wide range: enterprise ocean carriers (ISM Code SMS requirements, USCG COI, MARPOL full suite), port management vendors, maritime insurance tech, vessel tracking platforms, and cargo customs tech. A single generic onboarding sequence fails every tier.

This workflow segments new customers into seven tiers at signup and injects ISM Code context automatically for SMS-certified carriers — because USCG 33 CFR Part 96 requires an ISM audit trail that cannot transit third-party cloud services.

Customer tiers:

  • ENTERPRISE_OCEAN_CARRIER — MARPOL Annex I/II/VI + ISM Code + USCG COI + IMO CII
  • MIDMARKET_FREIGHT_OPERATOR — FMC OSRA-22 + CBP ISF + CTPAT
  • PORT_MANAGEMENT_SAAS_VENDOR — USCG Port State Control + SOLAS + AIS
  • MARITIME_INSURANCE_TECH — MARPOL Annex I liability + ISM non-conformity data
  • VESSEL_TRACKING_SAAS — SOLAS Chapter V/33 AIS requirements
  • MARITIME_COMPLIANCE_SAAS — ISM Code SMS + STCW + flag state
  • CARGO_CUSTOMS_TECH_VENDOR — CBP ISF 10+2 + C-TPAT + FMC
{
  "name": "Maritime SaaS \u2014 Tiered Customer Onboarding Drip",
  "nodes": [
    {
      "id": "1",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        250,
        300
      ],
      "parameters": {
        "path": "maritime-onboarding",
        "httpMethod": "POST"
      }
    },
    {
      "id": "2",
      "name": "Segment & Flag Inject",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        450,
        300
      ],
      "parameters": {
        "jsCode": "\nconst d = $input.first().json;\nconst tierMap = {\n  enterprise_ocean_carrier: { label: 'Enterprise Ocean Carrier', ism: true },\n  midmarket_freight_operator: { label: 'Mid-Market Freight Operator', ism: false },\n  port_management_saas_vendor: { label: 'Port Management SaaS Vendor', ism: false },\n  maritime_insurance_tech: { label: 'Maritime Insurance Tech', ism: false },\n  vessel_tracking_saas: { label: 'Vessel Tracking SaaS', ism: false },\n  maritime_compliance_saas: { label: 'Maritime Compliance SaaS', ism: true },\n  cargo_customs_tech_vendor: { label: 'Cargo & Customs Tech Vendor', ism: false }\n};\nconst t = tierMap[d.customer_tier] || { label: 'Maritime SaaS', ism: false };\nconst ismNote = t.ism ? '\\n\\nNote: Your ISM Code SMS audit trail requires on-premise data residency \u2014 our self-hosted n8n template keeps all safety management records within your network boundary (USCG 33 CFR Part 96).' : '';\nreturn [{ json: { ...d, tierLabel: t.label, ismNote, ismSubject: t.ism } }];\n"
      }
    },
    {
      "id": "3",
      "name": "Gmail \u2014 Day 1 Welcome",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [
        650,
        300
      ],
      "parameters": {
        "operation": "send",
        "to": "={{ $json.email }}",
        "subject": "Welcome to FlowKit \u2014 your maritime compliance automation is live",
        "message": "Hi {{ $json.company_name }},\\n\\nWelcome! Your n8n maritime compliance workflows are ready. Here's what's automated on Day 1:\\n\\n\u2022 MARPOL Annex VI fuel oil record tracker\\n\u2022 ISM Code internal audit deadline monitor\\n\u2022 USCG COI renewal alerts{{ $json.ismNote }}\\n\\nYour FlowKit team"
      }
    },
    {
      "id": "4",
      "name": "Wait 3 Days",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        850,
        300
      ],
      "parameters": {
        "unit": "days",
        "amount": 3
      }
    },
    {
      "id": "5",
      "name": "Gmail \u2014 Day 4 Compliance Tips",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [
        1050,
        300
      ],
      "parameters": {
        "operation": "send",
        "to": "={{ $json.email }}",
        "subject": "Your MARPOL & FMC OSRA-22 compliance clock \u2014 what to automate first",
        "message": "Hi {{ $json.company_name }},\\n\\nThree quick wins this week:\\n\\n1. MARPOL fuel oil record (Annex VI) \u2014 automate monthly FONAR submission prep\\n2. FMC OSRA-22 tariff transparency \u2014 auto-publish detention/demurrage schedules within 30 days of changes\\n3. CBP ISF 24-hour pre-arrival \u2014 trigger filing workflow the moment a booking is confirmed\\n\\nAll three are in your FlowKit dashboard.\\n\\nYour FlowKit team"
      }
    },
    {
      "id": "6",
      "name": "Wait 4 Days",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        1250,
        300
      ],
      "parameters": {
        "unit": "days",
        "amount": 4
      }
    },
    {
      "id": "7",
      "name": "Gmail \u2014 Day 8 Check-in",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [
        1450,
        300
      ],
      "parameters": {
        "operation": "send",
        "to": "={{ $json.email }}",
        "subject": "How is your maritime compliance automation going?",
        "message": "Hi {{ $json.company_name }},\\n\\nWeek one is behind you. A quick check-in:\\n\\n\u2022 Are your USCG COI renewal dates loaded?\\n\u2022 Has the IMO CII annual rating workflow fired yet?\\n\u2022 Is your incident pipeline tested for MARPOL oil spill (24-hour USCG clock)?\\n\\nReply to this email \u2014 I read every response.\\n\\nYour FlowKit team"
      }
    },
    {
      "id": "8",
      "name": "Wait 6 Days",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        1650,
        300
      ],
      "parameters": {
        "unit": "days",
        "amount": 6
      }
    },
    {
      "id": "9",
      "name": "Gmail \u2014 Day 14 QBR Offer",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [
        1850,
        300
      ],
      "parameters": {
        "operation": "send",
        "to": "={{ $json.email }}",
        "subject": "15-minute maritime compliance audit \u2014 book your slot",
        "message": "Hi {{ $json.company_name }},\\n\\nTwo weeks in. Let's run a 15-minute audit of your compliance automation coverage:\\n\\n\u2022 MARPOL Annex I/II/VI \u2014 gap check\\n\u2022 ISM Code SMS audit trail \u2014 completeness review\\n\u2022 FMC OSRA-22 tariff publication \u2014 timing compliance\\n\\nBook here: https://calendly.com/flowkithq\\n\\nYour FlowKit team"
      }
    },
    {
      "id": "10",
      "name": "Log to Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [
        2050,
        300
      ],
      "parameters": {
        "operation": "append",
        "documentId": "YOUR_SHEET_ID",
        "sheetName": "onboarding_log",
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "email": "={{ $json.email }}",
            "company": "={{ $json.company_name }}",
            "tier": "={{ $json.tierLabel }}",
            "ts": "={{ $now.toISO() }}"
          }
        }
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Segment & Flag Inject",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Segment & Flag Inject": {
      "main": [
        [
          {
            "node": "Gmail \u2014 Day 1 Welcome",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail \u2014 Day 1 Welcome": {
      "main": [
        [
          {
            "node": "Wait 3 Days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 3 Days": {
      "main": [
        [
          {
            "node": "Gmail \u2014 Day 4 Compliance Tips",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail \u2014 Day 4 Compliance Tips": {
      "main": [
        [
          {
            "node": "Wait 4 Days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 4 Days": {
      "main": [
        [
          {
            "node": "Gmail \u2014 Day 8 Check-in",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail \u2014 Day 8 Check-in": {
      "main": [
        [
          {
            "node": "Wait 6 Days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 6 Days": {
      "main": [
        [
          {
            "node": "Gmail \u2014 Day 14 QBR Offer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail \u2014 Day 14 QBR Offer": {
      "main": [
        [
          {
            "node": "Log to Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Workflow 2: IMO/USCG/MARPOL Deadline Tracker

Maritime compliance has twelve distinct deadline types across five regulatory bodies — and unlike most SaaS verticals, missing one can result in a vessel being detained in port.

12 deadline types tracked:
| Deadline Type | Regulatory Basis | Consequence |
|---|---|---|
| MARPOL_FUEL_OIL_RECORD_MONTHLY | MARPOL Annex VI | Port State Control deficiency |
| ISM_ANNUAL_INTERNAL_AUDIT | ISM Code §9.1 / 33 CFR §96.250 | DOC suspension |
| USCG_COI_ANNUAL_RENEWAL | 46 CFR §2.01-1 | Vessel out of service |
| FMC_TARIFF_PUBLICATION_IMMEDIATE | FMC OSRA-22 §41104(a) | $50,000+ penalty |
| IMO_CII_ANNUAL_RATING_SUBMISSION | IMO MEPC.338(76) | Port restrictions |
| SOLAS_SAFETY_EQUIPMENT_ANNUAL_SURVEY | SOLAS Chapter III | Class withdrawal |
| CBP_ISF_24_HOUR_PRE_ARRIVAL | 19 CFR §149 | $5,000/day immediately |
| STCW_MEDICAL_CERTIFICATE_RENEWAL | STCW Reg. I/9 | Watchkeeping violation |
| MARPOL_ANNUAL_DRYDOCK_SURVEY | MARPOL Annex I Reg.6 | IOPP Certificate lapse |
| USCG_PORT_STATE_CONTROL_INSPECTION | 33 CFR §96.420 | Deficiency citation |
| IMO_EEXI_TECHNICAL_FILE_UPDATE | IMO MEPC.333(76) | CII rating downgrade |
| SOC2_TYPE2_RENEWAL | Enterprise contract requirement | Contract termination |

{
  "name": "Maritime Compliance Deadline Tracker",
  "nodes": [
    {
      "id": "1",
      "name": "Daily 7AM Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 7 * * *"
            }
          ]
        }
      }
    },
    {
      "id": "2",
      "name": "Postgres \u2014 Compliance Deadlines",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2,
      "position": [
        450,
        300
      ],
      "parameters": {
        "operation": "executeQuery",
        "query": "SELECT deadline_type, description, due_date, assigned_to, customer_id FROM maritime_compliance_deadlines WHERE due_date <= CURRENT_DATE + INTERVAL '90 days' ORDER BY due_date ASC"
      }
    },
    {
      "id": "3",
      "name": "Classify Urgency",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        650,
        300
      ],
      "parameters": {
        "jsCode": "\nconst deadlineLabels = {\n  MARPOL_FUEL_OIL_RECORD_MONTHLY: 'MARPOL Annex VI \u2014 Monthly Fuel Oil Record (FONAR)',\n  ISM_ANNUAL_INTERNAL_AUDIT: 'ISM Code \u2014 Annual Internal Safety Audit (33 CFR \u00a796.250)',\n  USCG_COI_ANNUAL_RENEWAL: 'USCG Certificate of Inspection \u2014 Annual Renewal',\n  FMC_TARIFF_PUBLICATION_IMMEDIATE: 'FMC OSRA-22 \u2014 Tariff/D&D Schedule Publication (30 days)',\n  IMO_CII_ANNUAL_RATING_SUBMISSION: 'IMO CII \u2014 Annual Carbon Intensity Indicator Rating',\n  SOLAS_SAFETY_EQUIPMENT_ANNUAL_SURVEY: 'SOLAS Chapter III \u2014 Annual Safety Equipment Survey',\n  CBP_ISF_24_HOUR_PRE_ARRIVAL: 'CBP ISF 10+2 \u2014 24-Hour Pre-Arrival Filing',\n  STCW_MEDICAL_CERTIFICATE_RENEWAL: 'STCW \u2014 Seafarer Medical Certificate Renewal',\n  MARPOL_ANNUAL_DRYDOCK_SURVEY: 'MARPOL Annex I \u2014 Annual Drydock Survey',\n  USCG_PORT_STATE_CONTROL_INSPECTION: 'USCG Port State Control \u2014 Inspection Readiness Review',\n  IMO_EEXI_TECHNICAL_FILE_UPDATE: 'IMO EEXI \u2014 Energy Efficiency Technical File Annual Update',\n  SOC2_TYPE2_RENEWAL: 'SOC 2 Type II \u2014 Annual Audit Renewal'\n};\nreturn $input.all().map(item => {\n  const d = item.json;\n  const due = new Date(d.due_date);\n  const now = new Date();\n  const daysLeft = Math.ceil((due - now) / 86400000);\n  let urgency = 'NOTICE';\n  if (daysLeft < 0) urgency = 'OVERDUE';\n  else if (daysLeft <= 7) urgency = 'CRITICAL';\n  else if (daysLeft <= 14) urgency = 'URGENT';\n  else if (daysLeft <= 30) urgency = 'WARNING';\n  return { json: { ...d, daysLeft, urgency, label: deadlineLabels[d.deadline_type] || d.deadline_type } };\n});\n"
      }
    },
    {
      "id": "4",
      "name": "Filter Actionable",
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2,
      "position": [
        850,
        300
      ],
      "parameters": {
        "conditions": {
          "options": {
            "combinator": "or"
          },
          "conditions": [
            {
              "leftValue": "={{ $json.urgency }}",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "rightValue": "OVERDUE"
            },
            {
              "leftValue": "={{ $json.urgency }}",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "rightValue": "CRITICAL"
            },
            {
              "leftValue": "={{ $json.urgency }}",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "rightValue": "URGENT"
            },
            {
              "leftValue": "={{ $json.urgency }}",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "rightValue": "WARNING"
            }
          ]
        }
      }
    },
    {
      "id": "5",
      "name": "Slack #maritime-compliance",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2,
      "position": [
        1050,
        300
      ],
      "parameters": {
        "operation": "post",
        "channel": "#maritime-compliance",
        "text": "={{ $json.urgency }}: {{ $json.label }} \u2014 {{ $json.daysLeft }} days left ({{ $json.due_date }}) \u2014 Owner: {{ $json.assigned_to }}"
      }
    },
    {
      "id": "6",
      "name": "Gmail \u2014 Compliance Owner",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [
        1250,
        300
      ],
      "parameters": {
        "operation": "send",
        "to": "={{ $json.assigned_to }}",
        "subject": "[{{ $json.urgency }}] {{ $json.label }} due in {{ $json.daysLeft }} days",
        "message": "This maritime compliance deadline requires your attention:\\n\\n{{ $json.label }}\\nDue: {{ $json.due_date }} ({{ $json.daysLeft }} days)\\nCustomer: {{ $json.customer_id }}\\nUrgency: {{ $json.urgency }}\\n\\nAction required before the deadline to avoid regulatory penalties."
      }
    }
  ],
  "connections": {
    "Daily 7AM Schedule": {
      "main": [
        [
          {
            "node": "Postgres \u2014 Compliance Deadlines",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres \u2014 Compliance Deadlines": {
      "main": [
        [
          {
            "node": "Classify Urgency",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Urgency": {
      "main": [
        [
          {
            "node": "Filter Actionable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Actionable": {
      "main": [
        [
          {
            "node": "Slack #maritime-compliance",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack #maritime-compliance": {
      "main": [
        [
          {
            "node": "Gmail \u2014 Compliance Owner",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Workflow 3: Maritime API Health Monitor

Your maritime platform depends on five external data integrations — each tied to a specific regulatory requirement. When one goes down, your customers' compliance data pipeline breaks silently.

5 monitored endpoints:

  • AIS Tracking API — SOLAS Chapter V/33 AIS reporting (vessel position, voyage data)
  • USCG NMC API — STCW certificate validation (National Maritime Center)
  • FMC Tariff API — OSRA-22 detention/demurrage tariff retrieval
  • MARPOL Fuel Oil Record API — Annex VI FONAR automated submission
  • CBP ISF/ACE API — Importer Security Filing pre-arrival submission

This workflow fires every 15 minutes, pings all five endpoints, and pages #platform-ops plus the enterprise customer's ops contact when any integration is non-responsive.

{
  "name": "Maritime API Health Monitor",
  "nodes": [
    {
      "id": "1",
      "name": "Every 15 Minutes",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "*/15 * * * *"
            }
          ]
        }
      }
    },
    {
      "id": "2",
      "name": "AIS Tracking API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        450,
        200
      ],
      "parameters": {
        "url": "{{ $vars.AIS_TRACKING_API }}/health",
        "method": "GET",
        "timeout": 10000,
        "options": {
          "response": {
            "response": {
              "neverError": true
            }
          }
        }
      }
    },
    {
      "id": "3",
      "name": "USCG NMC API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        450,
        300
      ],
      "parameters": {
        "url": "{{ $vars.USCG_NMC_API }}/health",
        "method": "GET",
        "timeout": 10000,
        "options": {
          "response": {
            "response": {
              "neverError": true
            }
          }
        }
      }
    },
    {
      "id": "4",
      "name": "FMC Tariff API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        450,
        400
      ],
      "parameters": {
        "url": "{{ $vars.FMC_TARIFF_API }}/health",
        "method": "GET",
        "timeout": 10000,
        "options": {
          "response": {
            "response": {
              "neverError": true
            }
          }
        }
      }
    },
    {
      "id": "5",
      "name": "MARPOL Fuel API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        450,
        500
      ],
      "parameters": {
        "url": "{{ $vars.MARPOL_FUEL_API }}/health",
        "method": "GET",
        "timeout": 10000,
        "options": {
          "response": {
            "response": {
              "neverError": true
            }
          }
        }
      }
    },
    {
      "id": "6",
      "name": "CBP Customs API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        450,
        600
      ],
      "parameters": {
        "url": "{{ $vars.CBP_CUSTOMS_API }}/health",
        "method": "GET",
        "timeout": 10000,
        "options": {
          "response": {
            "response": {
              "neverError": true
            }
          }
        }
      }
    },
    {
      "id": "7",
      "name": "Detect Failures",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        700,
        400
      ],
      "parameters": {
        "jsCode": "\nconst apis = [\n  { name: 'ais_tracking_api', label: 'AIS Tracking (SOLAS V/33)', data: $('AIS Tracking API').first().json },\n  { name: 'uscg_nmc_api', label: 'USCG NMC STCW Certificate API', data: $('USCG NMC API').first().json },\n  { name: 'fmc_tariff_api', label: 'FMC Tariff / OSRA-22 API', data: $('FMC Tariff API').first().json },\n  { name: 'marpol_fuel_api', label: 'MARPOL Fuel Oil Record API (Annex VI)', data: $('MARPOL Fuel API').first().json },\n  { name: 'cbp_customs_api', label: 'CBP ISF 10+2 Customs API', data: $('CBP Customs API').first().json }\n];\nconst failures = apis.filter(a => !a.data || a.data.statusCode >= 400);\nif (!failures.length) return [{ json: { allHealthy: true } }];\nreturn failures.map(f => ({ json: { api: f.name, label: f.label, status: f.data?.statusCode || 'TIMEOUT', allHealthy: false } }));\n"
      }
    },
    {
      "id": "8",
      "name": "IF Any Down",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        900,
        400
      ],
      "parameters": {
        "conditions": {
          "options": {
            "combinator": "and"
          },
          "conditions": [
            {
              "leftValue": "={{ $json.allHealthy }}",
              "operator": {
                "type": "boolean",
                "operation": "equals"
              },
              "rightValue": false
            }
          ]
        }
      }
    },
    {
      "id": "9",
      "name": "Slack #platform-ops",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2,
      "position": [
        1100,
        300
      ],
      "parameters": {
        "operation": "post",
        "channel": "#platform-ops",
        "text": "ALERT: {{ $json.label }} is DOWN ({{ $json.status }}) \u2014 maritime compliance data pipeline affected"
      }
    },
    {
      "id": "10",
      "name": "Gmail \u2014 Enterprise Alert",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [
        1100,
        500
      ],
      "parameters": {
        "operation": "send",
        "to": "[email protected]",
        "subject": "[CRITICAL] Maritime API Down: {{ $json.label }}",
        "message": "The {{ $json.label }} is returning {{ $json.status }}.\\n\\nThis may affect:\\n\u2022 MARPOL compliance data ingestion\\n\u2022 USCG certificate validation\\n\u2022 FMC tariff transparency requirements\\n\\nInvestigating now."
      }
    }
  ],
  "connections": {
    "Every 15 Minutes": {
      "main": [
        [
          {
            "node": "AIS Tracking API",
            "type": "main",
            "index": 0
          },
          {
            "node": "USCG NMC API",
            "type": "main",
            "index": 0
          },
          {
            "node": "FMC Tariff API",
            "type": "main",
            "index": 0
          },
          {
            "node": "MARPOL Fuel API",
            "type": "main",
            "index": 0
          },
          {
            "node": "CBP Customs API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AIS Tracking API": {
      "main": [
        [
          {
            "node": "Detect Failures",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "USCG NMC API": {
      "main": [
        [
          {
            "node": "Detect Failures",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FMC Tariff API": {
      "main": [
        [
          {
            "node": "Detect Failures",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MARPOL Fuel API": {
      "main": [
        [
          {
            "node": "Detect Failures",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CBP Customs API": {
      "main": [
        [
          {
            "node": "Detect Failures",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect Failures": {
      "main": [
        [
          {
            "node": "IF Any Down",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Any Down": {
      "main": [
        [
          {
            "node": "Slack #platform-ops",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Gmail \u2014 Enterprise Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Workflow 4: Maritime Regulatory Incident Pipeline

When a maritime incident occurs, your customers need to know the exact regulatory clock, the reporting authority, and the required action — within seconds, not hours.

8 incident types with regulatory clocks:
| Incident Type | Severity | Clock | Authority |
|---|---|---|---|
| MARPOL_OIL_SPILL_INCIDENT | CRITICAL | 24h | USCG/Flag State MARPOL Annex I |
| VESSEL_GROUNDING_COLLISION | CRITICAL | 24h | USCG 46 CFR §4.05-1 / NTSB |
| ISM_NONCONFORMITY_CRITICAL | HIGH | 48h | Flag State ISM Code §9.1 |
| SOLAS_SAFETY_EQUIPMENT_FAILURE | HIGH | 72h | Flag State SOLAS Chapter III |
| FMC_DETENTION_DEMURRAGE_DISPUTE | MEDIUM | 30d | FMC OSRA-22 §41104(a) |
| CBP_ISF_LATE_FILING | CRITICAL | IMMEDIATE | CBP 19 CFR §149 — $5,000/day |
| STCW_WATCHKEEPING_VIOLATION | HIGH | 24h | Flag State STCW Reg. VIII/1 |
| DATA_BREACH_VESSEL_OPS | MEDIUM | 72h | IMO MSC-FAL.1/Circ.3 / GDPR Art.33 |

Fastest clock: CBP_ISF_LATE_FILING — immediate $5,000/day penalty (no grace period under 19 CFR §149). The Designated Person Ashore (DPA) is CC'd on all CRITICAL incidents automatically.

{
  "name": "Maritime Regulatory Incident Pipeline",
  "nodes": [
    {
      "id": "1",
      "name": "Incident Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        250,
        300
      ],
      "parameters": {
        "path": "maritime-incident",
        "httpMethod": "POST"
      }
    },
    {
      "id": "2",
      "name": "Classify Incident",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        450,
        300
      ],
      "parameters": {
        "jsCode": "\nconst d = $input.first().json;\nconst matrix = {\n  MARPOL_OIL_SPILL_INCIDENT: { sev: 'CRITICAL', clock: '24h', regulator: 'USCG/Flag State MARPOL Annex I Reg.26', action: 'Notify USCG National Response Center (800-424-8802) within 24h. Prepare fuel oil record book and SOPEP.' },\n  VESSEL_GROUNDING_COLLISION: { sev: 'CRITICAL', clock: '24h', regulator: 'USCG 46 CFR \u00a74.05-1 / NTSB', action: 'File USCG CG-2692 within 5 days. Preserve VDR data. ISM Code non-conformity report to flag state.' },\n  ISM_NONCONFORMITY_CRITICAL: { sev: 'HIGH', clock: '48h', regulator: 'Flag State / ClassSociety ISM Code \u00a79.1', action: 'Issue corrective action request. Notify Designated Person Ashore (DPA). Log in SMS.' },\n  SOLAS_SAFETY_EQUIPMENT_FAILURE: { sev: 'HIGH', clock: '72h', regulator: 'Flag State SOLAS Chapter III', action: 'Log deficiency. Schedule emergency survey. Notify Port State Control if in port.' },\n  FMC_DETENTION_DEMURRAGE_DISPUTE: { sev: 'MEDIUM', clock: '30d', regulator: 'FMC OSRA-22 \u00a741104(a)', action: 'Publish invoice within 30 days. File FMC dispute form if carrier non-compliant.' },\n  CBP_ISF_LATE_FILING: { sev: 'CRITICAL', clock: 'IMMEDIATE', regulator: 'CBP 19 CFR \u00a7149 \u2014 $5,000/day', action: 'File ISF 10+2 immediately. Prepare penalty mitigation letter. Log in CBP ACE.' },\n  STCW_WATCHKEEPING_VIOLATION: { sev: 'HIGH', clock: '24h', regulator: 'Flag State STCW Reg. VIII/1', action: 'Relieve watchkeeper immediately. Document incident. Notify DPA and flag state administration.' },\n  DATA_BREACH_VESSEL_OPS: { sev: 'MEDIUM', clock: '72h', regulator: 'IMO MSC-FAL.1/Circ.3 / GDPR Art.33', action: 'Isolate affected systems. Notify flag state cyber focal point within 72h. Preserve logs.' }\n};\nconst inc = matrix[d.incident_type] || { sev: 'MEDIUM', clock: '72h', regulator: 'Review required', action: 'Investigate and escalate.' };\nreturn [{ json: { ...d, ...inc } }];\n"
      }
    },
    {
      "id": "3",
      "name": "Route by Severity",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3,
      "position": [
        650,
        300
      ],
      "parameters": {
        "mode": "rules",
        "rules": {
          "values": [
            {
              "outputKey": "CRITICAL",
              "conditions": {
                "options": {
                  "combinator": "and"
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.sev }}",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "rightValue": "CRITICAL"
                  }
                ]
              }
            },
            {
              "outputKey": "HIGH",
              "conditions": {
                "options": {
                  "combinator": "and"
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.sev }}",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "rightValue": "HIGH"
                  }
                ]
              }
            },
            {
              "outputKey": "MEDIUM",
              "conditions": {
                "options": {
                  "combinator": "and"
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.sev }}",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "rightValue": "MEDIUM"
                  }
                ]
              }
            }
          ]
        }
      }
    },
    {
      "id": "4",
      "name": "Slack CRITICAL",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2,
      "position": [
        900,
        200
      ],
      "parameters": {
        "operation": "post",
        "channel": "#maritime-incidents-critical",
        "text": "CRITICAL INCIDENT: {{ $json.incident_type }} | Clock: {{ $json.clock }} | {{ $json.regulator }} | Action: {{ $json.action }}"
      }
    },
    {
      "id": "5",
      "name": "Slack HIGH",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2,
      "position": [
        900,
        350
      ],
      "parameters": {
        "operation": "post",
        "channel": "#maritime-incidents",
        "text": "HIGH INCIDENT: {{ $json.incident_type }} | Clock: {{ $json.clock }} | {{ $json.regulator }}"
      }
    },
    {
      "id": "6",
      "name": "Slack MEDIUM",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2,
      "position": [
        900,
        500
      ],
      "parameters": {
        "operation": "post",
        "channel": "#maritime-incidents",
        "text": "MEDIUM INCIDENT: {{ $json.incident_type }} | Clock: {{ $json.clock }} | {{ $json.regulator }}"
      }
    },
    {
      "id": "7",
      "name": "Gmail \u2014 DPA + CCO",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [
        1100,
        200
      ],
      "parameters": {
        "operation": "send",
        "to": "[email protected]",
        "cc": "[email protected]",
        "subject": "[CRITICAL] Maritime Incident: {{ $json.incident_type }} \u2014 {{ $json.clock }} clock active",
        "message": "Incident: {{ $json.incident_type }}\\nSeverity: CRITICAL\\nRegulatory clock: {{ $json.clock }}\\nAuthority: {{ $json.regulator }}\\n\\nRequired action: {{ $json.action }}\\n\\nIMPORTANT: Do not route incident evidence through third-party cloud tools. All documentation must remain within your ISM Code SMS perimeter."
      }
    },
    {
      "id": "8",
      "name": "Sheets Incident Log",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [
        1100,
        400
      ],
      "parameters": {
        "operation": "append",
        "documentId": "YOUR_SHEET_ID",
        "sheetName": "incident_log",
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "ts": "={{ $now.toISO() }}",
            "type": "={{ $json.incident_type }}",
            "sev": "={{ $json.sev }}",
            "clock": "={{ $json.clock }}",
            "regulator": "={{ $json.regulator }}"
          }
        }
      }
    }
  ],
  "connections": {
    "Incident Webhook": {
      "main": [
        [
          {
            "node": "Classify Incident",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Incident": {
      "main": [
        [
          {
            "node": "Route by Severity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Severity": {
      "main": [
        [
          {
            "node": "Slack CRITICAL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Slack HIGH",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Slack MEDIUM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack CRITICAL": {
      "main": [
        [
          {
            "node": "Sheets Incident Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Workflow 5: Weekly Maritime KPI Dashboard

Runs Monday 8AM. Pulls vessel metrics, MRR, and open compliance deadline counts from Postgres. Uses $getWorkflowStaticData to compute week-over-week change without a separate metrics table. Sends an HTML report to CEO/COO (BCC: CTO) and a one-liner to #management Slack.

KPIs tracked:

  • Active customers + WoW change
  • MRR + WoW % change
  • Vessels monitored
  • IMO CII compliance rate
  • Open MARPOL / USCG / FMC / IMO deadlines (next 30 days)
{
  "name": "Weekly Maritime KPI Dashboard",
  "nodes": [
    {
      "id": "1",
      "name": "Monday 8AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 8 * * 1"
            }
          ]
        }
      }
    },
    {
      "id": "2",
      "name": "Postgres \u2014 Vessel Metrics",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2,
      "position": [
        450,
        200
      ],
      "parameters": {
        "operation": "executeQuery",
        "query": "SELECT COUNT(DISTINCT customer_id) as active_customers, SUM(mrr_usd) as mrr_usd, COUNT(DISTINCT vessel_id) as vessels_monitored, SUM(CASE WHEN imo_cii_compliant THEN 1 ELSE 0 END)::float / NULLIF(COUNT(DISTINCT vessel_id),0) * 100 as cii_compliance_pct FROM vessel_accounts WHERE status = 'active'"
      }
    },
    {
      "id": "3",
      "name": "Postgres \u2014 Compliance Counts",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2,
      "position": [
        450,
        400
      ],
      "parameters": {
        "operation": "executeQuery",
        "query": "SELECT SUM(CASE WHEN deadline_type LIKE 'MARPOL%' AND status='open' THEN 1 ELSE 0 END) as marpol_open, SUM(CASE WHEN deadline_type LIKE 'USCG%' AND status='open' THEN 1 ELSE 0 END) as uscg_open, SUM(CASE WHEN deadline_type LIKE 'FMC%' AND status='open' THEN 1 ELSE 0 END) as fmc_open, SUM(CASE WHEN deadline_type LIKE 'IMO%' AND status='open' THEN 1 ELSE 0 END) as imo_open FROM maritime_compliance_deadlines WHERE due_date <= CURRENT_DATE + INTERVAL '30 days'"
      }
    },
    {
      "id": "4",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3,
      "position": [
        700,
        300
      ],
      "parameters": {
        "mode": "combineByPosition"
      }
    },
    {
      "id": "5",
      "name": "Build KPI Report",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        900,
        300
      ],
      "parameters": {
        "jsCode": "\nconst d = $input.first().json;\nconst prev = $getWorkflowStaticData('global');\nconst mrrWoW = prev.mrr_usd ? (((d.mrr_usd - prev.mrr_usd) / prev.mrr_usd) * 100).toFixed(1) : 'N/A';\nconst custWoW = prev.active_customers ? (d.active_customers - prev.active_customers) : 'N/A';\nprev.mrr_usd = d.mrr_usd; prev.active_customers = d.active_customers;\n$setWorkflowStaticData('global', prev);\nconst html = `<h2>Maritime SaaS \u2014 Weekly KPI</h2>\n<table border=\"1\" cellpadding=\"6\">\n<tr><th>Metric</th><th>This Week</th><th>WoW</th></tr>\n<tr><td>Active Customers</td><td>${d.active_customers}</td><td>${custWoW}</td></tr>\n<tr><td>MRR (USD)</td><td>$${Number(d.mrr_usd).toLocaleString()}</td><td>${mrrWoW}%</td></tr>\n<tr><td>Vessels Monitored</td><td>${d.vessels_monitored}</td><td>\u2014</td></tr>\n<tr><td>IMO CII Compliance</td><td>${Number(d.cii_compliance_pct || 0).toFixed(1)}%</td><td>\u2014</td></tr>\n<tr><td>MARPOL Open Deadlines</td><td>${d.marpol_open || 0}</td><td>\u2014</td></tr>\n<tr><td>USCG Open Deadlines</td><td>${d.uscg_open || 0}</td><td>\u2014</td></tr>\n<tr><td>FMC Open Deadlines</td><td>${d.fmc_open || 0}</td><td>\u2014</td></tr>\n<tr><td>IMO Open Deadlines</td><td>${d.imo_open || 0}</td><td>\u2014</td></tr>\n</table>`;\nreturn [{ json: { ...d, html, mrrWoW } }];\n"
      }
    },
    {
      "id": "6",
      "name": "Gmail \u2014 CEO + COO BCC CTO",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [
        1100,
        200
      ],
      "parameters": {
        "operation": "send",
        "to": "[email protected]",
        "cc": "[email protected]",
        "bcc": "[email protected]",
        "subject": "Maritime SaaS Weekly KPI \u2014 {{ $now.format('yyyy-MM-dd') }}",
        "message": "={{ $json.html }}",
        "options": {
          "appendAttribution": false
        }
      }
    },
    {
      "id": "7",
      "name": "Slack #management",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2,
      "position": [
        1100,
        400
      ],
      "parameters": {
        "operation": "post",
        "channel": "#management",
        "text": "Weekly KPI: {{ $json.active_customers }} customers | MRR ${{ $json.mrr_usd }} ({{ $json.mrrWoW }}% WoW) | {{ $json.vessels_monitored }} vessels | MARPOL open: {{ $json.marpol_open }}"
      }
    }
  ],
  "connections": {
    "Monday 8AM": {
      "main": [
        [
          {
            "node": "Postgres \u2014 Vessel Metrics",
            "type": "main",
            "index": 0
          },
          {
            "node": "Postgres \u2014 Compliance Counts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres \u2014 Vessel Metrics": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres \u2014 Compliance Counts": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Build KPI Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build KPI Report": {
      "main": [
        [
          {
            "node": "Gmail \u2014 CEO + COO BCC CTO",
            "type": "main",
            "index": 0
          },
          {
            "node": "Slack #management",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Why Self-Hosted n8n Is the Right Call for Maritime SaaS

Requirement Why cloud iPaaS fails Why self-hosted n8n solves it
MARPOL Annex I oil record book Paper-equivalent audit trail must be within vessel/company perimeter On-premise n8n keeps FONAR data local; no third-party processor in chain
ISM Code SMS audit trail USCG 33 CFR Part 96 requires documented corrective action history Self-hosted Postgres retains full SMS workflow history in your network
CBP ISF 10+2 cargo data Shipper EIN, cargo manifests, consignee data cannot egress to cloud in transit n8n sends directly to CBP ACE — no intermediate cloud storage
FMC OSRA-22 tariff data Commercially sensitive detention/demurrage schedules Self-hosted keeps tariff negotiation data off third-party servers
IMO MSC-FAL.1/Circ.3 cyber resilience Cloud iPaaS is a third-party dependency in your maritime cyber risk register Self-hosted n8n removes a vendor risk vector from your IMO cyber assessment

Get These Workflows

All five workflows are in the FlowKit n8n Maritime SaaS Compliance Pack. Import JSON directly into your n8n instance — no cloud dependency, full source access.

What's included:

  • All 5 workflows above (import-ready JSON)
  • Pre-built Postgres schema for maritime_compliance_deadlines and vessel_accounts
  • Configuration checklist for MARPOL/ISM/USCG/FMC/CBP endpoint setup
  • 12-type deadline matrix with regulatory citations

→ https://stripeai.gumroad.com

Questions? Drop them in the comments — I read every one.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.