Monitor ISF-10 filing deadline risk with GPT-4o-mini, Telegram and Gmail

Go to Workflow
0 views
Built by Swapnil Mandloi Swapnil Mandloi
Created on September 14, 2026

Description

Quick overview
This workflow polls a freight forwarder API every two hours to monitor open ocean shipments for ISF-10 filing deadline risk, drafts red-tier escalation memos with OpenAI, sends urgent Telegram alerts, files cases to an internal compliance API, and emails a Gmail run summary.

How it works
Runs every two hours on a schedule.
Fetches all open ocean shipments from a freight forwarder API and processes them one bill of lading at a time.
Looks up each bill of lading’s previous filing state in an n8n Data Table and calculates hours-to-vessel-load plus a green/yellow/red risk tier based on ISF filed status.
Proceeds only when the shipment’s risk tier has changed since the last check.
For red-tier (unfiled and imminent) shipments, confirms the latest vessel load time via the forwarder API, uses OpenAI to draft an internal escalation memo, sends an urgent Telegram alert, and posts the memo to an internal compliance API.
For non-red tier changes, records the change without paging.
Updates the n8n Data Table with the latest state for each shipment and sends a Gmail summary email for the batch run.

Setup
Create an HTTP Header Auth credential for the freight forwarder and compliance APIs and replace the example base URLs with your real endpoints.
Create an n8n Data Table named "isf_filing_state" with columns billOfLading, riskTier, filedStatus, and lastChecked.
Add an OpenAI API credential (for the OpenAI Chat Model) and a Telegram bot credential, then set the Telegram chat ID in the alert step.
Add a Gmail OAuth2 credential and update the recipient address for the batch summary email.

Nodes Used (6)

Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Gmail
n8n-nodes-base.gmail
HTTP Request
n8n-nodes-base.httpRequest
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Telegram
n8n-nodes-base.telegram