In this article
Plan source rescanning and intentional run recreation separately; the same sensor can scan an old event again while deduplicating its unchanged run key.
Follow a file revision through the sensor
A sensor scans incoming documents and requests an analysis run for each new revision. Dagster’s sensor guide uses a cursor to retain scan progress and a run key to identify a requested execution. These values solve different problems. The cursor can avoid repeatedly listing old observations, while the run key prevents repeated requests for the same identified work from creating duplicate runs.
Choose the unit represented by a run key
The RunRequest reference defines sensor run-key deduplication across evaluations. A filename-only key treats later versions of that filename as the same requested work. A revision-bearing key can distinguish changed content, provided the revision source actually captures the changes that matter. Decide whether work represents a path, an immutable source revision or a deliberate analysis campaign before selecting the key format.
Understand why resetting progress can appear ineffective
The guide explicitly warns that resetting a cursor does not launch new runs when associated run keys remain unchanged. Rescanning the same files can therefore work correctly while run creation is skipped. Inspect both stages before blaming a broken cursor. A manual replay procedure should state whether it only repeats discovery or also creates intentionally new work; those are different operations with different effects on external analysis services.
Preserve the deduplication tradeoff
The guide notes that omitting run keys permits cursor reset to cause fresh requests. That also removes the run-key protection against duplicate creation across ordinary evaluations. Do not disable deduplication merely to make a recovery demonstration look successful. If replay has a distinct business meaning, design its identity deliberately and account for the extra runs. Task budgets connect this choice to the actual work being authorized.
Read ticks and runs together
The webserver reference describes recent sensor ticks, related runs and previewing a tick result. Use those views to distinguish evaluation, skip decisions and created executions. Tool observations can preserve the file revision, cursor and requested key in the same investigation. A successful rescan with no new run can then be explained as deduplication, rather than incorrectly reported as either missing source data or a completed analysis.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.