Periodically check an external system for changes and trigger workflows when new or updated records are detected. The reliable alternative when webhooks aren't available.
Rendering diagram…
Use API polling when:
Rendering diagram…
| Strategy | How It Works | Pros | Cons |
|---|---|---|---|
| Modified timestamp | Query records where last_modified > last_poll_time | Simple, widely supported | Clock skew between systems |
| Incremental ID | Query records where id > last_seen_id | No clock issues | Only works for new records, not updates |
| Hash comparison | Pull all records, compare hash to stored hashes | Catches any change | Expensive for large datasets |
| Change token/delta API | Use the system's built-in change tracking | Most efficient | Not all systems offer this |
state = read_state() // { last_poll: "2025-03-15T10:00:00Z" }
records = api.get("/records", {
modified_after: state.last_poll,
order_by: "modified_date ASC",
limit: 100
})
FOR EACH record IN records:
IF NOT already_processed(record.id, record.version):
trigger_workflow(record)
mark_processed(record.id, record.version)
state.last_poll = now()
save_state(state)
API timestamps can have issues:
You need durable state between poll runs:
| Option | Best For |
|---|---|
| SharePoint list item | Simple, visible |
| Database record | Reliable, fast |
| Workflow variable (K2) | Built-in to the platform |
| File on shared drive | Quick but fragile |
The state should contain:
last_poll_timestamp — when the last successful poll completedlast_record_id — the highest ID seen (if using incremental IDs)poll_status — running / complete / faileditems_processed_last_run — for monitoring| Data Sensitivity | Poll Interval | Notes |
|---|---|---|
| Real-time critical | 1–5 minutes | Consider webhooks instead |
| Business-day important | 15–30 minutes | Good balance |
| Daily batch | Once per day | Match business schedule |
| Weekly reporting | Once per week | Monday morning batch |
Always process records in chronological order (oldest first) and commit the state after each successful record. If you process newest first and crash halfway through, you'll skip the older ones forever.
Receive real-time events from external systems via webhooks, validate them, and trigger the appropriate workflow response. The foundation of reactive automation.
Stream row-level changes out of a database in near real-time using the transaction log. No polling, no app changes — downstream systems get inserts, updates, and deletes as they happen.
Push modelled data from your warehouse back into the SaaS tools that business teams use every day — CRM, marketing, support — so they can act on analytics without a BI detour.