Network Analyst workflows can be automated by adding geoprocessing tools, data, and other elements to a model or Python script or by creating your own geoprocessing tools using models and scripts.
Create a geoprocessing model
The ArcGIS Network Analyst extension provides broad geoprocessing functionality through the Network Analyst toolbox. These geoprocessing tools 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
Python can be used to automate Network Analyst workflows. The Network Analyst module is a modern, easy-to-use 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.