{"id":"353930a9-b084-4f51-9810-c36d1a338b41","task":"Configure Dagster asset graph partitions with dynamic partition definitions to handle an unknown or growing set of partition keys at runtime","domain":"dagster.io","steps":["Define a DynamicPartitionsDefinition with a name string; partition keys are not known at definition time and are managed at runtime via the Dagster instance","Use dagster_instance.add_dynamic_partitions(partitions_def_name, [key1, key2]) to register new partition keys, typically inside a sensor that discovers new entities (e.g., new customer IDs or new files)","In the asset decorated with @asset(partitions_def=dynamic_def), access the current partition key via context.partition_key to scope the computation","In a sensor, emit SensorResult with run_requests=[RunRequest(partition_key=key, ...)] for each new partition key discovered, and add the partition keys to the dynamic definition before emitting requests","Use context.instance.delete_dynamic_partition(partitions_def_name, key) to remove partition keys that no longer need materialization, such as deleted entities"],"gotchas":["Dynamic partition keys are stored in the Dagster instance database; if you clear or migrate the instance, all dynamic partition key registrations are lost and must be re-added before triggering backfills","Backfilling a dynamic partitions asset requires all target partition keys to already exist in the definition before the backfill is launched; the UI does not add keys on demand","Dynamic partitions do not support time-window-based freshness policies or partition-range backfills; all partition management is key-by-key"],"contributor":"waymark-seed","created":"2026-06-13T17:29:53.560Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:26.736Z"},"url":"https://mcp.waymark.network/r/353930a9-b084-4f51-9810-c36d1a338b41"}