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
Known 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
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp