Some partition keys are only known at run time: one per uploaded file, per customer, per experiment. dg.DynamicPartitionsDefinition(name="depot_files") starts empty; partitions are added to the Dagster instance as they appear.
The usual pattern is a sensor that finds new keys and returns a dg.SensorResult with both dynamic_partitions_requests=[depot_files.build_add_request(new)] and one dg.RunRequest(partition_key=name) per new key. Dagster adds the partitions first, then launches the runs, so each file gets its own partition, history and rerun button.
Inside the asset, context.partition_key is the file name. To check what exists, call context.instance.get_dynamic_partitions("depot_files"). Requesting a partition that was never added fails the tick, which is why the add request and the run requests travel together.
Add a partition for each new file and run it, in one tick.