Incremental sync with a cursor field
By default, a flow reads whatever its source query returns -- which,
left unqualified, can mean re-reading every record on every run.
Incremental sync fixes that: it remembers the highest value seen for
a field (a LastModifiedDate, an auto-incrementing ID) and only asks the
source for records newer than that on the next run.
Setting it up
Set Cursor field on the flow to the source field that only moves forward over time -- most commonly a "last modified" timestamp. On each successful run, Pravadh MW:
- Builds an incremental query using the connector's own high-water-mark
logic (
build_incremental_query) and the cursor value from the previous run - Reads only what's newer
- Advances the stored cursor to the newest value it saw, ready for next time
The very first run has no prior cursor, so it reads everything -- exactly what you'd want for an initial backfill.
Mixed types across runs
If a connector ever returns a native type on one run and a string on another (a common side effect of round-tripping through storage), the comparison falls back to string comparison rather than crashing the run. ISO-8601 timestamps -- the usual choice for a cursor field -- still sort correctly this way.
What's next
- Avoiding duplicate records -- often used alongside a cursor field on the same flow
- Starting from a template