# Naming task runs based on inputs
Tasks in Prefect provide a way for dynamically naming task runs based on the inputs provided to them from upstream tasks. Creating a dynamic task run name is a great way to help identify errors that may occur in a flow, for example, easily showing which mapped task failed based on the input it received. See the page on templating for details on how dynamically templated names work.
In the example snippet below we have a flow that maps over a set of data returned from an upstream task and (for demonstration purposes) it raises an error when it receives the
demo string as an input.
In the image above we can identify that one of our mapped children tasks failed however we are unable to identify exactly which task failed based on this information alone. This is where providing a template to the task's
task_run_name kwarg comes in handy.
The backend will template the task run's name based on the
val input it receives:
Now we can identify that the task with the
demo input is the one that failed!