ArcGIS Network Analyst extension workflows can be automated by adding geoprocessing tools, data, and other elements to a model or Python script or by creating custom geoprocessing tools using models and scripts.
Create a geoprocessing model
Network Analyst provides broad geoprocessing functionality through the Network Analyst toolbox. The geoprocessing tools in this toolbox can be chained in a model to automate repetitive tasks while reducing the probability of error. A model strings together a sequence of tools, using the output of one tool as the input to another tool.
Create a Python script
You can use Python to automate Network Analyst workflows. The Network Analyst module (arcpy.nax) is a modern ArcPy module for working with network analysis functionality provided with the ArcGIS Network Analyst extension extension.
Create a script tool
You can turn a Python script into a geoprocessing tool by creating a script tool that looks and acts like a system geoprocessing tool. Once created, a script tool can be opened from the Catalog and Geoprocessing panes, used in ModelBuilder and the Python window, and called from another script.