Not every API sends webhooks.
Not every API sends webhooks. For APIs that only support polling (check for changes by making periodic requests), use the Schedule Trigger combined with an HTTP Request node and state tracking. Store the last-seen timestamp or record ID in workflow static data to fetch only new records on each poll.
Real-world example: You monitor a legacy inventory system API that has no webhook support. Every 5 minutes, you check for inventory level changes and alert when stock is low.
Schedule Trigger (every 5 minutes)
|
Code Node: Get Last Poll Timestamp
|
HTTP Request: Fetch Updated Inventory
|
IF: Any Low Stock Items?
|
+-> True: Slack Alert + Update Inventory Sheet
+-> False: (end, nothing to do)
```text
```javascript title="Code Node: Get Last Poll Timestamp"
const staticData = $getWorkflowStaticData("global");
// First run: look back 1 hour; subsequent runs: use last poll time
if (!staticData.lastPollTime) {
staticData.lastPollTime = new Date(
Date.now() - 3600000
).toISOString();
}
const lastPoll = staticData.lastPollTime;
// Update the timestamp for next run
staticData.lastPollTime = new Date().toISOString();
return [{
json: {
since: lastPoll
}
}];
```text
```text title="HTTP Request Node Configuration"
URL: https://inventory.legacy-system.com/api/v1/products
Method: GET
Query Parameters:
updated_after: {{ $json.since }}
fields: sku,name,quantity,reorder_point
limit: 500
```text
```javascript title="Code Node: Filter Low Stock Items"
const products = $input.all();
const lowStock = products
.filter(item => {
const product = item.json;
return product.quantity <= product.reorder_point;
})
.map(item => ({
json: {
sku: item.json.sku,
name: item.json.name,
current_stock: item.json.quantity,
reorder_point: item.json.reorder_point,
deficit: item.json.reorder_point - item.json.quantity
}
}));
if (lowStock.length === 0) {
return []; // Empty output stops this branch
}
return lowStock;
```text
> **Note: Polling Frequency Trade-offs**
>
> Polling too frequently wastes API calls and may hit rate limits. Polling too infrequently means delays in detecting changes. A 5-minute interval is a reasonable default for most operational monitoring. For time-critical data, consider 1-minute intervals but verify the API's rate limit policy first.
This pattern turns any read-only API into an event-driven integration by detecting changes through periodic comparison.
**Related:** [Use Path Parameters in Webhook URLs for Dynamic Routing](../webhook-mastery/01-use-path-parameters-in-webhook-urls-for-dynamic-routing.md) | [Use Edit Fields in "Map Each" Mode for Simple Renames](../data-transformation/01-use-edit-fields-in-map-each-mode-for-simple-renames.md)
I build production n8n and Cloudflare automation for teams — the same engineering behind HarperFlow. Fixed-price, escrow-protected, US-based.